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 /tests/tools.at | |
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 'tests/tools.at')
-rw-r--r-- | tests/tools.at | 54 |
1 files changed, 48 insertions, 6 deletions
diff --git a/tests/tools.at b/tests/tools.at index 3093225c..1bb670fa 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -100,7 +100,7 @@ mkdir sub mv foo sub AT_CHECK_M4SUGAR([], [1], [], [m4:script.4s:1: cannot open `foo': No such file or directory -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]) # But if we change the main file, then we should no longer complain of @@ -414,7 +414,7 @@ AC_CONFIG_MACRO_DIR_TRACE([dir1]) AT_CHECK_AUTOCONF([], [1], [], [[configure.ac:2: error: Do not invoke AC_CONFIG_MACRO_DIR_TRACE directly configure.ac:2: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) # Legacy macro use is not required, but still gets traced @@ -952,7 +952,17 @@ AT_DATA([dst2], dst2 # Checking `autoupdate'. AT_CHECK_AUTOUPDATE([], 0, [], ignore) -AT_CHECK_AUTOCONF + +# The replacement for AC_LINK_FILES includes a forced -Wobsolete +# warning, becuause it needs to be manually adjusted afterward. +# Look for it in the autoconf output. +AT_CHECK_AUTOCONF([], 0, [], stderr) +AT_CHECK([grep 'AC_LINK_FILES' stderr], 0, ignore, ignore) +AT_CHECK([grep 'AC_CONFIG_LINKS' stderr], 0, ignore, ignore) +AT_CHECK([grep 'warning: It is technically impossible' stderr], + 0, ignore, ignore) +AT_CHECK([grep 'tune the result yourself' stderr], 0, ignore, ignore) + AT_CHECK_CONFIGURE AT_CHECK([cat src1], 0, [dst1 ]) @@ -994,12 +1004,37 @@ AU_ALIAS([BAZ],[FOO]) test "FOO:FOO():FOO(x) BAZ:BAZ():BAZ(x)" = "0:1:1 0:1:1" || exit 1 AC_PROG_CC AC_WORDS_BIGENDIAN +AC_CONFIG_HEADERS([config.h]) AC_OUTPUT ]]) # Checking `autoupdate'. AT_CHECK_AUTOUPDATE -AT_CHECK_AUTOCONF + +# autoupdate does not replace AU_DEFUNs/AU_ALIASes defined by +# configure.ac itself, nor by aclocal.m4, so BAZ will still be present +# in the updated configure.ac. This is actually desirable for this +# test: the point of that part of the above configure.ac is to to +# verify that the expansion of an AU_ALIAS definition handles $# +# correctly. If BAZ got turned into FOO by the above call to +# autoupdate, we would need to run autoconf and configure twice in +# this test. However, it does also mean that by default we get a +# -Wobsolete warning because of BAZ, so turn that off so it doesn't +# cause a spurious failure. +AT_CHECK_AUTOCONF([-Wno-obsolete]) +AT_CHECK_AUTOHEADER([-Wno-obsolete], [ + AC_APPLE_UNIVERSAL_BUILD + HAVE_INTTYPES_H + HAVE_STDINT_H + HAVE_STDLIB_H + HAVE_STRINGS_H + HAVE_STRING_H + HAVE_SYS_STAT_H + HAVE_SYS_TYPES_H + HAVE_UNISTD_H + STDC_HEADERS + WORDS_BIGENDIAN +]) AT_CHECK_CONFIGURE AT_CHECK([grep 'AC_C_BIGENDIAN[(]' configure.ac], 1, [ignore], [ignore]) AT_CHECK([grep 'AC_C_BIGENDIAN' configure.ac], 0, [ignore], [ignore]) @@ -1208,9 +1243,16 @@ AC_OUTPUT ]]) # Checking `autoupdate'. + +# Both the autoupdate and autoconf invocations will complain about +# AC_LANG_SAVE being obsolete, because autoupdate cannot replace +# two-macro sequences (e.g. AC_LANG_SAVE \n AC_LANG([C]) ideally would +# become AC_LANG_PUSH([C]) but we can't do that) so an AC_DIAGNOSE +# is left in place to remind people they need to do some hand edits. +# Ignore these diagnostics. AT_CHECK_AUTOUPDATE([], [], [], [ignore]) -AT_CHECK_AUTOCONF -AT_CHECK_CONFIGURE([], [], [], [ignore]) +AT_CHECK_AUTOCONF([], [], [], [ignore]) +AT_CHECK_CONFIGURE AT_CLEANUP |