Commit b8b0239f authored by Paul Eggert's avatar Paul Eggert

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
parent 3231d532
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> 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
Assume C89 or later for math functions (Bug#12381). Assume C89 or later for math functions (Bug#12381).
......
...@@ -695,9 +695,9 @@ running the `configure' program, you have to perform the following steps. ...@@ -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 corresponding `Makefile.in' files. This isn't so hard, just a matter
of editing in appropriate substitutions for the @...@ constructs. of editing in appropriate substitutions for the @...@ constructs.
The `configure' script is built from `configure.ac' by the `autoconf' The `configure' script is built from `configure.ac' by the
program. You need at least the version of autoconf specified in the `autogen.sh' script, which checks that `autoconf' and other build
AC_PREREQ(...) command to rebuild `configure' from `configure.ac'. tools are sufficiently up to date and then runs the build tools.
BUILDING GNU EMACS BY HAND BUILDING GNU EMACS BY HAND
......
...@@ -360,15 +360,17 @@ $(MAKEFILE_NAME): config.status $(srcdir)/src/config.in \ ...@@ -360,15 +360,17 @@ $(MAKEFILE_NAME): config.status $(srcdir)/src/config.in \
$(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN) $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN)
./config.status ./config.status
# Don't erase config.status if make is interrupted while refreshing it. # Don't erase these files if make is interrupted while refreshing them.
.PRECIOUS: config.status .PRECIOUS: Makefile config.status
config.status: ${srcdir}/configure ${srcdir}/lisp/version.el MAKE_CONFIG_STATUS = \
if [ -x ./config.status ]; then \ if [ -x ./config.status ]; then \
./config.status --recheck; \ ./config.status --recheck; \
else \ else \
./configure $(CONFIGURE_FLAGS); \ ./configure $(CONFIGURE_FLAGS); \
fi fi
config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
$(MAKE_CONFIG_STATUS)
AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4 AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4
...@@ -383,6 +385,10 @@ AUTOMAKE_INPUTS = $(srcdir)/aclocal.m4 $(srcdir)/lib/Makefile.am \ ...@@ -383,6 +385,10 @@ AUTOMAKE_INPUTS = $(srcdir)/aclocal.m4 $(srcdir)/lib/Makefile.am \
$(srcdir)/lib/gnulib.mk $(srcdir)/lib/gnulib.mk
$(srcdir)/lib/Makefile.in: $(AUTOMAKE_INPUTS) $(srcdir)/lib/Makefile.in: $(AUTOMAKE_INPUTS)
cd $(srcdir) && automake --gnu -a -c lib/Makefile 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 am--refresh: $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/src/config.in
.PHONY: am--refresh .PHONY: am--refresh
...@@ -776,8 +782,6 @@ bootstrap-clean: FRC ...@@ -776,8 +782,6 @@ bootstrap-clean: FRC
(cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean) (cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean)
[ ! -f config.log ] || mv -f config.log config.log~ [ ! -f config.log ] || mv -f config.log config.log~
${top_bootclean} ${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' ### `maintainer-clean'
### Delete everything from the current directory that can be ### Delete everything from the current directory that can be
...@@ -883,14 +887,14 @@ dvi: ...@@ -883,14 +887,14 @@ dvi:
.PHONY: bootstrap .PHONY: bootstrap
## configure; make bootstrap replaces the real config.log from configure # Bootstrapping does the following:
## with the truncated one from config.status. The former is more useful. # * 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 bootstrap: bootstrap-clean FRC
if [ -x ./config.status ]; then \ cd $(srcdir) && { ./autogen.sh || test $$? -eq 101; }
./config.status; \ $(MAKE_CONFIG_STATUS)
else \
./configure $(CONFIGURE_FLAGS); \
fi
$(MAKE) $(MFLAGS) info all $(MAKE) $(MFLAGS) info all
.PHONY: check-declare .PHONY: check-declare
......
...@@ -41,9 +41,14 @@ The file `configure.ac' is the input used by the autoconf program to ...@@ -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 construct the `configure' script. Since Emacs has some configuration
requirements that autoconf can't meet directly, and for historical requirements that autoconf can't meet directly, and for historical
reasons, `configure.ac' uses an unholy marriage of custom-baked reasons, `configure.ac' uses an unholy marriage of custom-baked
configuration code and autoconf macros. If you want to rebuild configuration code and autoconf macros.
`configure' from `configure.ac', you will need to install a recent
version of autoconf and GNU m4. 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 The file `Makefile.in' is a template used by `configure' to create
`Makefile'. `Makefile'.
......
...@@ -201,7 +201,7 @@ This is not recommended - see the comments in \`copy_autogen'. ...@@ -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 . Please report any problems with this script to bug-gnu-emacs@gnu.org .
EOF EOF
exit 1 exit 101 # Exit status 101 means tools were missing.
fi fi
echo "Your system has the required tools, running autoreconf..." echo "Your system has the required tools, running autoreconf..."
......
...@@ -273,7 +273,7 @@ mkdir ${tempdir} ...@@ -273,7 +273,7 @@ mkdir ${tempdir}
### README while the rest of the tar file is still unpacking. Whoopee. ### README while the rest of the tar file is still unpacking. Whoopee.
echo "Making links to top-level files" echo "Making links to top-level files"
ln INSTALL README BUGS ${tempdir} 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 config.bat make-dist .dir-locals.el ${tempdir}
ln aclocal.m4 ${tempdir} ln aclocal.m4 ${tempdir}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment