--enable-* and --with-* options.
* doc/autoconf.texi (Option Checking): Renamed from
(Configure Option Checking). Tighten up the wording a bit.
(External Software, Package Options): Cross-reference to Option
Checking, and use this to shorten our section.
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Prefer test -n
"$x" to test "x$foo" != x.
* lib/autoconf/status.m4 (AC_OUTPUT): Likewise.
Don't warn if $enable_option_checking is "no".
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Initialize
ac_unrecognized_opts to the empty string.
Don't echo the unrecognized opts, as this might mishandle
backslashes or leading -.
(AC_PRESERVE_HELP_ORDER): Put the --disable-option-checking
usage next to the other --disable-FEATURE options in the
help string.
2006-12-18 Steven G. Johnson <stevenj@alum.mit.edu>
* lib/autoconf/general.m4 (_AC_INIT_DEFAULTS, _AC_INIT_PARSE_ARGS):
(_AC_INIT_PARSE_ENABLE2, _AC_INIT_HELP, _AC_ENABLE_IF):
Print warning for unrecognized --with and --enable options
(AC_DISABLE_OPTION_CHECKING): New macro to disable warnings.
* lib/autoconf/status.m4 (AC_CONFIG_SUBDIRS, _AC_OUTPUT_SUBDIRS):
Disable option checking when subdirs are configured.
(AC_OUTPUT): If warnings are enabled, print warning about
unrecognized --with and --enable options at the end of
the configure output (as well as at the beginning).
* doc/autoconf.texi (Option Checking): New node.
Document new option warning functionality.
+2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Warnings are now generated by default for unknown
+ --enable-* and --with-* options.
+ * doc/autoconf.texi (Option Checking): Renamed from
+ (Configure Option Checking). Tighten up the wording a bit.
+ (External Software, Package Options): Cross-reference to Option
+ Checking, and use this to shorten our section.
+ * lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Prefer test -n
+ "$x" to test "x$foo" != x.
+ * lib/autoconf/status.m4 (AC_OUTPUT): Likewise.
+ Don't warn if $enable_option_checking is "no".
+ * lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Initialize
+ ac_unrecognized_opts to the empty string.
+ Don't echo the unrecognized opts, as this might mishandle
+ backslashes or leading -.
+ (AC_PRESERVE_HELP_ORDER): Put the --disable-option-checking
+ usage next to the other --disable-FEATURE options in the
+ help string.
+
+2006-12-18 Steven G. Johnson <stevenj@alum.mit.edu>
+
+ * lib/autoconf/general.m4 (_AC_INIT_DEFAULTS, _AC_INIT_PARSE_ARGS):
+ (_AC_INIT_PARSE_ENABLE2, _AC_INIT_HELP, _AC_ENABLE_IF):
+ Print warning for unrecognized --with and --enable options
+ (AC_DISABLE_OPTION_CHECKING): New macro to disable warnings.
+ * lib/autoconf/status.m4 (AC_CONFIG_SUBDIRS, _AC_OUTPUT_SUBDIRS):
+ Disable option checking when subdirs are configured.
+ (AC_OUTPUT): If warnings are enabled, print warning about
+ unrecognized --with and --enable options at the end of
+ the configure output (as well as at the beginning).
+ * doc/autoconf.texi (Option Checking): New node.
+ Document new option warning functionality.
+
2006-12-16 Eric Blake <ebb9@byu.net>
* configure.ac (AC_INIT): Bump version, since 2.61a is released.
on some modern systems and could no longer be maintained reliably
due to lack of ancient systems to test it on.
+** Warnings are now generated by default when an installer invokes
+ 'configure' with an unknown --enable-* or --with-* option.
+ These warnings can be disabled with the new AC_DISABLE_OPTION_CHECKING
+ macro, or by invoking 'configure' with --disable-option-checking.
+
** config.status now uses awk instead of sed for most substitutions, for speed.
- As a side effect multi-line values of substituted variables no
* External Software:: Working with other optional software
* Package Options:: Selecting optional features
* Pretty Help Strings:: Formatting help string
+* Option Checking:: Controlling checking of @command{configure} options
* Site Details:: Configuring site details
* Transforming Names:: Changing program names when installing
* Site Defaults:: Giving @command{configure} local defaults
* External Software:: Working with other optional software
* Package Options:: Selecting optional features
* Pretty Help Strings:: Formatting help string
+* Option Checking:: Controlling checking of @command{configure} options
* Site Details:: Configuring site details
* Transforming Names:: Changing program names when installing
* Site Defaults:: Giving @command{configure} local defaults
@option{--without-@var{package}} is equivalent to
@option{--with-@var{package}=no}.
-@command{configure} scripts do not complain about
-@option{--with-@var{package}} options that they do not support. This
-behavior permits configuring a source tree containing multiple packages
-with a top-level @command{configure} script when the packages support
-different options, without spurious error messages about options that
-some of the packages support. An unfortunate side effect is that option
-spelling errors are not diagnosed. No better approach to this problem
-has been suggested so far.
+Normally @command{configure} scripts complain about
+@option{--with-@var{package}} options that they do not support.
+@xref{Option Checking}, for details, and for how to override the
+defaults.
For each external software package that may be used, @file{configure.ac}
should call @code{AC_ARG_WITH} to detect whether the @command{configure}
given, it defaults to @samp{yes}. @option{--disable-@var{feature}} is
equivalent to @option{--enable-@var{feature}=no}.
-@command{configure} scripts do not complain about
-@option{--enable-@var{feature}} options that they do not support.
-This behavior permits configuring a source tree containing multiple
-packages with a top-level @command{configure} script when the packages
-support different options, without spurious error messages about options
-that some of the packages support.
-An unfortunate side effect is that option spelling errors are not diagnosed.
-No better approach to this problem has been suggested so far.
+Normally @command{configure} scripts complain about
+@option{--enable-@var{package}} options that they do not support.
+@xref{Option Checking}, for details, and for how to override the
+defaults.
For each optional feature, @file{configure.ac} should call
@code{AC_ARG_ENABLE} to detect whether the @command{configure} user asked
@end defmac
+@node Option Checking
+@section Controlling Checking of @command{configure} Options
+@cindex Options, Package
+
+The @command{configure} script checks its command-line options against a
+list of known options, like @option{--help} or @option{--config-cache}.
+An unknown option ordinarily indicates a mistake by the user and
+@command{configure} halts with an error. However, by default unknown
+@option{--with-@var{package}} and @option{--enable-@var{feature}}
+options elicit only a warning, to support configuring entire source
+trees.
+
+Source trees often contain multiple packages with a top-level
+@command{configure} script that uses the @code{AC_CONFIG_SUBDIRS} macro
+(@pxref{Subdirectories}). Because the packages generally support
+different @option{--with-@var{package}} and
+@option{--enable-@var{feature}} options, the @acronym{GNU} Coding
+Standards say they must accept unrecognized options without halting.
+Even a warning message is undesirable here, so @code{AC_CONFIG_SUBDIRS}
+automatically disables the warnings.
+
+This default behavior may be modified in two ways. First, the installer
+can invoke @command{configure} with the
+@option{--disable-option-checking} or
+@option{--enable-option-checking=fatal} options to disable these
+warnings or turn them into fatal errors, respectively. Second, the
+maintainer can use @code{AC_DISABLE_OPTION_CHECKING}.
+
+@defmac AC_DISABLE_OPTION_CHECKING
+@acindex{DISABLE_OPTION_CHECKING}
+
+By default, disable warnings for unrecognized
+@option{--with-@var{package}} or @option{--enable-@var{feature}}
+options. This is implied by @code{AC_CONFIG_SUBDIRS}.
+
+The installer can override this behavior by passing
+@option{--enable-option-checking} (enable warnings) or
+@option{--enable-option-checking=fatal} (enable errors) to
+@command{configure}.
+@end defmac
+
+
@node Site Details
@section Configuring Site Details
@cindex Site details
m4_wrap([m4_divert_text([DEFAULTS],
[ac_subst_vars='m4_ifdef([_AC_SUBST_VARS], [m4_defn([_AC_SUBST_VARS])])'
ac_subst_files='m4_ifdef([_AC_SUBST_FILES], [m4_defn([_AC_SUBST_FILES])])'
+ac_user_opts=':enable_option_checking:m4_ifdef([_AC_USER_OPTS], [m4_defn([_AC_USER_OPTS]):])'
m4_ifdef([_AC_PRECIOUS_VARS],
[_AC_ARG_VAR_STORE[]dnl
_AC_ARG_VAR_VALIDATE[]dnl
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
AC_MSG_ERROR([missing argument to $ac_option])
fi
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) AC_MSG_ERROR([Unrecognized options: $ac_unrecognized_opts]) ;;
+ *) AC_MSG_WARN( [Unrecognized options: $ac_unrecognized_opts]) ;;
+ esac
+fi
+
# Be sure to have absolute directory names.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
AC_MSG_ERROR(
[invalid ]m4_if([$2], [with], [package], [feature])[ name: $ac_useropt])
ac_useropt=`AS_ECHO(["$ac_useropt"]) | sed 's/[[-.]]/_/g'`
+ case $ac_user_opts in
+ *:$2_$ac_useropt:*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--$1-$ac_useropt"
+ ac_unrecognized_sep=', ';;
+ esac
eval $2_$ac_useropt=m4_if([$1], [$2], [\$ac_optarg], [no]) ;;dnl
])
AC_DEFUN([AC_PRESERVE_HELP_ORDER],
[m4_divert_once([HELP_ENABLE], [[
Optional Features and Packages:
+ --disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
])
m4_define([_AC_ENABLE_IF_ACTION],
-[AS_IF([test "${$1_$2+set}" = set], [$1val=$$1_$2; $3], [$4])dnl
+[m4_append_uniq([_AC_USER_OPTS], [$1_$2], [:])dnl
+AS_IF([test "${$1_$2+set}" = set], [$1val=$$1_$2; $3], [$4])dnl
])
# AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
AU_DEFUN([AC_WITH],
[AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])])
+# AC_DISABLE_OPTION_CHECKING
+# --------------------------------------------------------------------
+AC_DEFUN([AC_DISABLE_OPTION_CHECKING],
+[m4_divert_once([DEFAULTS], [enable_option_checking=no])
+])# AC_DISABLE_OPTION_CHECKING
## ----------------------------------------- ##
# This is used in _AC_OUTPUT_SUBDIRS.
AC_DEFUN([AC_CONFIG_SUBDIRS],
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_REQUIRE([AC_DISABLE_OPTION_CHECKING])dnl
m4_foreach_w([_AC_Sub], [$1],
[_AC_CONFIG_UNIQUE([SUBDIRS],
m4_bpatsubst(m4_defn([_AC_Sub]), [:.*]))])dnl
#
if test "$no_recursion" != yes; then
- # Remove --cache-file and --srcdir arguments so they do not pile up.
+ # Remove --cache-file, --srcdir, and --disable-option-checking arguments
+ # so they do not pile up.
ac_sub_configure_args=
ac_prev=
eval "set x $ac_configure_args"
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
;;
+ --disable-option-checking)
+ ;;
*)
case $ac_arg in
*\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
ac_sub_configure_args="--silent $ac_sub_configure_args"
fi
+ # Always prepend --disable-option-checking to silence warnings, since
+ # different subdirs can have different --enable and --with options.
+ ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
+
ac_popdir=`pwd`
for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
fi
dnl config.status should not do recursion.
AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ AC_MSG_WARN([Unrecognized options: $ac_unrecognized_opts])
+fi
])# AC_OUTPUT