[PATCH v2] configure: add support for --disable-option-checking

Kris Van Hees <[email protected]> Thu, 19 Feb 2026 10:56:28 -0500
Newsgroups dev.linux.lists.dtrace
Message-ID <DS0PR10MB7522D2C2960EE7C218C971F5C26BA@DS0PR10MB7522.namprd10.prod.outlook.com>
Signed-off-by: Kris Van Hees <[email protected]>
---
 configure | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/configure b/configure
index a3107fd0..cb2f585a 100755
--- a/configure
+++ b/configure
@@ -101,6 +101,7 @@ EOF
         cat >&2 <<'EOF'
 Optional features:
 
+--disable-option-checking	Ignore unrecognized --enable/--with options
 --disable-dependency-tracking	Suppress automatic dependency tracking
 
 Options controlling the compiler (pass on the command line):
@@ -126,6 +127,11 @@ rm -rf build/.config.new build/.config-vars.mk.new
 echo 'override CONFIGURED_VARS=' > build/.config-vars.mk.new
 trap 'rm -rf build/.config.new build/.config-vars.mk.new' ERR
 
+# Should we report unknown --disable/enable/with/without-* options?
+if echo " $@ " | grep ' --disable-option-checking ' &>/dev/null; then
+   no_check_opts=t
+fi
+
 for option in "$@"; do
     case "$option" in
         --help) help; exit 1;;
@@ -177,6 +183,11 @@ for option in "$@"; do
         HAVE_BPFMASM=*) write_config_var BPFMASM "$option";;
         --disable-dependency-tracking) write_make_var WITHOUT_DEPENDENCIES "y";;
         --enable-dependency-tracking) write_make_var WITHOUT_DEPENDENCIES "n";;
+        --disable-*|--enable-*|--with-*|--without-*)
+           if [[ -z $no_check_opts ]]; then
+              echo "Unknown option $option" >&2
+              exit 1
+           fi;;
         *) echo "Unknown option $option" >&2
            exit 1;;
     esac
-- 
2.51.0