* build-aux/bootstrap (gnulib_mk_hook): New function, so that
the Bison bootstrapping process can rewrite file names and variables
in this file before later parts of 'bootstrap' use the file.
Bison wants to include lib/gnulib.mk from the top-level makefile,
so it needs the file names in this file to be relative to the top
level, not relative to lib; plus it needs variable names to be
rewritten.
(slurp): Use the new function.
---
 ChangeLog           |   10 ++++++++++
 build-aux/bootstrap |    7 ++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8c33530..9033f0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2010-10-08  Paul Eggert  <egg...@cs.ucla.edu>
 
+       bootstrap: add hook for altering gnulib.mk, for Bison
+       * build-aux/bootstrap (gnulib_mk_hook): New function, so that
+       the Bison bootstrapping process can rewrite file names and variables
+       in this file before later parts of 'bootstrap' use the file.
+       Bison wants to include lib/gnulib.mk from the top-level makefile,
+       so it needs the file names in this file to be relative to the top
+       level, not relative to lib; plus it needs variable names to be
+       rewritten.
+       (slurp): Use the new function.
+
        bootstrap: reformat for readability
        * build-aux/bootstrap: Rewrite to avoid lines longer than 80 columns.
 
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index 1da5b1e..2b3f24b 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -80,6 +80,10 @@ gnulib_modules=
 # Any gnulib files needed that are not in modules.
 gnulib_files=
 
+# A function to be called to edit gnulib.mk right after it's created.
+# Override it via your own definition in bootstrap.conf.
+gnulib_mk_hook() { :; }
+
 # A function to be called after everything else in this script.
 # Override it via your own definition in bootstrap.conf.
 bootstrap_epilogue() { :; }
@@ -692,7 +696,8 @@ slurp() {
         cmp - $dir/$gnulib_mk > /dev/null || {
           echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." &&
           rm -f $dir/$gnulib_mk &&
-          sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk
+          sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk &&
+          gnulib_mk_hook $dir/$gnulib_mk
         }
       elif { test "${2+set}" = set && test -r $2/$dir/$file; } ||
            version_controlled_file $dir $file; then
-- 
1.7.2


Reply via email to