summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2021-02-04 13:11:28 -0500
committerZack Weinberg <zackw@panix.com>2021-09-15 14:26:11 -0400
commit8de33b817fd6897779ac38a6738a64a8c0c59acf (patch)
tree06bfe9414ffddc05e56b9e37718ae69e4bb4caa9 /configure.ac
parentf060c7e5fddfed8e27a55a6a777a1a6cf7c9eaac (diff)
downloadautoconf-8de33b817fd6897779ac38a6738a64a8c0c59acf.tar.gz
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).
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 11 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 163aca3b..8a8958ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,17 @@
AC_PREREQ([2.69])
-AC_INIT([GNU Autoconf],[m4_esyscmd(build-aux/git-version-gen .tarball-version)],[bug-autoconf@gnu.org])
+# Keep both of these on a single line, and do not use quadrigraphs
+# or nested quotes in their values, since the bootstrap script needs
+# to be able to extract their values with sed.
+m4_define([autoconf_PACKAGE_NAME], [GNU Autoconf])
+m4_define([autoconf_PACKAGE_BUGREPORT], [bug-autoconf@gnu.org])
+
+AC_INIT(
+ m4_defn([autoconf_PACKAGE_NAME]),
+ [m4_esyscmd([build-aux/git-version-gen .tarball-version])],
+ m4_defn([autoconf_PACKAGE_BUGREPORT])
+)
AC_CONFIG_SRCDIR([lib/autoconf/autoconf.m4])
AC_CONFIG_AUX_DIR([build-aux])