]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* automake.texi (Invoking Automake): Document WARNINGS.
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 9 Jul 2002 19:12:32 +0000 (19:12 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 9 Jul 2002 19:12:32 +0000 (19:12 +0000)
* 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.

ChangeLog
NEWS
automake.in
automake.texi
stamp-vti
tests/vars2.test
version.texi

index c42af93c3b82617c38ef0f2781d389ddadcb051f..796e325d0f21fe7e50356fca36ed576a4a93f580 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-07-09  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
+       * 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  <duret_g@epita.fr>
 
        * NEWS (New in 1.6): Mention that libtoolize is no longer run
diff --git a/NEWS b/NEWS
index 486cf58f278e147e5f6177b3fbee5af55694593d..bd9eebf9b22f57bfa06456525106aec179ac9b20 100644 (file)
--- 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.
index 9b4775c32719c34e42a48a9ca4318f54363516ea..d2b7a1f4b6654adc996358768cd187a0eecdf9ef 100755 (executable)
@@ -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;
 
index bf280c7ffcf0044e5905f085ab080007044db68c..06c355acef91cd693dfb2d179f5f4f87247da5a4 100644 (file)
@@ -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
 
 
index 12e965cb32e5da3734179a7ba96a3ba3a407b839..d09a9fd830f6d735898a8a422684dfe17d24e216 100644 (file)
--- 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
index 19cfcabb0e336750ef166df2f4d0375aa28953ef..6a542caec35013fba3dbf8e43654489ea00884d7 100755 (executable)
@@ -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
index 12e965cb32e5da3734179a7ba96a3ba3a407b839..d09a9fd830f6d735898a8a422684dfe17d24e216 100644 (file)
@@ -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