From 463e993bc07ef541da4d3dcfe4ca4e3ad684ed7f Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 22 Feb 2010 10:59:33 -0700 Subject: [PATCH] bootstrap: allow for alternate submodule location Libvirt sets submodule.gnulib.path to ".gnulib". Also, it does not need gnulib.mk, but directly uses Makefile.am. * build-aux/bootstrap (gnulib_path): New variable; use instead of hardcoding submodule location. (gnulib_mk): Allow direct use of Makefile.am. Signed-off-by: Eric Blake --- ChangeLog | 5 +++++ build-aux/bootstrap | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 916b31159c..2056add81f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-02-22 Eric Blake + bootstrap: allow for alternate submodule location + * build-aux/bootstrap (gnulib_path): New variable; use instead of + hardcoding submodule location. + (gnulib_mk): Allow direct use of Makefile.am. + bootstrap: use GNULIB_SRCDIR to reduce disk usage * build-aux/bootstrap (GNULIB_SRCDIR): If set, use as a reference, rather than reconfiguring where the submodule points. diff --git a/build-aux/bootstrap b/build-aux/bootstrap index 1595d1b3e0..4b947ebefd 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -390,7 +390,7 @@ fi cleanup_gnulib() { status=$? - rm -fr gnulib + rm -fr "$gnulib_path" exit $status } @@ -398,6 +398,8 @@ git_modules_config () { test -f .gitmodules && git config --file .gitmodules "$@" } +gnulib_path=`git_modules_config submodule.gnulib.path` + # Get gnulib files. case ${GNULIB_SRCDIR--} in @@ -407,26 +409,27 @@ case ${GNULIB_SRCDIR--} in git submodule init || exit $? git submodule update || exit $? - elif [ ! -d gnulib ]; then + elif [ ! -d "$gnulib_path" ]; then echo "$0: getting gnulib files..." trap cleanup_gnulib 1 2 13 15 git clone --help|grep depth > /dev/null && shallow='--depth 2' || shallow= - git clone $shallow git://git.sv.gnu.org/gnulib || + git clone $shallow git://git.sv.gnu.org/gnulib "$gnulib_path" || cleanup_gnulib trap - 1 2 13 15 fi - GNULIB_SRCDIR=gnulib + GNULIB_SRCDIR=$gnulib_path ;; *) # Use GNULIB_SRCDIR as a reference. Assumes git 1.6.4 or newer. if test -d "$GNULIB_SRCDIR"/.git && \ git_modules_config submodule.gnulib.url >/dev/null; then echo "$0: getting gnulib files..." - git submodule update --init --reference "$GNULIB_SRCDIR" gnulib || exit $? - GNULIB_SRCDIR=gnulib + git submodule update --init --reference "$GNULIB_SRCDIR" \ + "$gnulib_path" || exit $? + GNULIB_SRCDIR=$gnulib_path fi ;; esac @@ -632,7 +635,7 @@ slurp() { for excluded_file in $excluded_files; do test "$dir/$file" = "$excluded_file" && continue 2 done - if test $file = Makefile.am; then + if test $file = Makefile.am && test "X$gnulib_mk" != XMakefile.am; then copied=$copied${sep}$gnulib_mk; sep=$nl remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g" sed "$remove_intl" $1/$dir/$file | cmp - $dir/$gnulib_mk > /dev/null || { -- 2.30.2