bootstrap: add hook for altering gnulib.mk, for Bison
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 8 Oct 2010 17:08:12 +0000 (10:08 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 8 Oct 2010 17:08:35 +0000 (10:08 -0700)
* 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
build-aux/bootstrap

index 8c33530..9033f0d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2010-10-08  Paul Eggert  <eggert@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.
 
index 1da5b1e..2b3f24b 100755 (executable)
@@ -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