[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/4] maint: simplify and improve safety of bootstrap process.
From: |
Gary V. Vaughan |
Subject: |
[PATCH 4/4] maint: simplify and improve safety of bootstrap process. |
Date: |
Thu, 23 Sep 2010 00:05:51 +0700 |
I also posted this one before... this time rebased against
post-2.4 release HEAD.
Okay to push?
* Makefile.am (bootstrap_files): List files that need to be
generated at bootstrap time before `./configure && make' can
work. It turns out that this is considerably fewer files than we
had thought necessary previously.
(bootstrap-deps-prep): Ensure minimum set of required substitution
variables are non-empty.
(bootstrap-deps): Depend on `bootstrap' files.
* bootstrap (Generate bootstrap dependencies): Now that
`Makefile.am' is entirely responsible for rebuilding files at
bootstrap time, we need only specify the new `bootstrap-deps'
target, and supply values for the substitutions checked by
`bootstrap-deps-prep'.
Signed-off-by: Gary V. Vaughan <address@hidden>
---
ChangeLog | 16 ++++++++++++++++
Makefile.am | 41 +++++++++++++++++++++++++++++++++++++++++
bootstrap | 17 ++++-------------
3 files changed, 61 insertions(+), 13 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fe75e0f..309f8b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2010-08-30 Gary V. Vaughan <address@hidden>
+
+ maint: simplify and improve safety of bootstrap process.
+ * Makefile.am (bootstrap_files): List files that need to be
+ generated at bootstrap time before `./configure && make' can
+ work. It turns out that this is considerably fewer files than we
+ had thought necessary previously.
+ (bootstrap-deps-prep): Ensure minimum set of required substitution
+ variables are non-empty.
+ (bootstrap-deps): Depend on `bootstrap' files.
+ * bootstrap (Generate bootstrap dependencies): Now that
+ `Makefile.am' is entirely responsible for rebuilding files at
+ bootstrap time, we need only specify the new `bootstrap-deps'
+ target, and supply values for the substitutions checked by
+ `bootstrap-deps-prep'.
+
2010-08-31 Gary V. Vaughan <address@hidden>
maint: don't leak developer GREP, SED etc into distribution file.
diff --git a/Makefile.am b/Makefile.am
index 48cd3a7..0a1b17d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -198,6 +198,47 @@ $(srcdir)/libltdl/Makefile.am:
$(srcdir)/libltdl/Makefile.inc
-e '1s,^\(.. Makefile.\)inc.*,\1am -- Process this file with
automake to produce Makefile.in,' > $$out;
chmod a-w $(srcdir)/libltdl/Makefile.am
+## Document the make macros that are needed to build bootstrap-deps
+## dependencies when called from `bootstrap' (developer's machine),
+## where the Makefile.am is fed to make in its raw format before
+## `configure' has found the correct values (on the build machine).
+bootstrap_files = \
+ $(auxdir)/ltmain.sh \
+ $(m4dir)/ltversion.m4 \
+ libltdl/Makefile.am
+
+.PHONY: bootstrap-deps bootstrap-deps-prep
+bootstrap-deps: bootstrap-deps-prep $(bootstrap_files)
+bootstrap-deps-prep:
+## The following variables are substituted by `bootstrap-dep-preps'
+ @exit_cmd=:; \
+ test -z "$(srcdir)" \
+ && echo "ERROR: don't call $(MAKE) with srcdir unset." \
+ && exit_cmd=exit; \
+ test -z "$(M4SH)" \
+ && echo "ERROR: don't call $(MAKE) with M4SH unset." \
+ && exit_cmd=exit; \
+ test -z "$(PACKAGE)" \
+ && echo "ERROR: don't call $(MAKE) with PACKAGE unset." \
+ && exit_cmd=exit; \
+ test -z "$(PACKAGE_BUGREPORT)" \
+ && echo "ERROR: don't call $(MAKE) with PACKAGE_BUGREPORT unset." \
+ && exit_cmd=exit; \
+ test -z "$(PACKAGE_NAME)" \
+ && echo "ERROR: don't call $(MAKE) with PACKAGE_NAME unset." \
+ && exit_cmd=exit; \
+ test -z "$(PACKAGE_URL)" \
+ && echo "ERROR: don't call $(MAKE) with PACKAGE_URL unset." \
+ && exit_cmd=exit; \
+ test -z "$(SED)" \
+ && echo "ERROR: don't call $(MAKE) with SED unset." \
+ && exit_cmd=exit; \
+ test -z "$(VERSION)" \
+ && echo "ERROR: don't call $(MAKE) with VERSION unset." \
+ && exit_cmd=exit; \
+ $$exit_cmd 1
+ rm -f $(bootstrap_files)
+
## Unfortunately, all this bogeyness means that we have to manually
## keep the generated files in libltdl up to date.
diff --git a/bootstrap b/bootstrap
index 78b4d30..e66b151 100755
--- a/bootstrap
+++ b/bootstrap
@@ -126,19 +126,10 @@ $SED '/^if /,/^endif$/d;/^else$/,/^endif$/d;/^include /d'
$makes > Makefile
# Building distributed files from configure is bad for automake, so we
# generate them here, and have Makefile rules to keep them up to date.
-# We don't have all the substitution values to build ltmain.sh from this
-# script yet, but we need config/ltmain.sh for the libtool commands in
-# configure, and ltversion.m4 to generate configure in the first place:
-rm -f $auxdir/ltmain.sh $m4dir/ltversion.m4
-
-$MAKE ./$auxdir/ltmain.sh ./$m4dir/ltversion.m4 \
- ./libtoolize.in ./tests/defs.in ./tests/package.m4 \
- ./tests/testsuite ./libltdl/Makefile.am ./doc/notes.txt \
- srcdir=. top_srcdir=. PACKAGE="$PACKAGE" VERSION="$VERSION" \
- PACKAGE_NAME="$PACKAGE_NAME" PACKAGE_URL="$PACKAGE_URL" \
- PACKAGE_BUGREPORT="address@hidden" M4SH="$AUTOM4TE --language=m4sh" \
- AUTOTEST="$AUTOM4TE --language=autotest" SED="$SED" MAKEINFO="$MAKEINFO" \
- GREP="$GREP" FGREP="$FGREP" EGREP="$EGREP" LN_S="$LN_S"
+$MAKE bootstrap-deps \
+ M4SH="$AUTOM4TE --language=m4sh" PACKAGE="$PACKAGE" \
+ PACKAGE_BUGREPORT="address@hidden" PACKAGE_NAME="$PACKAGE_NAME" \
+ PACKAGE_URL="$PACKAGE_URL" SED="$SED" srcdir=. VERSION="$VERSION"
rm -f Makefile
--
1.7.3
- [PATCH 1/r47] maint: help2man targets should rely on the binaries they call., Gary V. Vaughan, 2010/09/22
- [PATCH 2/4] maint: rearrange Makefile.am in preparation for a follow-up patch., Gary V. Vaughan, 2010/09/22
- [PATCH 3/4] maint: don't leak developer GREP, SED etc into distribution file., Gary V. Vaughan, 2010/09/22
- [PATCH 4/4] maint: simplify and improve safety of bootstrap process.,
Gary V. Vaughan <=
- Re: [PATCH 1/r47] maint: help2man targets should rely on the binaries they call., Ralf Wildenhues, 2010/09/22
- Re: [PATCH 1/r47] maint: help2man targets should rely on the binaries they call., Eric Blake, 2010/09/22
- Re: [PATCH 1/r47] maint: help2man targets should rely on the binaries they call., Ralf Wildenhues, 2010/09/22
- Re: [PATCH 1/r47] maint: help2man targets should rely on the binaries they call., Eric Blake, 2010/09/22
- Re: [PATCH 1/r47] maint: help2man targets should rely on the binaries they call., Ralf Wildenhues, 2010/09/22
- Re: [PATCH 1/r47] maint: help2man targets should rely on the binaries they call., Eric Blake, 2010/09/22
- Re: [PATCH 1/r47] maint: help2man targets should rely on the binaries they call., Ralf Wildenhues, 2010/09/22
- Re: [PATCH 1/r47] maint: help2man targets should rely on the binaries they call., Gary V. Vaughan, 2010/09/22
- Re: [PATCH 1/r47] maint: help2man targets should rely on the binaries they call., Ralf Wildenhues, 2010/09/22