Skip to content

Commit

Permalink
configure.ac: improve validation of some --enable-xxx options
Browse files Browse the repository at this point in the history
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
  • Loading branch information
R. Diez authored and borneoa committed Nov 23, 2024
1 parent 2627f8c commit 11f24fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,13 @@ AC_ARG_ENABLE([dmem],
m4_define([AC_ARG_ADAPTERS], [
m4_foreach([adapter], [$1],
[AC_ARG_ENABLE(ADAPTER_OPT([adapter]),
AS_HELP_STRING([--enable-ADAPTER_OPT([adapter])],
AS_HELP_STRING([--enable-ADAPTER_OPT([adapter])[[[=yes/no/auto]]]],
[Enable building support for the ]ADAPTER_DESC([adapter])[ (default is $2)]),
[], [ADAPTER_VAR([adapter])=$2])
[case "${enableval}" in
yes|no|auto) ;;
*) AC_MSG_ERROR([Option --enable-ADAPTER_OPT([adapter]) has invalid value "${enableval}".]) ;;
esac],
[ADAPTER_VAR([adapter])=$2])
])
])

Expand Down

0 comments on commit 11f24fc

Please sign in to comment.