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
+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).
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
$(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
$(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
(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
.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
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'.
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..."
### 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}