Skip to content

Commit 11f24fc

Browse files
R. Diezborneoa
authored andcommitted
configure.ac: improve validation of some --enable-xxx options
Catch an invalid option like "--enable-buspirate=rubbish". Also mention all valid values in the help text for those options. Change-Id: Ib0fb8904132d07cc5cde421aa816ca6971a08769 Signed-off-by: R. Diez <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8540 Reviewed-by: R. Diez <[email protected]> Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins
1 parent 2627f8c commit 11f24fc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

configure.ac

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,13 @@ AC_ARG_ENABLE([dmem],
272272
m4_define([AC_ARG_ADAPTERS], [
273273
m4_foreach([adapter], [$1],
274274
[AC_ARG_ENABLE(ADAPTER_OPT([adapter]),
275-
AS_HELP_STRING([--enable-ADAPTER_OPT([adapter])],
275+
AS_HELP_STRING([--enable-ADAPTER_OPT([adapter])[[[=yes/no/auto]]]],
276276
[Enable building support for the ]ADAPTER_DESC([adapter])[ (default is $2)]),
277-
[], [ADAPTER_VAR([adapter])=$2])
277+
[case "${enableval}" in
278+
yes|no|auto) ;;
279+
*) AC_MSG_ERROR([Option --enable-ADAPTER_OPT([adapter]) has invalid value "${enableval}".]) ;;
280+
esac],
281+
[ADAPTER_VAR([adapter])=$2])
278282
])
279283
])
280284

0 commit comments

Comments
 (0)