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.
cleanup_gnulib() {
status=$?
- rm -fr gnulib
+ rm -fr "$gnulib_path"
exit $status
}
test -f .gitmodules && git config --file .gitmodules "$@"
}
+gnulib_path=`git_modules_config submodule.gnulib.path`
+
# Get gnulib files.
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
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 || {