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>.
This patch set makes the changes on autoconf’s side required to bring ChannelDefs.pm back into sync between autoconf and automake, which makes the set of categories consistent for future releases. It also implements a workaround in autoreconf, to avoid problems with inconsistent *installed* versions of autoconf and automake: we pass warnings options to subsidiary tools using the WARNINGS environment variable instead of on the command line. Unsupported categories in WARNINGS have always been ignored, so the problem is eliminated. I manually verified that, with the combination of trunk autoconf and released automake 1.16, one can run autoreconf -Werror,cross without any problems. With autoreconf from 2.69, by contrast, aclocal will bomb out. The main thing I want to discuss before merging these patches is the location of the new Perl function merge_WARNINGS. I put it in ChannelDefs.pm because that is where all the other code relating to WARNINGS is, but it’s only used in autoreconf, so there’s an argument for putting it in autoreconf instead, if only so we can modify it in the future without having to go through automake. Side effects include: - The ‘obsolete’ category of warnings is now on by default (automake has already made this change). - More of autoreconf’s subsidiary tools may generate warnings now. Specifically, we were not passing -W options to autopoint, libtoolize, intltool, or gtkdocize, but they will all see the WARNINGS environment variable. I don’t know if any of them pay attention to it. - All of the commands that run autoconf or autom4te in --trace mode also set WARNINGS=none in the environment. This means, most visibly, that autoheader no longer repeats autoconf’s warnings. - We are now autoupdating a bunch of obsolete diagnostics-related macros. This is just something I happened to notice because I was messing with code near them. N.B. I have not yet added ChannelDefs.pm to the list of files to sync from automake. I will do that in a separate commit after all the dust settles from this patchset. zw -- Zack Weinberg (6): Manually sync ChannelDefs.pm from automake. New utility function Autom4te::ChannelDefs::merge_WARNINGS. Disable all warnings when running autoconf as a subprocess. Use WARNINGS to pass down warnings options from autoreconf. Update documentation related to warnings. Autoupdate AC_{DIAGNOSE,FATAL,OBSOLETE,WARNING} and _AC_COMPUTE_INT. NEWS | 13 ++ bin/autoconf.as | 21 ++- bin/autoheader.in | 31 ++-- bin/autom4te.in | 10 +- bin/autoreconf.in | 87 ++++++----- bin/autoscan.in | 5 +- bin/autoupdate.in | 5 + doc/autoconf.texi | 287 ++++++++++++++++-------------------- lib/Autom4te/ChannelDefs.pm | 237 ++++++++++++++++++++++++----- lib/Autom4te/Config.pm | 43 ++++++ lib/autoconf/autoupdate.m4 | 14 +- lib/autoconf/c.m4 | 2 +- lib/autoconf/functions.m4 | 8 +- lib/autoconf/general.m4 | 78 +++++----- lib/autoconf/headers.m4 | 8 +- lib/autoconf/lang.m4 | 2 +- lib/autoconf/specific.m4 | 2 +- lib/autoconf/status.m4 | 6 +- lib/autoconf/types.m4 | 4 +- lib/autom4te.in | 1 - lib/local.mk | 1 + tests/base.at | 2 +- tests/c.at | 2 +- tests/compile.at | 7 +- tests/local.at | 48 +++--- tests/m4sh.at | 2 +- tests/m4sugar.at | 25 ++-- tests/mktests.sh | 10 +- tests/semantics.at | 48 +++--- tests/tools.at | 179 +++++++++++++++++++++- tests/torture.at | 64 ++++++-- 31 files changed, 831 insertions(+), 421 deletions(-) create mode 100644 lib/Autom4te/Config.pm -- 2.28.0