This is an automated email from Gerrit.

"R. Diez <rdiez-2...@rd10.de>" just uploaded a new patch set to Gerrit, which 
you can find at https://review.openocd.org/c/openocd/+/8540

-- gerrit

commit 22b4357cc6542aa43308b1ed9684024b25234088
Author: R. Diez <rdiezmail-open...@yahoo.de>
Date:   Tue Nov 5 14:40:50 2024 +0100

    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 <rdiezmail-open...@yahoo.de>

diff --git a/configure.ac b/configure.ac
index 9355ffb932..76dda4ced4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -256,9 +256,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])
   ])
 ])
 

-- 

Reply via email to