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.
Search-and-replace change ‘use warnings;’ to ‘use warnings FATAL => 'all';’
in all Perl code.
Notwithstanding the dire cautions in ‘perldoc warnings’ about this,
I think it’s the right call for us. One file was already doing it.
No new testsuite failures are observed on Linux with Perl 5.30.3
nor on NetBSD with Perl 5.6.1.
* bin/autoheader.in, bin/autom4te.in, bin/autoreconf.in
* bin/autoscan.in, bin/autoupdate.in, bin/ifnames.in
* lib/Autom4te/C4che.pm, lib/Autom4te/ChannelDefs.pm
* lib/Autom4te/Channels.pm, lib/Autom4te/Configure_ac.pm
* lib/Autom4te/FileUtils.pm, lib/Autom4te/General.pm
* lib/Autom4te/Request.pm, lib/Autom4te/XFile.pm:
Make all warnings from the Perl interpreter into fatal errors.
All the Perl scripts and modules now ‘use’ other modules in the
following order:
- use 5.006; use strict; use warnings; in that order.
If a file was not already use-ing one of these three, it was added.
- The BEGIN block that adds the installation directory for the
Autom4te:: modules to @INC, if necessary.
- All stdlib modules whose name begins with a capital letter,
in ASCII sort order.
- All Autom4te:: modules, in ASCII sort order.
- ‘use vars qw (...)’, if any, last.
Also, ‘use foo qw (...)’ and @ISA lists have been sorted into ASCII
sort order. (@EXPORT lists, which often follow immediately after @ISA
lists, have *not* been sorted, as these appear to have been organized
semantically in many cases.) qw delimiters have been normalized to
round parentheses with a space between the qw and the open paren.
* bin/autoheader.in, bin/autom4te.in, bin/autoreconf.in
* bin/autoscan.in, bin/autoupdate.in, bin/ifnames.in
* lib/Autom4te/C4che.pm, lib/Autom4te/ChannelDefs.pm
* lib/Autom4te/Channels.pm, lib/Autom4te/Configure_ac.pm
* lib/Autom4te/FileUtils.pm, lib/Autom4te/General.pm
* lib/Autom4te/Getopt.pm, lib/Autom4te/Request.pm
* lib/Autom4te/XFile.pm: Rationalize order and format of ‘use’
directives and @ISA lists. Add any of ‘use 5.006’, ‘use strict’,
and ‘use warnings’ that was not already present.
Some downstream redistributors for Autoconf wish to use
‘/usr/bin/env perl’ as the #! line for the installed Perl scripts.
This does not work with command-line options on the #! line, as the
kernel doesn’t support supplying more than one argument to a #!
interpreter (this limitation is universal across Unixes that
support #!, as far as I know).
Remove ‘-w’ from all perl #! lines and instead add ‘use warnings’
to all the scripts and .pm files that didn’t already have it.
This ‘use’ directive was added to Perl in version 5.6.0 (aka 5.006)
so there is no change to our minimum Perl requirement.
(It is necessary to add ‘use warnings’ to all the .pm files as well as
the scripts, because the ‘-w’ command-line option turns on warnings
globally, but ‘use warnings’ does so only for the current lexical scope.)
Patch uplifted from OpenEmbedded, originally by Serhii Popovych.
It’s a mechanical search-and-replace change so I do not believe a
copyright assignment is necessary.
* bin/autom4te.in, bin/autoreconf.in, bin/autoscan.in
* bin/autoupdate.in, bin/ifnames.in: Remove -w from #! line
and add ‘use warnings’ to imports.
* lib/Autom4te/C4che.pm, lib/Autom4te/ChannelDefs.pm
* lib/Autom4te/Channels.pm, lib/Autom4te/Configure_ac.pm
* lib/Autom4te/FileUtils.pm, lib/Autom4te/General.pm
* lib/Autom4te/Request.pm, lib/Autom4te/XFile.pm:
Add ‘use warnings’ to imports.
Done via 'make update-copyright', since all files are effectively
modified and distributed this year via public version control.
* all files: Update copyright year.
Done via 'make update-copyright', since all files are effectively
modified and distributed this year via public version control.
* all files: Update copyright year.
As per updated GCS recommendations.
* bin/autoconf.as, bin/autoreconf.in, bin/autoscan.in, ifnames.in,
bin/autoupdate.in: Throughout these files.
* bin/autoheader.in, bin/autom4te.in: Likewise. Also, remove some
useless escaping of the "'" single-quote characters, and reformat
some message for better line wrapping.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* lib/m4sugar/m4sugar.m4 (m4_copy): Add second implementation for
public use.
(_m4_copy): New macro, which preserves pushdef stacks.
(_m4_defun_pro_outer): Bypass it, for speed.
(m4_init): Bypass new implementation, since it breaks on m4_defn.
* bin/autoupdate.in (handle_autoconf_macros): Likewise.
* lib/autoconf/general.m4 (AC_PREREQ): Undefine before redefining,
now that m4_copy checks this.
* doc/autoconf.texi (Redefined M4 Macros) <m4_copy>: Document
this, as well as m4_rename.
* lib/autoconf/autoconf.m4 (m4_copy): Temporarily redefine when
renaming builtins.
* NEWS: Likewise.
* tests/m4sugar.at (m4@&t@_defn): Enhance test.
Signed-off-by: Eric Blake <ebb9@byu.net>
* bin/autoupdate.in (_au___undefine): New macro,...
(_au__undefine): ...wrapped by ifdef to silence m4 warnings.
Reported by Ralf Wildenhues.
Signed-off-by: Eric Blake <ebb9@byu.net>
Return back to GPLv2+, until the text of the exceptions is
finalized, reverting the change from 2007-07-03 and the first
part of the change from 2007-07-20.
Also:
* COPYING: Revert to GPLv2.
* COPYINGv3: New file, since some auxiliary build tools, used for
building autoconf and not installed, are GPLv3.
* Makefile.am (EXTRA_DIST): Distribute COPYINGv3.
* NEWS: Remove mention of GPLv3.
* README: Clarify situation regarding GPLv3.
Signed-off-by: Eric Blake <ebb9@byu.net>
This includes escaping of characters special to the shell
as well as special to Perl, e.g., leading `<' or `>'.
For example, when $file starts with `>', `open ">$file"'
wrongly tries to append to a different file.
* bin/autoconf.as: Fix quoting for autom4te options.
* lib/Autom4te/General.pm (shell_quote): New function, taken
from coreutils, written by Jim Meyering.
(mktmpdir): Use it.
* bin/autom4te.in (files_to_options, handle_m4): Use shell_quote
and open_quote.
* bin/autoreconf.in (parse_args): Likewise.
* bin/autoscan.in (main): Likewise.
* bin/autoupdate.in (main): Likewise.
* bin/autoheader.in: Likewise, fixing old insufficient escaping.
* bin/ifnames.in: Likewise, XFile usage fixes.
* tests/tools.at (autom4te and whitespace in file names): Extend
test. Test twice, with special characters allowed on w32, and the
rest. Test leading and trailing whitespace, for `open_quote'.
(autotools and whitespace in file names): New, analogous test.
Reported by Paul Eggert and Benoit Sigoure, additional suggestions
by Russ Allbery and Eric Blake.
distinguish m4sugar macros.
* tests/tools.at (autoupdating with aclocal and m4_include):
New test. Bug reported by Gary V. Vaughan <gary@gnu.org>,
test case by Noah Misch <noah@cs.caltech.edu>.
macros without parameters.
* lib/autoconf/autoupdate.m4 (AU_ALIAS): Likewise.
* doc/autoconf.texi (Obsoleting Macros): Document AU_ALIAS.
* tests/tools.at (autoupdating AU_ALIAS): New test for AU_ALIAS
`$#' bug.
(autoupdate): Updated to match AU_ALIAS fix.
refer to the correct file.
* doc/autoconf.texi (AU_DEFUN): Describe more correctly
the behavior of the third argument.
* lib/autoconf/autoupdate.m4 (AU_DEFUN): Describe more
correctly the behavior of the third argument. Document
what the three macros that AU_DEFUN defines do. Fix
warning message when the third argument includes $0
(reported by Alexandre Duret-Lutz).
* doc/autoconf.texi: Don't say that the third parameter
is broken.
* lib/autoconf/autoupdate.m4 (AU_DEFINE): New dummy macro.
(AU_DEFUN): Honor the third parameter, create autoupdate
macros with AU_DEFINE.
* lib/autoconf/headers.m4 (AC_USG, AC_MEMORY_H,
AC_DIR_HEADER): Use AU_DEFUN's third parameter.
* lib/autoconf/lang.m4 (AC_LANG_SAVE): Likewise.
* lib/autoconf/programs.m4 (AC_RSH): Likewise.
* lib/autoconf/specific.m4 (AC_HAVE_POUNDBANG,
AC_ARG_ARRAY, AC_CYGWIN, AC_EMXOS2, AC_MINGW32,
AC_XENIX_DIR): Likewise.
* lib/autoconf/types.m4 (AC_INT_16_BITS, AC_LONG_64_BITS,
AC_STRUCT_ST_BLKSIZE, AC_STRUCT_ST_RDEV): Likewise.
* lib/autoconf/status.m4: Remove FIXME.
* tests/local.at (AT_CHECK_AU_MACRO): Ignore stderr, check
that the macro is not present anymore in the updated
configure.ac.
* tests/tools.at (autoupdate AC_LINK_FILES): Ignore stderr
of autoupdate.
(&verbose): Remove.
(&getopt): Adjust the note and verb channels, depending upon
--verbose.
* bin/autoheader.in, bin/autom4te.in, bin/autoscan.in,
* bin/autoupdate.in: Adjust.
Use &verb, not &verbose.
* bin/autom4te: Adjust.
In particular, be Autoconf tools are really silent when properly
working, bind the verbosity of the 'note' channel to $verbose.
* lib/Autom4te/General.pm (&find_file, &mtime, &update_file)
(&xsystem, &contents): Remove, since they are exported by...
* lib/Autom4te/FileUtils.pm: this.
More perldoc.
* lib/Autom4te/General.pm (&up_to_date_p): Move to...
* lib/Autom4te/FileUtils.pm: here.
* bin/autoscan.in, bin/autoupdate.in, bin/ifnames.in (BEGIN): Make
them uniform, and more robust to Perl special characters.
Reported by Martin Mokrej.
to a shell that can handle redirection or quoting correctly.
Override SHELL with the shell detected by configure.
Use of $^O suggested by Tim van Holder.
* bin/autom4te.in (BEGIN): Likewise.
* bin/autoreconf.in (BEGIN): Likewise.
* bin/autoscan.in (BEGIN): Likewise.
* bin/autoupdate.in (BEGIN): Likewise.
* bin/ifnames.in (BEGIN): Likewise.
* bin/ifnames.in: Add final newline to help and version messages.
* lib/autoconf/programs.m4 (AC_PROG_MAKE_SET): Translate colons,
to cope with DOS-style absolute paths, when constructing
${ac_make}.
* lib/autoconf/status.m4 (_AC_OUTPUT_HEADERS, _AC_OUTPUT_FILES):
When constructing paths with IFS=:, quote the path. If we're
constructing a DOS-style absolute path, we don't want to split it
on the colon.
* tests/atspecific.m4 (AT_CHECK_CONFIGURE): Fix typo
in description.