12 Commits

Author SHA1 Message Date
Zack Weinberg
9a6c58cf40
Rename version.m4 to autoconf_version.m4.
Many existing projects have their own version.m4, and in some cases
having one is recommended by the Automake manual.  As of 2.72, the
name collision causes a spurious warning about including ‘version.m4’
multiple times, because the “has this been included before” machinery
does not track full pathnames.

A proper fix is more complicated than anyone has time to develop;
let’s just rename our version.m4 to autoconf_version.m4, which should
be sufficiently distinctive.

Reported in <https://savannah.gnu.org/support/?111007>.

* lib/version.in: Rename to lib/autoconf_version.in.
* bootstrap, configure.ac, lib/freeze.mk, lib/local.mk,
  lib/m4sugar/m4sugar.m4: Change all uses of version.m4 to
  autoconf_version.m4, and all uses of version.in to
  autoconf_version.in.
2026-01-26 16:03:52 -05:00
Paul Eggert
c3705f11bc maint: update all copyright dates via "make update-copyright" 2026-01-01 12:57:34 -08:00
Paul Eggert
afdbe47bd8 maint: update all copyright dates via "make update-copyright" 2025-01-01 13:30:49 -08:00
R. Diez
71afdbc878
bootstrap: Disallow use of undefined shell variables, if possible. 2024-12-02 11:02:19 -05:00
Paul Eggert
53c23bb4e1 Avoid some echo '...\...' gotchas
Problem with AC_SUBST_FILE reported by Dylan Palauzov in:
https://lists.gnu.org/r/bug-autoconf/2024-10/msg00018.html
The other problems I found by a manual scan.
* bootstrap: Use printf, not echo.
* doc/autoconf.texi (Polymorphic Variables):
* lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT):
* lib/autoconf/general.m4 (_AC_CANONICAL_SPLIT):
* lib/autoconf/status.m4 (_AC_SUBST_FILES):
* lib/autotest/general.m4 (AT_FINISH):
Use AS_ECHO, not echo.
2024-10-21 10:50:25 -07:00
KO Myung-Hun
7cdd728122 bootstrap: Allow 'ln -s' to be overridden by the user.
For example, one might set LN_S=cp when working on an
OS or filesystem that does not support symbolic links.

* bootstrap: Honor $LN_S environment variable, defaulting
  to 'ln -s'.
2024-06-23 13:39:16 -04:00
Jim Meyering
9ae8d7f61f maint: update all copyright dates via "make update-copyright" 2024-01-05 09:11:48 -08:00
Zack Weinberg
ddf21ca44a
bootstrap: Use an absolute path for ACBOOTDIR.
If we use a relative path for ACBOOTDIR, Automake can’t tell the
difference between Autoconf’s configure script’s aclocal.m4
inclusions (…/m4/*.m4) and the guts of Autoconf
itself (…/lib/autoconf/*.m4) so it puts both of them into
$(am__aclocal_m4_deps).  This would be harmless, except that the
guts-of-Autoconf files are named *relative to $ACBOOTDIR*, which
means Make can’t find them later.  And this is why a build from a
clean git checkout always starts by regenerating aclocal.m4 and
configure again.

Using an absolute path for ACBOOTDIR gives automake enough of a clue
what’s going on (see the heuristic circa 5500 of current automake.in,
commented “Some modified versions of autoconf don’t use frozen files…”)
for it to produce the same value for $(am__aclocal_m4) that it would
if we were running an installed Autoconf.
2023-03-12 19:39:47 -04:00
Paul Eggert
cb3ad19ddf make update-copyright 2023-01-20 23:41:13 -06:00
Paul Eggert
9c3f25710d Avoid \] in BREs and EREs
* bootstrap (PACKAGE_NAME, PACKAGE_BUGREPORT):
* lib/autoconf/status.m4 (AC_OUTPUT_MAKE_DEFS):
* maint.mk (longopt_re, gpg_key_ID):
* tests/m4sugar.at (m4_dumpdef):
Avoid \] in POSIX-specified regular expressions, as POSIX says \]
produces undefined results in BREs and EREs.
2022-06-28 18:27:40 -05:00
Paul Eggert
ef27f692a0 make update-copyright 2022-05-19 13:57:38 -07:00
Zack Weinberg
8de33b817f
Add a bootstrap script like Automake has.
The bootstrap script generates the same files ‘autoreconf -vi’ would,
in a normal package, but it uses autoconf *from the git sources* to do
it.  This means people building from git do not need autoconf to be
installed already.  More importantly, it eliminates the extra steps
when building from git, of re-generating autoconf’s own configure
script with the just-built autoconf, then rebuilding the entire tree.

(This process still requires Automake to be installed already, and
Automake’s bootstrap script requires Autoconf to be installed already,
so there is still a dependency loop between Autoconf and Automake when
building from git—you need at least one of them installed from a
tarball to get started.)

The bootstrap script works by creating a partial installation tree in
a temporary directory, containing bin/autoconf, bin/autom4te, and just
enough of the usual contents of $(pkgdatadir) for autoconf and
autom4te to work.  It then runs a hardcoded list of commands,
corresponding to what ‘autoreconf -i -Wall,error’ would run, but
setting environment variables AUTOCONF and AUTOM4TE to ensure the
bootstrap versions of these tools are used.  (We have to create both,
because automake runs autoconf, not autom4te, to trace configure.ac.)

The ‘Autom4te’, ‘autoconf’, and ‘m4sugar’ subdirectories of the
partial installation tree are symlinked back to the source tree; this
is why version.m4 needed to be moved out of the m4sugar subdirectory,
so the bootstrap script can create it without scribbling on the source
tree.  autom4te is run in --melt mode, so we don’t need to create
freeze files in any subdirectories either.  All of the substitution
variables that are needed for autoconf and autom4te to both run, and
create the same output that they would have if fully configured, are
honored (unfortunately this does involve digging around in
configure.ac with sed expressions).
2021-09-15 14:26:11 -04:00