From 54a0a8a701799773538cdb6880c6385137c13684 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 8 Oct 2010 10:08:12 -0700 Subject: [PATCH] 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. --- ChangeLog | 10 ++++++++++ build-aux/bootstrap | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8c3353026..9033f0dc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2010-10-08 Paul Eggert + 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 1da5b1eb5..2b3f24b32 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 -- 2.11.0