libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 6/6] Simplify and improve safety of bootstrap process.


From: Gary V. Vaughan
Subject: [PATCH 6/6] Simplify and improve safety of bootstrap process.
Date: Tue, 31 Aug 2010 13:43:20 +0700

From: Gary V. Vaughan <address@hidden>

* 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   |   14 ++++++++++++++
 Makefile.am |   36 ++++++++++++++++++++++++++++++++++++
 bootstrap   |   22 ++++------------------
 3 files changed, 54 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 218bd48..736a1d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2010-08-30  Gary V. Vaughan <address@hidden>
 
+       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'.
+
        Don't leak developer GREP, SED etc into distribution file.
        * bootstrap (rebuild): Set the shell variable `revision' rather
        than `correctver' for clarity.
diff --git a/Makefile.am b/Makefile.am
index f6c0a9a..ba3aa08 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -78,6 +78,11 @@ CLEANFILES     += libtool libtoolize libtoolize.tmp \
 ## These are the replacements that need to be made at bootstrap time,
 ## because they must be static in distributed files, and not accidentally
 ## changed by configure running on the build machine.
+
+## !! NOTE !!  If you change anything here, ensure that the            ##
+##             `bootstrap-deps-prep' rule will still diagnose          ##
+##             any missing setting                                     ##
+
 bootstrap_edit  = sed \
                  -e "s,@configure_input\@,Generated from $$input.,g" \
                  -e 's,@MACRO_VERSION\@,$(VERSION),g' \
@@ -191,6 +196,37 @@ $(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'
+       @test -n "$(srcdir)" \
+          || echo "ERROR: don't call $(MAKE) with srcdir unset."
+       @test -n "$(M4SH)" \
+           || echo "ERROR: don't call $(MAKE) with M4SH unset."
+       @test -n "$(PACKAGE)" \
+           || echo "ERROR: don't call $(MAKE) with PACKAGE unset."
+       @test -n "$(PACKAGE_BUGREPORT)" \
+           || echo "ERROR: don't call $(MAKE) with PACKAGE_BUGREPORT unset."
+       @test -n "$(PACKAGE_NAME)" \
+           || echo "ERROR: don't call $(MAKE) with PACKAGE_NAME unset."
+       @test -n "$(PACKAGE_URL)" \
+           || echo "ERROR: don't call $(MAKE) with PACKAGE_URL unset."
+       @test -n "$(SED)" \
+           || echo "ERROR: don't call $(MAKE) with SED unset."
+       @test -n "$(VERSION)" \
+           || echo "ERROR: don't call $(MAKE) with VERSION unset."
+       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 eab1a3f..dabecea 100755
--- a/bootstrap
+++ b/bootstrap
@@ -449,24 +449,10 @@ eval `$SED -n "$my_sed_traces" configure.ac 2>/dev/null`
 
 # 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 $config_aux_dir/ltmain.sh $config_macro_dir/ltversion.m4
-
-$MAKE ./$config_aux_dir/ltmain.sh ./$config_macro_dir/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="$package_bugreport" M4SH="$AUTOM4TE --language=m4sh" \
-    AUTOTEST="$AUTOM4TE --language=autotest" SED="$SED" MAKEINFO="$MAKEINFO" \
-    GREP="$GREP" FGREP="$FGREP" EGREP="$EGREP" LN_S="$LN_S"
-
-test -f clcommit.m4sh && $MAKE -f Makefile.maint ./commit \
-    srcdir=. top_srcdir=. PACKAGE="$package" VERSION="$version" \
-    M4SH="$AUTOM4TE -l m4sh" \
-    SED="$SED" GREP="$GREP" FGREP="$FGREP" EGREP="$EGREP" LN_S="$LN_S"
+func_show_eval "$MAKE bootstrap-deps  \
+M4SH='$AUTOM4TE --language=m4sh' PACKAGE='$package' \
+PACKAGE_BUGREPORT='$package_bugreport' PACKAGE_NAME='$package_name' \
+PACKAGE_URL='$package_url' SED='$SED' srcdir=. VERSION='$version'"
 
 $RM Makefile
 
-- 
1.7.2.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]