summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-09-09 18:03:27 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-09-09 18:03:27 -0700
commitb8b0239fd0485002d1c761067c9047d1f26dbd4c (patch)
treefe258a2d99658a0fc300e6c70f1456be436537c8
parent3231d532c7e6c3ed0a2e58574bec5518404a7f82 (diff)
Improve robustness of 'make bootstrap'.
Run autogen.sh after bootstrap-clean, to avoid bzr pull issues. * INSTALL, README: Document autogen.sh. * Makefile.in (Makefile): Mark it as precious, since it's updated atomically. (MAKE_CONFIG_STATUS): New macro. (config.status, bootstrap): Use it. This causes 'make bootstrap' to run config.status with the --recheck option, which is more appropriate for a bootstrap. (bootstrap): Run autogen.sh right after cleaning. Don't worry about failures due to missing tools. * autogen.sh: Exit with status 101 when failing due to missing tools. * make-dist: Distribute autogen.sh. Fixes: debbugs:12376
-rw-r--r--ChangeLog16
-rw-r--r--INSTALL6
-rw-r--r--Makefile.in28
-rw-r--r--README11
-rwxr-xr-xautogen.sh2
-rwxr-xr-xmake-dist2
6 files changed, 45 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 198670e59e..7d1c19a535 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ Improve robustness of 'make bootstrap' (Bug#12376).
+ Run autogen.sh after bootstrap-clean, to avoid bzr pull issues.
+ * INSTALL, README: Document autogen.sh.
+ * Makefile.in (Makefile): Mark it as precious, since it's updated
+ atomically.
+ (MAKE_CONFIG_STATUS): New macro.
+ (config.status, bootstrap): Use it. This causes 'make bootstrap'
+ to run config.status with the --recheck option, which is more
+ appropriate for a bootstrap.
+ (bootstrap): Run autogen.sh right after cleaning. Don't worry
+ about failures due to missing tools.
+ * autogen.sh: Exit with status 101 when failing due to missing tools.
+ * make-dist: Distribute autogen.sh.
+
2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
Assume C89 or later for math functions (Bug#12381).
diff --git a/INSTALL b/INSTALL
index f0cf5d68db..4716bbecf9 100644
--- a/INSTALL
+++ b/INSTALL
@@ -695,9 +695,9 @@ running the `configure' program, you have to perform the following steps.
corresponding `Makefile.in' files. This isn't so hard, just a matter
of editing in appropriate substitutions for the @...@ constructs.
-The `configure' script is built from `configure.ac' by the `autoconf'
-program. You need at least the version of autoconf specified in the
-AC_PREREQ(...) command to rebuild `configure' from `configure.ac'.
+The `configure' script is built from `configure.ac' by the
+`autogen.sh' script, which checks that `autoconf' and other build
+tools are sufficiently up to date and then runs the build tools.
BUILDING GNU EMACS BY HAND
diff --git a/Makefile.in b/Makefile.in
index 122a35d441..800f11669d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -360,15 +360,17 @@ $(MAKEFILE_NAME): config.status $(srcdir)/src/config.in \
$(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN)
./config.status
-# Don't erase config.status if make is interrupted while refreshing it.
-.PRECIOUS: config.status
+# Don't erase these files if make is interrupted while refreshing them.
+.PRECIOUS: Makefile config.status
-config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
+MAKE_CONFIG_STATUS = \
if [ -x ./config.status ]; then \
./config.status --recheck; \
else \
./configure $(CONFIGURE_FLAGS); \
fi
+config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
+ $(MAKE_CONFIG_STATUS)
AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4
@@ -383,6 +385,10 @@ AUTOMAKE_INPUTS = $(srcdir)/aclocal.m4 $(srcdir)/lib/Makefile.am \
$(srcdir)/lib/gnulib.mk
$(srcdir)/lib/Makefile.in: $(AUTOMAKE_INPUTS)
cd $(srcdir) && automake --gnu -a -c lib/Makefile
+
+# Regenerate files that this makefile would have made, if this makefile
+# had been built by Automake. The name 'am--refresh' is for
+# compatibility with subsidiary Automake-generated makefiles.
am--refresh: $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/src/config.in
.PHONY: am--refresh
@@ -776,8 +782,6 @@ bootstrap-clean: FRC
(cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean)
[ ! -f config.log ] || mv -f config.log config.log~
${top_bootclean}
-## configure; make bootstrap replaces the real config.log from configure
-## with the truncated one from config.status. The former is more useful.
### `maintainer-clean'
### Delete everything from the current directory that can be
@@ -883,14 +887,14 @@ dvi:
.PHONY: bootstrap
-## configure; make bootstrap replaces the real config.log from configure
-## with the truncated one from config.status. The former is more useful.
+# Bootstrapping does the following:
+# * Remove files to start from a clean slate.
+# * Run autogen.sh, but don't worry about exit status 101 (missing tools).
+# * Build Makefile, to build the build procedure itself.
+# * Do the actual build.
bootstrap: bootstrap-clean FRC
- if [ -x ./config.status ]; then \
- ./config.status; \
- else \
- ./configure $(CONFIGURE_FLAGS); \
- fi
+ cd $(srcdir) && { ./autogen.sh || test $$? -eq 101; }
+ $(MAKE_CONFIG_STATUS)
$(MAKE) $(MFLAGS) info all
.PHONY: check-declare
diff --git a/README b/README
index a11935ee3e..2c50c5bbb9 100644
--- a/README
+++ b/README
@@ -41,9 +41,14 @@ The file `configure.ac' is the input used by the autoconf program to
construct the `configure' script. Since Emacs has some configuration
requirements that autoconf can't meet directly, and for historical
reasons, `configure.ac' uses an unholy marriage of custom-baked
-configuration code and autoconf macros. If you want to rebuild
-`configure' from `configure.ac', you will need to install a recent
-version of autoconf and GNU m4.
+configuration code and autoconf macros.
+
+The shell script `autogen.sh' generates 'configure' and other files by
+running the GNU build tools autoconf and automake, which in turn use
+GNU m4 and Perl. If you want to use it, you will need to install
+recent versions of these build tools. This should be needed only if
+you edit files like `configure.ac' that specify Emacs's autobuild
+procedure.
The file `Makefile.in' is a template used by `configure' to create
`Makefile'.
diff --git a/autogen.sh b/autogen.sh
index 9cfaa40eee..dc8d53eec9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -201,7 +201,7 @@ This is not recommended - see the comments in \`copy_autogen'.
Please report any problems with this script to bug-gnu-emacs@gnu.org .
EOF
- exit 1
+ exit 101 # Exit status 101 means tools were missing.
fi
echo "Your system has the required tools, running autoreconf..."
diff --git a/make-dist b/make-dist
index b157d9a54d..28d2ec1521 100755
--- a/make-dist
+++ b/make-dist
@@ -273,7 +273,7 @@ mkdir ${tempdir}
### README while the rest of the tar file is still unpacking. Whoopee.
echo "Making links to top-level files"
ln INSTALL README BUGS ${tempdir}
-ln ChangeLog Makefile.in configure configure.ac ${tempdir}
+ln ChangeLog Makefile.in autogen.sh configure configure.ac ${tempdir}
ln config.bat make-dist .dir-locals.el ${tempdir}
ln aclocal.m4 ${tempdir}