diff options
author | Zack Weinberg <zackw@panix.com> | 2020-09-12 14:59:56 -0400 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2020-09-22 15:46:42 -0400 |
commit | 1d4b7c049e6a8e918a0ca3361418cf7776f2e6fa (patch) | |
tree | d04d571ee5faea6804c47fd1e2599fd543bb2c3e /bin | |
parent | 8285f302a95021670d733a59ee690a56edb8a5b0 (diff) | |
download | autoconf-1d4b7c049e6a8e918a0ca3361418cf7776f2e6fa.tar.gz |
Manually sync ChannelDefs.pm from automake.
ChannelDefs.pm *ought* to be kept in sync between automake and autoconf,
because it defines the set of valid -W options, and autoreconf assumes
that it can pass arbitrary -W options to all of the tools it invokes.
However, it isn’t covered by either project’s ‘make fetch’ and it hasn’t
actually *been* in sync for more than 17 years.
This patch manually brings over all of the changes made on the
automake side. Once the complementary patch is applied by the
automake team, both versions of the file will be the same, and then we
can add it to the list in fetch.pl and not have this problem any more
in the future.
There are some user-visible consequences to bringing this file back
into sync. The only one worth mentioning in NEWS is that the ‘obsolete’
category of warnings is now on by default. This had quite a bit of
fallout throughout the testsuite. There are also some new warning
categories that get mentioned in --help output, but we don’t actually
generate any warnings in those categories, so people using ‘-Wall’
won’t see any change. More diagnostics are automatically tagged with
‘warning:’ or ‘error:’, which also had some fallout in the testsuite.
Finally, ‘-Werror’ no longer causes complaints about unknown warning
categories to be treated as hard errors.
Internally, there are some small API changes: ‘parse_warnings’ is no
longer usable as a ‘getopt’ callback function, and we now have a stub
Autom4te/Config.pm to match the automake code’s expectations. (This
file *should* also be synced from automake by ‘make fetch’, but we
can’t quite do that yet because it’s a generated file and our build
system is not prepared to handle adding *two* directories to @INC when
running a not-yet-installed Perl script. I plan to fix that after 2.70.)
As a side-effect of adding a Config.pm, ‘prog_error’ now says to
report the bug to bug-autoconf, not bug-automake. If this is why we
mostly haven’t been using prog_error for internal errors, we can stop
avoiding it. (I did not change anything to use prog_error in this
patch.)
* lib/Autom4te/ChannelDefs.pm: Merge from automake.
* lib/Autom4te/Config.pm: New file.
* lib/local.mk (dist_perllib_DATA): Add Autom4te/Config.pm.
* bin/autoconf.as: Update list of warning categories to match
Autom4te::ChannelDefs::usage.
* bin/autoheader.in (@warnings): New global.
(parse_args): Don’t use parse_warnings as a getopt callback.
(main): Add warnings options from our command line to $autoconf.
No need to turn on 'obsolete' warnings explicitly.
No need to include "warning: " in warning messages.
* bin/autom4te.in (parse_args): Don’t use parse_warnings as a getopt callback.
(main): No need to include "warning: " in warning messages.
* bin/autoreconf.in (parse_args): parse_warnings now takes only one argument.
* bin/autoupdate.in: Set WARNINGS=none in environment for all child processes.
* tests/local.at
(AT_CHECK_M4): Handle `autom4te: error: /usr/bin/m4 ...` like
`autom4te: /usr/bin/m4 ...`.
(_AT_CHECK_AC_MACRO): Add AUTOCONF-FLAGS argument, passed to both
autoconf and autoheader.
(AT_CHECK_MACRO): Default AUTOCONF-FLAGS argument to empty.
Pass that argument to autoheader as well as autoconf.
(AT_CHECK_AU_MACRO): Expect a “macro ‘NAME’ is obsolete’ diagnostic
on the first run of autoconf. Pass -Wno-obsolete to autoconf on the
second run, and to autoheader on both runs.
* tests/base.at
* tests/c.at
* tests/compile.at
* tests/m4sh.at
* tests/m4sugar.at
* tests/semantics.at
* tests/tools.at
* tests/torture.at:
No need to pass -Wobsolete to autoconf.
Pass -Wno-obsolete to autoheader where needed to avoid handling
the same warning twice.
Update various expectations for diagnostics to match behavior
changes.
* tests/tools.at (autoupdating AU_ALIAS): Add an AC_CONFIG_HEADERS
line to the test configure.ac to eliminate an unrelated diagnostic.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/autoconf.as | 21 | ||||
-rw-r--r-- | bin/autoheader.in | 14 | ||||
-rw-r--r-- | bin/autom4te.in | 10 | ||||
-rw-r--r-- | bin/autoreconf.in | 2 | ||||
-rw-r--r-- | bin/autoupdate.in | 5 |
5 files changed, 34 insertions, 18 deletions
diff --git a/bin/autoconf.as b/bin/autoconf.as index 1cfb5462..93563c97 100644 --- a/bin/autoconf.as +++ b/bin/autoconf.as @@ -37,16 +37,21 @@ Operation modes: -d, --debug don't remove temporary files -f, --force consider all files obsolete -o, --output=FILE save output in FILE (stdout is the default) - -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax] + -W, --warnings=CATEGORY report the warnings falling in CATEGORY Warning categories include: - 'cross' cross compilation issues - 'obsolete' obsolete constructs - 'syntax' dubious syntactic constructs - 'all' all the warnings - 'no-CATEGORY' turn off the warnings on CATEGORY - 'none' turn off all the warnings - 'error' warnings are error + cross cross compilation issues + gnu GNU coding standards (default in gnu and gnits modes) + obsolete obsolete features or constructions (default) + override user redefinitions of Automake rules or variables + portability portability issues (default in gnu and gnits modes) + portability-recursive nested Make variables (default with -Wportability) + extra-portability extra portability issues related to obscure tools + syntax dubious syntactic constructs (default) + unsupported unsupported or incomplete features (default) + all all the warnings + no-CATEGORY turn off warnings in CATEGORY + none turn off all the warnings The environment variables 'M4' and 'WARNINGS' are honored. diff --git a/bin/autoheader.in b/bin/autoheader.in index 29d0fe52..6b02cbb8 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -58,7 +58,7 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; my $config_h_in; my @prepend_include; my @include; - +my @warnings; # $HELP # ----- @@ -112,10 +112,12 @@ sub parse_args () { my $srcdir; - parse_WARNINGS; getopt ('I|include=s' => \@include, 'B|prepend-include=s' => \@prepend_include, - 'W|warnings=s' => \&parse_warnings); + 'W|warnings=s' => \@warnings); + + parse_WARNINGS; + parse_warnings @warnings; if (! @ARGV) { @@ -130,7 +132,6 @@ sub parse_args () ## -------------- ## mktmpdir ('ah'); -switch_warning 'obsolete'; parse_args; # Preach. @@ -165,6 +166,7 @@ END my $autoconf = "'$autom4te' --language=autoconf "; $autoconf .= join (' --include=', '', map { shell_quote ($_) } @include); $autoconf .= join (' --prepend-include=', '', map { shell_quote ($_) } @prepend_include); +$autoconf .= join (' --warnings=', '', map { shell_quote ($_) } @warnings); $autoconf .= ' --debug' if $debug; $autoconf .= ' --force' if $force; $autoconf .= ' --verbose' if $verbose; @@ -278,7 +280,7 @@ $out->close; { if (! -r $template) { - msg 'syntax', "warning: cannot read $template: $!"; + msg 'syntax', "cannot read $template: $!"; } else { @@ -297,7 +299,7 @@ $out->close; foreach (sort keys %symbol) { - msg 'syntax', "warning: missing template: $_"; + msg 'syntax', "missing template: $_"; if ($suggest_ac_define) { msg 'syntax', "Use AC_DEFINE([$_], [], [Description])"; diff --git a/bin/autom4te.in b/bin/autom4te.in index 78902f13..20ecca9e 100644 --- a/bin/autom4te.in +++ b/bin/autom4te.in @@ -336,12 +336,13 @@ sub parse_args () # Process the arguments for real this time. my @trace; my @prepend_include; - parse_WARNINGS; + my @warnings; + getopt ( # Operation modes: "o|output=s" => \$output, - "W|warnings=s" => \&parse_warnings, + "W|warnings=s" => \@warnings, "m|mode=s" => \$mode, "M|melt" => \$melt, @@ -365,6 +366,9 @@ sub parse_args () "no-cache" => sub { $cache = undef; }, ); + parse_WARNINGS; + parse_warnings @warnings; + fatal "too few arguments Try '$me --help' for more information." unless @ARGV; @@ -1048,7 +1052,7 @@ for (split (/\n*$separator\n*/o, contents ("$tmp/warnings"))) # In particular, m4_warn guarantees that either $stackdump is empty, or # it consists of lines where only the last line ends in "top level". my ($cat, $loc, $msg, $stacktrace) = split ('::', $_, 4); - msg $cat, $loc, "warning: $msg", + msg $cat, $loc, $msg, partial => ($stacktrace =~ /top level$/) + 0; for (split /\n/, $stacktrace) { diff --git a/bin/autoreconf.in b/bin/autoreconf.in index 73de08a7..80185ba9 100644 --- a/bin/autoreconf.in +++ b/bin/autoreconf.in @@ -167,7 +167,7 @@ sub parse_args () # lists. @warning = map { split /,/ } @warning; parse_WARNINGS; - parse_warnings '--warnings', @warning; + parse_warnings @warning; # Even if the user specified a configure.ac, trim to get the # directory, and look for configure.ac again. Because (i) the code diff --git a/bin/autoupdate.in b/bin/autoupdate.in index 3f13254b..047f8e0e 100644 --- a/bin/autoupdate.in +++ b/bin/autoupdate.in @@ -229,6 +229,11 @@ $autoconf .= " --verbose" if $verbose; $autoconf .= join (' --include=', '', map { shell_quote ($_) } @include); $autoconf .= join (' --prepend-include=', '', map { shell_quote ($_) } @prepend_include); +# Disable all warnings from autoconf invocations. +# In particular we do not want warnings about obsolete constructs, +# which are on by default as of autoconf 2.70. +$ENV{'WARNINGS'} = 'none'; + mktmpdir ('au'); handle_autoconf_macros; |