From: Alexandre Duret-Lutz Date: Tue, 9 Jul 2002 19:12:32 +0000 (+0000) Subject: * automake.texi (Invoking Automake): Document WARNINGS. X-Git-Tag: Release-1-6b~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e717671435e199423b33d087d9c42dc97959ed4;p=thirdparty%2Fautomake.git * automake.texi (Invoking Automake): Document WARNINGS. * automake.in (switch_warning, parse_WARNINGS): New function. (setup_warnings): Rename to ... (parse_warnings): ... this. Move most of the code to switch_warning. Accept a comma separated list of categories. * tests/vars2.test: Use a comma separated list of warning categories. --- diff --git a/ChangeLog b/ChangeLog index c42af93c3..796e325d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-07-09 Alexandre Duret-Lutz + + * automake.texi (Invoking Automake): Document WARNINGS. + * automake.in (switch_warning, parse_WARNINGS): New function. + (setup_warnings): Rename to ... + (parse_warnings): ... this. Move most of the code to switch_warning. + Accept a comma separated list of categories. + * tests/vars2.test: Use a comma separated list of warning categories. + 2002-07-08 Alexandre Duret-Lutz * NEWS (New in 1.6): Mention that libtoolize is no longer run diff --git a/NEWS b/NEWS index 486cf58f2..bd9eebf9b 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,8 @@ New in 1.6a: +* Support for -Wmumble and -Wno-mumble, where mumble is a warning category + (see `automake --help' or the manual for a list of them). +* Honor the WARNINGS environment variable. +* Omit the call to depcomp when using gcc3: call the compiler directly. * A new option, std-options, tests that programs support --help and --version when `make installcheck' is run. This is enabled by --gnits. * Texinfo rules now support the `ps' and `pdf' targets. @@ -6,8 +10,10 @@ New in 1.6a: a DESTDIR install. * `+=' can be used in conditionals, even if the augmented variable was defined for another condition. -* It is no longuer a requirement to use AM_CONFIG_HEADER instead of - AC_CONFIG_HEADERS. AM_CONFIG_HEADER is obsolete. +* It is no longer a requirement to use AM_CONFIG_HEADER instead of + AC_CONFIG_HEADERS. Although still supported, AM_CONFIG_HEADER is + obsolete. It is now an error to call any of these macro before + AM_INIT_AUTOMAKE. * Use Autoconf's --trace interface to inspect configure.ac and get a more accurate view of it. * automake --output-dir is deprecated. diff --git a/automake.in b/automake.in index 9b4775c32..d2b7a1f4b 100755 --- a/automake.in +++ b/automake.in @@ -1080,6 +1080,9 @@ register_language ('name' => 'java', ################################################################ +# Parse the WARNINGS environnent variable. +&parse_WARNINGS; + # Parse command line. &parse_arguments; @@ -1337,10 +1340,15 @@ sub var_SUFFIXES_trigger ($$) ################################################################ -# Handle --warning=CATEGORY or -WCATEGORY -sub setup_warnings ($$) + +# switch_warning ($CATEGORY) +# -------------------------- +# If $CATEGORY is mumble, turn on the mumble channel. +# If it's no-mumble, turn mumble off. +# Alse handle `all' and `none' for completeness. +sub switch_warning ($) { - my ($opt, $cat) = @_; + my ($cat) = @_; my $has_no = 0; if ($cat =~ /^no-(.*)$/) @@ -1367,7 +1375,35 @@ sub setup_warnings ($$) } else { - msg 'unsupported', "unknown warning category `$cat'"; + return 1; + } + return 0; +} + +# parse_WARNINGS +# -------------- +# Honor the WARNINGS environment variable. +sub parse_WARNINGS ($$) +{ + if (exists $ENV{'WARNINGS'}) + { + # Ignore unknown categories. This is required because WARNINGS + # should be honored by many tools. + switch_warning $_ foreach (split (',', $ENV{'WARNINGS'})); + } +} + +# parse_warning ($OPTION, $ARGUMENT) +# ---------------------------------- +# Parse the argument of --warning=CATEGORY or -WCATEGORY. +sub parse_warnings ($$) +{ + my ($opt, $categories) = @_; + + foreach my $cat (split (',', $categories)) + { + msg 'unsupported', "unknown warning category `$cat'" + if switch_warning $cat; } } @@ -1396,11 +1432,11 @@ sub parse_arguments () 'a|add-missing' => \$add_missing, 'c|copy' => \$copy_missing, 'v|verbose' => sub { setup_channel 'verb', silent => 0; }, - 'W|warnings:s' => \&setup_warnings, + 'W|warnings:s' => \&parse_warnings, # These long options (--Werror and --Wno-error) for backward # compatibility. Use -Werror and -Wno-error today. - 'Werror' => sub { setup_warnings 'W', 'error'; }, - 'Wno-error' => sub { setup_warnings 'W', 'no-error'; }, + 'Werror' => sub { parse_warnings 'W', 'error'; }, + 'Wno-error' => sub { parse_warnings 'W', 'no-error'; }, ) or exit 1; diff --git a/automake.texi b/automake.texi index bf280c7ff..06c355ace 100644 --- a/automake.texi +++ b/automake.texi @@ -1059,6 +1059,15 @@ variables. The categories output by default are @samp{unsupported} and @samp{unused}. + +@vindex WARNINGS +The environment variable @samp{WARNINGS} can contain a comma separated +list of categories to enable. It will be taken into account before the +command-line switches, this way @samp{-Wnone} will also ignore any +warning category enabled by @samp{WARNINGS}. This variable is also used +by other tools like @command{autoconf}; unknown categories are ignored +for this reason. + @end table diff --git a/stamp-vti b/stamp-vti index 12e965cb3..d09a9fd83 100644 --- a/stamp-vti +++ b/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 7 July 2002 +@set UPDATED 9 July 2002 @set UPDATED-MONTH July 2002 @set EDITION 1.6a @set VERSION 1.6a diff --git a/tests/vars2.test b/tests/vars2.test index 19cfcabb0..6a542caec 100755 --- a/tests/vars2.test +++ b/tests/vars2.test @@ -15,7 +15,7 @@ EOF $ACLOCAL # Make sure this warning is print in the `portability' category. -$AUTOMAKE -Wno-error -Wnone -Wportability 2>stderr +$AUTOMAKE --warnings=no-error,none,portability 2>stderr cat stderr grep GOOD stderr && exit 1 grep _BAD stderr diff --git a/version.texi b/version.texi index 12e965cb3..d09a9fd83 100644 --- a/version.texi +++ b/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 7 July 2002 +@set UPDATED 9 July 2002 @set UPDATED-MONTH July 2002 @set EDITION 1.6a @set VERSION 1.6a