summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorThomas Heijligen <thomas.heijligen@secunet.com>2023-02-20 13:18:50 +0100
committerAnastasia Klimchuk <aklm@chromium.org>2023-04-27 09:31:49 +0000
commitba6acffc69b679829bf46f3636b4f6c04bfa7729 (patch)
treeaabff1051eef717fe927d0d42e7909be6594c168 /meson.build
parent7348eb3320d277aa1d42563009f77189701b47f0 (diff)
downloadflashrom-ba6acffc69b679829bf46f3636b4f6c04bfa7729.tar.gz
flashrom-ba6acffc69b679829bf46f3636b4f6c04bfa7729.tar.bz2
flashrom-ba6acffc69b679829bf46f3636b4f6c04bfa7729.zip
cli_classic: include a fallback inplementation of getopt
Some systems, DJGPP/DOS for now, may not provide getopt and their gnu extensions. So provide a fallback implementation. The code is based on musl libc. Change-Id: I6ebbde075014e3b45b0f9e04b34b72aa969e1197 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/73102 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build17
1 files changed, 12 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index 4341ccfea..b7d578f44 100644
--- a/meson.build
+++ b/meson.build
@@ -633,13 +633,20 @@ pkgg.generate(
)
if get_option('classic_cli').enabled() or get_option('classic_cli').auto() and not get_option('default_library') == 'shared'
+
+ cli_srcs = files(
+ 'cli_classic.c',
+ 'cli_common.c',
+ 'cli_output.c'
+ )
+
+ if not cc.has_function('getopt_long')
+ cli_srcs += files('cli_getopt.c')
+ endif
+
classic_cli = executable(
'flashrom',
- files(
- 'cli_classic.c',
- 'cli_common.c',
- 'cli_output.c',
- ),
+ cli_srcs,
c_args : cargs,
include_directories : include_dir,
install : true,