[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

print warning for unrecognized --enable and --with options

From: Steven G. Johnson
Subject: print warning for unrecognized --enable and --with options
Date: Sat, 16 Dec 2006 19:02:14 -0500
User-agent: Thunderbird (Macintosh/20061025)

As discussed on the autoconf mailing list, the current behavior of silently ignoring unrecognized --enable and --with options is rather unfriendly and unexpected, and is a frequent source of user error. The following patch corrects this flaw, without violating the GNU Coding Standards or breaking recursive configuration.

Specifically, the patch causes configure to emit a warning when unrecognized --with and --enable options are encountered. This warning can be disabled in three ways. First, if the user passes --disable-option-checking. Second, if calls AC_DISABLE_OPTION_CHECKING. Third, if calls AC_CONFIG_SUBDIRS (which also passes --disable-option-checking to recursive configures).

Conversely, if the user passes --enable-option-checking=fatal, then configure halts with an error when unrecognized options are encountered. --enable-option checking can also be used to turn the warnings back on even if they have been disabled by as above.

When a warning is printed, it is printed twice: once at the beginning of the configure output (as soon as options are parsed), and once at the end. Rationale: it is too easy to miss warnings at the beginning of configure output, and unrecognized options are almost always errors (except for recursive configures).

ChangeLog entry follows, and cvs diff -u against CVS HEAD is attached.

Steven G. Johnson

2006-12-16  Steven G. Johnson  <address@hidden>

        * lib/autoconf/general.m4 (_AC_INIT_DEFAULTS, _AC_INIT_PARSE_ARGS),
          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: Document new option warning functionality.

Attachment: diff.out
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]