From aa7e10bb0919982bfdc510bd9cdc8b84d621d80b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 27 May 2017 13:50:37 +0200 Subject: [PATCH] Check --enable-xxx and --with-xxx options in configure by default Give an error if an unknown option is specified because this is very helpful for catching typos which happen quite frequently in practice, considering the number of options that we have. To explicitly allow unknown options, i.e. restore the old behaviour, --disable-option-checking can be used. --- configure | 3 +++ configure.in | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/configure b/configure index 318f13ac17..28173dcc34 100755 --- a/configure +++ b/configure @@ -623,6 +623,7 @@ ac_includes_default="\ #endif" enable_option_checking=no +enable_option_checking=fatal ac_subst_vars='LTLIBOBJS LIBOBJS CPPUNIT_CONFIG @@ -40281,6 +40282,8 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi + + echo echo "Configured wxWidgets ${WX_VERSION} for \`${host}'" echo "" diff --git a/configure.in b/configure.in index c4e5f0f9f5..11638b042d 100644 --- a/configure.in +++ b/configure.in @@ -8300,6 +8300,19 @@ fi dnl wxWITH_SUBDIRS AC_OUTPUT +dnl Enable strict option checking by default because typos in --enable-xxx is +dnl a much more common case than wanting to explicitly pass an option unknown +dnl to the main configure script (this one) to a configure scripts in a +dnl subdirectory (e.g. src/tiff or src/expat). If someone really needs to do +dnl the latter, --disable-option-checking would need to be explicitly used. +dnl +dnl Notice that we need to do this at the very end of configure script as +dnl otherwise this would be overridden by AC_CONFIG_SUBDIRS() which disables +dnl option checking. And we need to use m4_divert_text() because we want this +dnl to appear in the beginning of the generated file, before the code parsing +dnl the options. +m4_divert_text([DEFAULTS],[enable_option_checking=fatal]) + dnl report how we have been configured echo echo "Configured wxWidgets ${WX_VERSION} for \`${host}'"