# Bootstrap this package from checked-out sources.
-# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
-# Inc.
+# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+# Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
bt2=${bt}2
usage() {
- echo >&2 "\
+ cat <<EOF
Usage: $0 [OPTION]...
Bootstrap this package from the checked-out sources.
contents are read as shell variables to configure the bootstrap.
Running without arguments will suffice in most cases.
-"
+EOF
}
# Configuration.
# File that should exist in the top directory of a checked out hierarchy,
# but not in a distribution tarball.
-checkout_only_file=README-hacking
+checkout_only_file=HACKING
# Whether to use copies instead of symlinks.
copy=false
# find_tool ENVVAR NAMES...
# -------------------------
+# Look for some needed program. Use the value of the ENVVAR if set,
+# otherwise look for the first of the NAMES that can be run (i.e.,
+# supports --version). If found, set ENVVAR to the program name,
+# die otherwise.
find_tool ()
{
# Find sha1sum, named gsha1sum on MacPorts.
find_tool_envvar=$1
shift
- if eval test x"\$$find_tool_envvar" = x; then
+ find_tool_names=$@
+ eval "find_tool_res=\$$find_tool_envvar"
+ if test x"$find_tool_res" = x; then
for i
do
if ($i --version </dev/null) >/dev/null 2>&1; then
- find_tool_res=$i
- break
+ find_tool_res=$i
+ break
fi
done
+ else
+ find_tool_error_prefix="\$$find_tool_envvar: "
fi
if test x"$find_tool_res" = x; then
- echo >&2 "$0: $find_tool_name is required"
+ echo >&2 "$0: one of these is required: $find_tool_names"
exit 1
fi
($find_tool_res --version </dev/null) >/dev/null 2>&1 || {
- echo >&2 "$0: cannot run $find_tool_res --version"
+ echo >&2 "$0: ${find_tool_error_prefix}cannot run $find_tool_res --version"
exit 1
}
- eval "$find_tool_envvar=\"$find_tool_res\""
+ eval "$find_tool_envvar=\$find_tool_res"
eval "export $find_tool_envvar"
}
exit $status
}
+# See if we can use gnulib's git-merge-changelog merge driver.
+
+if test -d .git && (git --version) >/dev/null 2>/dev/null ; then
+ if git config merge.merge-changelog.driver >/dev/null ; then
+ :
+ elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
+ echo "initializing git-merge-changelog driver"
+ git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
+ git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
+ else
+ echo "consider installing git-merge-changelog from gnulib"
+ fi
+fi
+
# Get gnulib files.
case ${GNULIB_SRCDIR--} in
if test $file = Makefile.am; then
copied=$copied${sep}$gnulib_mk; sep=$nl
remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g"
- sed "$remove_intl" $1/$dir/$file | cmp -s - $dir/$gnulib_mk || {
- echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." &&
- rm -f $dir/$gnulib_mk &&
- sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk
- }
+ echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..."
+ rm -f $dir/$gnulib_mk
+ sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk
+ etc/prefix-gnulib-mk $dir/$gnulib_mk
elif { test "${2+set}" = set && test -r $2/$dir/$file; } ||
version_controlled_file $dir $file; then
echo "$0: $dir/$file overrides $1/$dir/$file"
done
fi
-# FIXME: Gnulib should be patched to add "/" in front of .gitignore entries
-# instead. Anyway, this hack must be done before invoking autoconf so that
-# build-aux/git-version-gen doesn't think the version is dirty because
-# .gitignore isn't committed.
-grep -v '^GNUmakefile$' .gitignore > .gitignore~ && mv .gitignore~ .gitignore
-
# Reconfigure, getting other files.
for command in \