diff options
author | Zack Weinberg <zackw@panix.com> | 2020-09-21 17:09:22 -0400 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2020-09-22 15:46:44 -0400 |
commit | edcb0925a54cc7bd96e444925aa8fa1e9294b713 (patch) | |
tree | 9007a68b7a73b895833c8a0ae5cb6d1ac16c91c0 /tests | |
parent | 218cc1e49224765788aa368fe4a2e27c6652df5d (diff) | |
download | autoconf-edcb0925a54cc7bd96e444925aa8fa1e9294b713.tar.gz |
Use WARNINGS to pass down warnings options from autoreconf.
autoreconf runs a bunch of subsidiary tools, and is expected to pass
along various command-line settings, such as those controlling
warnings. It has historically done this via the command line.
However, not all of the tools recognize the same set of command-line
warnings options. There’s an existing check for whether aclocal and
automake understand ‘--warnings’ at all, but it currently assumes that
automake will accept the same set of warnings *categories* that
autoconf does. This hasn’t actually been true for many years
and is known to cause problems; see the discussion starting at
<https://lists.gnu.org/archive/html/autoconf/2020-09/msg00000.html>.
Previous patches in this series (and related patches applied to
automake) have restored agreement between the current development
trunks of the two sets of tools on the set of warnings categories, but
we still need to deal with the possibility of the *installed* tools
not being in agreement.
If we use the WARNINGS environment variable to pass down warnings
options, instead of the command line, then all the tools are already
coded to ignore unknown warning categories, and this ceases to be an
issue. And we no longer need the check for ‘--warnings’ support in
automake, either.
Also, autoreconf as well should suppress warnings from its first
invocation of autoconf, which is for tracing purposes only and may
emit spurious warnings because aclocal.m4 is not yet in place.
* bin/autoreconf.in
($aclocal_supports_warnings, $automake_supports_warnings): Delete.
(@warning): Make local to sub parse_args.
(parse_args): Do not add --warnings options to $autoconf,
$autoheader, $aclocal, or $automake. Instead, set $ENV{WARNINGS}
appropriately. No longer necessary to probe for --warnings support
from aclocal and automake.
(autoreconf_current_directory): Set $ENV{WARNINGS} temporarily to
“none” when running autoconf in trace mode. Fix typo in comment.
Close $traces immediately after we’re done with it.
* tests/torture.at (Specific warnings options for autoreconf):
New test.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/torture.at | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/torture.at b/tests/torture.at index 82706d34..ff0f53f3 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -1857,3 +1857,50 @@ AT_CHECK([autoreconf -Wall -v -i], 0, [ignore], [stderr], AT_CHECK([test -f HeeHee.in]) AT_CLEANUP + +## ------------------------------ ## +## Specific warnings options. ## +## ------------------------------ ## + +AT_SETUP([Specific warnings options for autoreconf]) +AT_KEYWORDS([autoreconf]) + +# If autoreconf is given a -W option that's mentioned in its own +# --help output, that option should not cause errors, even if some +# of the subsidiary programs don't support it. + +# We use aclocal and automake via autoreconf. +AT_CHECK([automake --version || exit 77], [], [ignore], [ignore]) + +AT_DATA([configure.ac], +[[AC_INIT(GNU foo, 1.0) +AM_INIT_AUTOMAKE +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT +]]) + +AT_DATA([Makefile.am], +[[AUTOMAKE_OPTIONS = foreign +]]) + +# To silence complaints about required helper scripts from automake. +# We aren't going to run the generated Makefile so we don't need the +# real helper scripts. +AT_DATA([install-sh], []) +AT_DATA([missing], []) + +# In order to cut down the time this test takes, we do not test all +# of the supported warning categories, just the most common case +# (-Wall) and some specific categories that are known to have been a +# problem in the past. +AT_CHECK([autoreconf -Werror -Wall], 0, [], []) +rm -rf configure config.h.in Makefile.in aclocal.m4 autom4te.cache + +AT_CHECK([autoreconf -Werror -Wcross], 0, [], []) +rm -rf configure config.h.in Makefile.in aclocal.m4 autom4te.cache + +AT_CHECK([autoreconf -Werror -Wportability-recursive], 0, [], []) +rm -rf configure config.h.in Makefile.in aclocal.m4 autom4te.cache + +AT_CLEANUP |