changeset 12890:ba919384ee9e

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 <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Mon, 22 Feb 2010 10:59:33 -0700
parents 551cabe1ed9f
children 14b06bec418c
files ChangeLog build-aux/bootstrap
diffstat 2 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Feb 22 08:46:42 2010 -0700
+++ b/ChangeLog	Mon Feb 22 10:59:33 2010 -0700
@@ -1,5 +1,10 @@
 2010-02-22  Eric Blake  <eblake@redhat.com>
 
+	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.
--- a/build-aux/bootstrap	Mon Feb 22 08:46:42 2010 -0700
+++ b/build-aux/bootstrap	Mon Feb 22 10:59:33 2010 -0700
@@ -390,7 +390,7 @@
 
 cleanup_gnulib() {
   status=$?
-  rm -fr gnulib
+  rm -fr "$gnulib_path"
   exit $status
 }
 
@@ -398,6 +398,8 @@
   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 @@
     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 @@
       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 || {