|
@@ -1,6 +1,6 @@
|
|
#! /bin/sh
|
|
#! /bin/sh
|
|
# Print a version string.
|
|
# Print a version string.
|
|
-scriptversion=2015-08-24.08; # UTC
|
|
|
|
|
|
+scriptversion=2021-04-11.09; # UTC
|
|
|
|
|
|
# Bootstrap this package from checked-out sources.
|
|
# Bootstrap this package from checked-out sources.
|
|
|
|
|
|
@@ -17,7 +17,7 @@ scriptversion=2015-08-24.08; # UTC
|
|
# GNU General Public License for more details.
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
# You should have received a copy of the GNU General Public License
|
|
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
# Originally written by Paul Eggert. The canonical version of this
|
|
# Originally written by Paul Eggert. The canonical version of this
|
|
# script is maintained as build-aux/bootstrap in gnulib, however, to
|
|
# script is maintained as build-aux/bootstrap in gnulib, however, to
|
|
@@ -42,11 +42,13 @@ export LC_ALL
|
|
|
|
|
|
local_gl_dir=gl
|
|
local_gl_dir=gl
|
|
|
|
|
|
-# Honour $PERL, but work even if there is none
|
|
|
|
|
|
+# Honor $PERL, but work even if there is none.
|
|
PERL="${PERL-perl}"
|
|
PERL="${PERL-perl}"
|
|
|
|
|
|
me=$0
|
|
me=$0
|
|
|
|
|
|
|
|
+default_gnulib_url=https://git.savannah.gnu.org/git/gnulib.git
|
|
|
|
+
|
|
usage() {
|
|
usage() {
|
|
cat <<EOF
|
|
cat <<EOF
|
|
Usage: $me [OPTION]...
|
|
Usage: $me [OPTION]...
|
|
@@ -69,17 +71,56 @@ Options:
|
|
--no-git do not use git to update gnulib. Requires that
|
|
--no-git do not use git to update gnulib. Requires that
|
|
--gnulib-srcdir point to a correct gnulib snapshot
|
|
--gnulib-srcdir point to a correct gnulib snapshot
|
|
--skip-po do not download po files
|
|
--skip-po do not download po files
|
|
-
|
|
|
|
|
|
+EOF
|
|
|
|
+ bootstrap_print_option_usage_hook
|
|
|
|
+ cat <<EOF
|
|
If the file $me.conf exists in the same directory as this script, its
|
|
If the file $me.conf exists in the same directory as this script, its
|
|
contents are read as shell variables to configure the bootstrap.
|
|
contents are read as shell variables to configure the bootstrap.
|
|
|
|
|
|
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
|
|
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
|
|
are honored.
|
|
are honored.
|
|
|
|
|
|
|
|
+Gnulib sources can be fetched in various ways:
|
|
|
|
+
|
|
|
|
+ * If this package is in a git repository with a 'gnulib' submodule
|
|
|
|
+ configured, then that submodule is initialized and updated and sources
|
|
|
|
+ are fetched from there. If \$GNULIB_SRCDIR is set (directly or via
|
|
|
|
+ --gnulib-srcdir) and is a git repository, then it is used as a reference.
|
|
|
|
+
|
|
|
|
+ * Otherwise, if \$GNULIB_SRCDIR is set (directly or via --gnulib-srcdir),
|
|
|
|
+ then sources are fetched from that local directory. If it is a git
|
|
|
|
+ repository and \$GNULIB_REVISION is set, then that revision is checked
|
|
|
|
+ out.
|
|
|
|
+
|
|
|
|
+ * Otherwise, if this package is in a git repository with a 'gnulib'
|
|
|
|
+ submodule configured, then that submodule is initialized and updated and
|
|
|
|
+ sources are fetched from there.
|
|
|
|
+
|
|
|
|
+ * Otherwise, if the 'gnulib' directory does not exist, Gnulib sources are
|
|
|
|
+ cloned into that directory using git from \$GNULIB_URL, defaulting to
|
|
|
|
+ $default_gnulib_url.
|
|
|
|
+ If \$GNULIB_REVISION is set, then that revision is checked out.
|
|
|
|
+
|
|
|
|
+ * Otherwise, the existing Gnulib sources in the 'gnulib' directory are
|
|
|
|
+ used. If it is a git repository and \$GNULIB_REVISION is set, then that
|
|
|
|
+ revision is checked out.
|
|
|
|
+
|
|
|
|
+If you maintain a package and want to pin a particular revision of the
|
|
|
|
+Gnulib sources that has been tested with your package, then there are two
|
|
|
|
+possible approaches: either configure a 'gnulib' submodule with the
|
|
|
|
+appropriate revision, or set \$GNULIB_REVISION (and if necessary
|
|
|
|
+\$GNULIB_URL) in $me.conf.
|
|
|
|
+
|
|
Running without arguments will suffice in most cases.
|
|
Running without arguments will suffice in most cases.
|
|
EOF
|
|
EOF
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+copyright_year=`echo "$scriptversion" | sed -e 's/[^0-9].*//'`
|
|
|
|
+copyright="Copyright (C) ${copyright_year} Free Software Foundation, Inc.
|
|
|
|
+License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
|
|
|
|
+This is free software: you are free to change and redistribute it.
|
|
|
|
+There is NO WARRANTY, to the extent permitted by law."
|
|
|
|
+
|
|
# warnf_ FORMAT-STRING ARG1...
|
|
# warnf_ FORMAT-STRING ARG1...
|
|
warnf_ ()
|
|
warnf_ ()
|
|
{
|
|
{
|
|
@@ -121,6 +162,18 @@ gnulib_files=
|
|
: ${AUTOPOINT=autopoint}
|
|
: ${AUTOPOINT=autopoint}
|
|
: ${AUTORECONF=autoreconf}
|
|
: ${AUTORECONF=autoreconf}
|
|
|
|
|
|
|
|
+# A function to be called for each unrecognized option. Returns 0 if
|
|
|
|
+# the option in $1 has been processed by the function. Returns 1 if
|
|
|
|
+# the option has not been processed by the function. Override it via
|
|
|
|
+# your own definition in bootstrap.conf
|
|
|
|
+
|
|
|
|
+bootstrap_option_hook() { return 1; }
|
|
|
|
+
|
|
|
|
+# A function to be called in order to print the --help information
|
|
|
|
+# corresponding to user-defined command-line options.
|
|
|
|
+
|
|
|
|
+bootstrap_print_option_usage_hook() { :; }
|
|
|
|
+
|
|
# A function to be called right after gnulib-tool is run.
|
|
# A function to be called right after gnulib-tool is run.
|
|
# Override it via your own definition in bootstrap.conf.
|
|
# Override it via your own definition in bootstrap.conf.
|
|
bootstrap_post_import_hook() { :; }
|
|
bootstrap_post_import_hook() { :; }
|
|
@@ -129,22 +182,15 @@ bootstrap_post_import_hook() { :; }
|
|
# Override it via your own definition in bootstrap.conf.
|
|
# Override it via your own definition in bootstrap.conf.
|
|
bootstrap_epilogue() { :; }
|
|
bootstrap_epilogue() { :; }
|
|
|
|
|
|
-# The command to download all .po files for a specified domain into
|
|
|
|
-# a specified directory. Fill in the first %s is the domain name, and
|
|
|
|
-# the second with the destination directory. Use rsync's -L and -r
|
|
|
|
-# options because the latest/%s directory and the .po files within are
|
|
|
|
-# all symlinks.
|
|
|
|
|
|
+# The command to download all .po files for a specified domain into a
|
|
|
|
+# specified directory. Fill in the first %s with the destination
|
|
|
|
+# directory and the second with the domain name.
|
|
po_download_command_format=\
|
|
po_download_command_format=\
|
|
-"rsync --delete --exclude '*.s1' -Lrtvz \
|
|
|
|
- 'translationproject.org::tp/latest/%s/' '%s'"
|
|
|
|
-
|
|
|
|
-# Fallback for downloading .po files (if rsync fails).
|
|
|
|
-po_download_command_format2=\
|
|
|
|
-"wget --mirror -nd -q -np -A.po -P '%s' \
|
|
|
|
- http://translationproject.org/latest/%s/"
|
|
|
|
|
|
+"wget --mirror --level=1 -nd -nv -A.po -P '%s' \
|
|
|
|
+ https://translationproject.org/latest/%s/"
|
|
|
|
|
|
# Prefer a non-empty tarname (4th argument of AC_INIT if given), else
|
|
# Prefer a non-empty tarname (4th argument of AC_INIT if given), else
|
|
-# fall back to the package name (1st argument with munging)
|
|
|
|
|
|
+# fall back to the package name (1st argument with munging).
|
|
extract_package_name='
|
|
extract_package_name='
|
|
/^AC_INIT(\[*/{
|
|
/^AC_INIT(\[*/{
|
|
s///
|
|
s///
|
|
@@ -161,8 +207,11 @@ extract_package_name='
|
|
p
|
|
p
|
|
}
|
|
}
|
|
'
|
|
'
|
|
-package=$(sed -n "$extract_package_name" configure.ac) \
|
|
|
|
- || die 'cannot find package name in configure.ac'
|
|
|
|
|
|
+package=$(${AUTOCONF:-autoconf} --trace AC_INIT:\$4 configure.ac 2>/dev/null)
|
|
|
|
+if test -z "$package"; then
|
|
|
|
+ package=$(sed -n "$extract_package_name" configure.ac) \
|
|
|
|
+ || die 'cannot find package name in configure.ac'
|
|
|
|
+fi
|
|
gnulib_name=lib$package
|
|
gnulib_name=lib$package
|
|
|
|
|
|
build_aux=build-aux
|
|
build_aux=build-aux
|
|
@@ -170,7 +219,15 @@ source_base=lib
|
|
m4_base=m4
|
|
m4_base=m4
|
|
doc_base=doc
|
|
doc_base=doc
|
|
tests_base=tests
|
|
tests_base=tests
|
|
-gnulib_extra_files=''
|
|
|
|
|
|
+gnulib_extra_files="
|
|
|
|
+ build-aux/install-sh
|
|
|
|
+ build-aux/mdate-sh
|
|
|
|
+ build-aux/texinfo.tex
|
|
|
|
+ build-aux/depcomp
|
|
|
|
+ build-aux/config.guess
|
|
|
|
+ build-aux/config.sub
|
|
|
|
+ doc/INSTALL
|
|
|
|
+"
|
|
|
|
|
|
# Additional gnulib-tool options to use. Use "\newline" to break lines.
|
|
# Additional gnulib-tool options to use. Use "\newline" to break lines.
|
|
gnulib_tool_option_extras=
|
|
gnulib_tool_option_extras=
|
|
@@ -256,6 +313,47 @@ find_tool ()
|
|
eval "export $find_tool_envvar"
|
|
eval "export $find_tool_envvar"
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+# Strip blank and comment lines to leave significant entries.
|
|
|
|
+gitignore_entries() {
|
|
|
|
+ sed '/^#/d; /^$/d' "$@"
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+# If $STR is not already on a line by itself in $FILE, insert it at the start.
|
|
|
|
+# Entries are inserted at the start of the ignore list to ensure existing
|
|
|
|
+# entries starting with ! are not overridden. Such entries support
|
|
|
|
+# whitelisting exceptions after a more generic blacklist pattern.
|
|
|
|
+insert_if_absent() {
|
|
|
|
+ file=$1
|
|
|
|
+ str=$2
|
|
|
|
+ test -f $file || touch $file
|
|
|
|
+ test -r $file || die "Error: failed to read ignore file: $file"
|
|
|
|
+ duplicate_entries=$(gitignore_entries $file | sort | uniq -d)
|
|
|
|
+ if [ "$duplicate_entries" ] ; then
|
|
|
|
+ die "Error: Duplicate entries in $file: " $duplicate_entries
|
|
|
|
+ fi
|
|
|
|
+ linesold=$(gitignore_entries $file | wc -l)
|
|
|
|
+ linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
|
|
|
|
+ if [ $linesold != $linesnew ] ; then
|
|
|
|
+ { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
|
|
|
|
+ || die "insert_if_absent $file $str: failed"
|
|
|
|
+ fi
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
|
|
|
|
+# insert_if_absent.
|
|
|
|
+insert_vc_ignore() {
|
|
|
|
+ vc_ignore_file="$1"
|
|
|
|
+ pattern="$2"
|
|
|
|
+ case $vc_ignore_file in
|
|
|
|
+ *.gitignore)
|
|
|
|
+ # A .gitignore entry that does not start with '/' applies
|
|
|
|
+ # recursively to subdirectories, so prepend '/' to every
|
|
|
|
+ # .gitignore entry.
|
|
|
|
+ pattern=$(echo "$pattern" | sed s,^,/,);;
|
|
|
|
+ esac
|
|
|
|
+ insert_if_absent "$vc_ignore_file" "$pattern"
|
|
|
|
+}
|
|
|
|
+
|
|
symlink_to_dir()
|
|
symlink_to_dir()
|
|
{
|
|
{
|
|
src=$1/$2
|
|
src=$1/$2
|
|
@@ -296,9 +394,9 @@ symlink_to_dir()
|
|
# Leave any existing symlink alone, if it already points to the source,
|
|
# Leave any existing symlink alone, if it already points to the source,
|
|
# so that broken build tools that care about symlink times
|
|
# so that broken build tools that care about symlink times
|
|
# aren't confused into doing unnecessary builds. Conversely, if the
|
|
# aren't confused into doing unnecessary builds. Conversely, if the
|
|
- # existing symlink's time stamp is older than the source, make it afresh,
|
|
|
|
|
|
+ # existing symlink's timestamp is older than the source, make it afresh,
|
|
# so that broken tools aren't confused into skipping needed builds. See
|
|
# so that broken tools aren't confused into skipping needed builds. See
|
|
- # <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00326.html>.
|
|
|
|
|
|
+ # <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00326.html>.
|
|
test -h "$dst" &&
|
|
test -h "$dst" &&
|
|
src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
|
|
src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
|
|
dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
|
|
dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
|
|
@@ -333,24 +431,18 @@ case "$0" in
|
|
*) test -r "$0.conf" && . ./"$0.conf" ;;
|
|
*) test -r "$0.conf" && . ./"$0.conf" ;;
|
|
esac
|
|
esac
|
|
|
|
|
|
-# Extra files from gnulib, which override files from other sources.
|
|
|
|
-test -z "${gnulib_extra_files}" && \
|
|
|
|
- gnulib_extra_files="
|
|
|
|
- build-aux/install-sh
|
|
|
|
- build-aux/mdate-sh
|
|
|
|
- build-aux/texinfo.tex
|
|
|
|
- build-aux/depcomp
|
|
|
|
- build-aux/config.guess
|
|
|
|
- build-aux/config.sub
|
|
|
|
- doc/INSTALL
|
|
|
|
-"
|
|
|
|
-
|
|
|
|
if test "$vc_ignore" = auto; then
|
|
if test "$vc_ignore" = auto; then
|
|
vc_ignore=
|
|
vc_ignore=
|
|
test -d .git && vc_ignore=.gitignore
|
|
test -d .git && vc_ignore=.gitignore
|
|
test -d CVS && vc_ignore="$vc_ignore .cvsignore"
|
|
test -d CVS && vc_ignore="$vc_ignore .cvsignore"
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+if test x"$gnulib_modules$gnulib_files$gnulib_extra_files" = x; then
|
|
|
|
+ use_gnulib=false
|
|
|
|
+else
|
|
|
|
+ use_gnulib=true
|
|
|
|
+fi
|
|
|
|
+
|
|
# Translate configuration into internal form.
|
|
# Translate configuration into internal form.
|
|
|
|
|
|
# Parse options.
|
|
# Parse options.
|
|
@@ -361,6 +453,12 @@ do
|
|
--help)
|
|
--help)
|
|
usage
|
|
usage
|
|
exit;;
|
|
exit;;
|
|
|
|
+ --version)
|
|
|
|
+ set -e
|
|
|
|
+ echo "bootstrap $scriptversion"
|
|
|
|
+ echo "$copyright"
|
|
|
|
+ exit 0
|
|
|
|
+ ;;
|
|
--gnulib-srcdir=*)
|
|
--gnulib-srcdir=*)
|
|
GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
|
|
GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
|
|
--skip-po)
|
|
--skip-po)
|
|
@@ -376,7 +474,7 @@ do
|
|
--no-git)
|
|
--no-git)
|
|
use_git=false;;
|
|
use_git=false;;
|
|
*)
|
|
*)
|
|
- die "$option: unknown option";;
|
|
|
|
|
|
+ bootstrap_option_hook $option || die "$option: unknown option";;
|
|
esac
|
|
esac
|
|
done
|
|
done
|
|
|
|
|
|
@@ -387,47 +485,6 @@ if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
|
die "Bootstrapping from a non-checked-out distribution is risky."
|
|
die "Bootstrapping from a non-checked-out distribution is risky."
|
|
fi
|
|
fi
|
|
|
|
|
|
-# Strip blank and comment lines to leave significant entries.
|
|
|
|
-gitignore_entries() {
|
|
|
|
- sed '/^#/d; /^$/d' "$@"
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-# If $STR is not already on a line by itself in $FILE, insert it at the start.
|
|
|
|
-# Entries are inserted at the start of the ignore list to ensure existing
|
|
|
|
-# entries starting with ! are not overridden. Such entries support
|
|
|
|
-# whitelisting exceptions after a more generic blacklist pattern.
|
|
|
|
-insert_if_absent() {
|
|
|
|
- file=$1
|
|
|
|
- str=$2
|
|
|
|
- test -f $file || touch $file
|
|
|
|
- test -r $file || die "Error: failed to read ignore file: $file"
|
|
|
|
- duplicate_entries=$(gitignore_entries $file | sort | uniq -d)
|
|
|
|
- if [ "$duplicate_entries" ] ; then
|
|
|
|
- die "Error: Duplicate entries in $file: " $duplicate_entries
|
|
|
|
- fi
|
|
|
|
- linesold=$(gitignore_entries $file | wc -l)
|
|
|
|
- linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
|
|
|
|
- if [ $linesold != $linesnew ] ; then
|
|
|
|
- { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
|
|
|
|
- || die "insert_if_absent $file $str: failed"
|
|
|
|
- fi
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
|
|
|
|
-# insert_if_absent.
|
|
|
|
-insert_vc_ignore() {
|
|
|
|
- vc_ignore_file="$1"
|
|
|
|
- pattern="$2"
|
|
|
|
- case $vc_ignore_file in
|
|
|
|
- *.gitignore)
|
|
|
|
- # A .gitignore entry that does not start with '/' applies
|
|
|
|
- # recursively to subdirectories, so prepend '/' to every
|
|
|
|
- # .gitignore entry.
|
|
|
|
- pattern=$(echo "$pattern" | sed s,^,/,);;
|
|
|
|
- esac
|
|
|
|
- insert_if_absent "$vc_ignore_file" "$pattern"
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
|
|
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
|
|
found_aux_dir=no
|
|
found_aux_dir=no
|
|
grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
|
|
grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
|
|
@@ -487,28 +544,30 @@ sort_ver() { # sort -V is not generally available
|
|
done
|
|
done
|
|
}
|
|
}
|
|
|
|
|
|
-get_version() {
|
|
|
|
- app=$1
|
|
|
|
|
|
+get_version_sed='
|
|
|
|
+# Move version to start of line.
|
|
|
|
+s/.*[v ]\([0-9]\)/\1/
|
|
|
|
|
|
- $app --version >/dev/null 2>&1 || { $app --version; return 1; }
|
|
|
|
|
|
+# Skip lines that do not start with version.
|
|
|
|
+/^[0-9]/!d
|
|
|
|
|
|
- $app --version 2>&1 |
|
|
|
|
- sed -n '# Move version to start of line.
|
|
|
|
- s/.*[v ]\([0-9]\)/\1/
|
|
|
|
|
|
+# Remove characters after the version.
|
|
|
|
+s/[^.a-z0-9-].*//
|
|
|
|
|
|
- # Skip lines that do not start with version.
|
|
|
|
- /^[0-9]/!d
|
|
|
|
|
|
+# The first component must be digits only.
|
|
|
|
+s/^\([0-9]*\)[a-z-].*/\1/
|
|
|
|
|
|
- # Remove characters after the version.
|
|
|
|
- s/[^.a-z0-9-].*//
|
|
|
|
|
|
+#the following essentially does s/5.005/5.5/
|
|
|
|
+s/\.0*\([1-9]\)/.\1/g
|
|
|
|
+p
|
|
|
|
+q'
|
|
|
|
|
|
- # The first component must be digits only.
|
|
|
|
- s/^\([0-9]*\)[a-z-].*/\1/
|
|
|
|
|
|
+get_version() {
|
|
|
|
+ app=$1
|
|
|
|
+
|
|
|
|
+ $app --version >/dev/null 2>&1 || { $app --version; return 1; }
|
|
|
|
|
|
- #the following essentially does s/5.005/5.5/
|
|
|
|
- s/\.0*\([1-9]\)/.\1/g
|
|
|
|
- p
|
|
|
|
- q'
|
|
|
|
|
|
+ $app --version 2>&1 | sed -n "$get_version_sed"
|
|
}
|
|
}
|
|
|
|
|
|
check_versions() {
|
|
check_versions() {
|
|
@@ -679,95 +738,101 @@ git_modules_config () {
|
|
test -f .gitmodules && git config --file .gitmodules "$@"
|
|
test -f .gitmodules && git config --file .gitmodules "$@"
|
|
}
|
|
}
|
|
|
|
|
|
-if $use_git; then
|
|
|
|
- gnulib_path=$(git_modules_config submodule.gnulib.path)
|
|
|
|
- test -z "$gnulib_path" && gnulib_path=gnulib
|
|
|
|
-fi
|
|
|
|
|
|
+if $use_gnulib; then
|
|
|
|
+ if $use_git; then
|
|
|
|
+ gnulib_path=$(git_modules_config submodule.gnulib.path)
|
|
|
|
+ test -z "$gnulib_path" && gnulib_path=gnulib
|
|
|
|
+ fi
|
|
|
|
|
|
-# Get gnulib files. Populate $GNULIB_SRCDIR, possibly updating a
|
|
|
|
-# submodule, for use in the rest of the script.
|
|
|
|
|
|
+ # Get gnulib files. Populate $GNULIB_SRCDIR, possibly updating a
|
|
|
|
+ # submodule, for use in the rest of the script.
|
|
|
|
|
|
-case ${GNULIB_SRCDIR--} in
|
|
|
|
--)
|
|
|
|
- # Note that $use_git is necessarily true in this case.
|
|
|
|
- if git_modules_config submodule.gnulib.url >/dev/null; then
|
|
|
|
- echo "$0: getting gnulib files..."
|
|
|
|
- git submodule init -- "$gnulib_path" || exit $?
|
|
|
|
- git submodule update -- "$gnulib_path" || exit $?
|
|
|
|
|
|
+ case ${GNULIB_SRCDIR--} in
|
|
|
|
+ -)
|
|
|
|
+ # Note that $use_git is necessarily true in this case.
|
|
|
|
+ if git_modules_config submodule.gnulib.url >/dev/null; then
|
|
|
|
+ echo "$0: getting gnulib files..."
|
|
|
|
+ git submodule init -- "$gnulib_path" || exit $?
|
|
|
|
+ git submodule update -- "$gnulib_path" || exit $?
|
|
|
|
|
|
- elif [ ! -d "$gnulib_path" ]; then
|
|
|
|
- echo "$0: getting gnulib files..."
|
|
|
|
|
|
+ elif [ ! -d "$gnulib_path" ]; then
|
|
|
|
+ echo "$0: getting gnulib files..."
|
|
|
|
|
|
- trap cleanup_gnulib 1 2 13 15
|
|
|
|
|
|
+ trap cleanup_gnulib 1 2 13 15
|
|
|
|
|
|
- shallow=
|
|
|
|
- git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
|
|
|
|
- git clone $shallow git://git.sv.gnu.org/gnulib "$gnulib_path" ||
|
|
|
|
- cleanup_gnulib
|
|
|
|
|
|
+ shallow=
|
|
|
|
+ if test -z "$GNULIB_REVISION"; then
|
|
|
|
+ git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
|
|
|
|
+ fi
|
|
|
|
+ git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \
|
|
|
|
+ || cleanup_gnulib
|
|
|
|
|
|
- trap - 1 2 13 15
|
|
|
|
- fi
|
|
|
|
- GNULIB_SRCDIR=$gnulib_path
|
|
|
|
- ;;
|
|
|
|
-*)
|
|
|
|
- # Use GNULIB_SRCDIR directly or as a reference.
|
|
|
|
- if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
|
|
|
|
- git_modules_config submodule.gnulib.url >/dev/null; then
|
|
|
|
- echo "$0: getting gnulib files..."
|
|
|
|
- if git submodule -h|grep -- --reference > /dev/null; then
|
|
|
|
- # Prefer the one-liner available in git 1.6.4 or newer.
|
|
|
|
- git submodule update --init --reference "$GNULIB_SRCDIR" \
|
|
|
|
- "$gnulib_path" || exit $?
|
|
|
|
- else
|
|
|
|
- # This fallback allows at least git 1.5.5.
|
|
|
|
- if test -f "$gnulib_path"/gnulib-tool; then
|
|
|
|
- # Since file already exists, assume submodule init already complete.
|
|
|
|
- git submodule update -- "$gnulib_path" || exit $?
|
|
|
|
|
|
+ trap - 1 2 13 15
|
|
|
|
+ fi
|
|
|
|
+ GNULIB_SRCDIR=$gnulib_path
|
|
|
|
+ ;;
|
|
|
|
+ *)
|
|
|
|
+ # Use GNULIB_SRCDIR directly or as a reference.
|
|
|
|
+ if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
|
|
|
|
+ git_modules_config submodule.gnulib.url >/dev/null; then
|
|
|
|
+ echo "$0: getting gnulib files..."
|
|
|
|
+ if git submodule -h|grep -- --reference > /dev/null; then
|
|
|
|
+ # Prefer the one-liner available in git 1.6.4 or newer.
|
|
|
|
+ git submodule update --init --reference "$GNULIB_SRCDIR" \
|
|
|
|
+ "$gnulib_path" || exit $?
|
|
else
|
|
else
|
|
- # Older git can't clone into an empty directory.
|
|
|
|
- rmdir "$gnulib_path" 2>/dev/null
|
|
|
|
- git clone --reference "$GNULIB_SRCDIR" \
|
|
|
|
- "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
|
|
|
|
- && git submodule init -- "$gnulib_path" \
|
|
|
|
- && git submodule update -- "$gnulib_path" \
|
|
|
|
- || exit $?
|
|
|
|
|
|
+ # This fallback allows at least git 1.5.5.
|
|
|
|
+ if test -f "$gnulib_path"/gnulib-tool; then
|
|
|
|
+ # Since file already exists, assume submodule init already complete.
|
|
|
|
+ git submodule update -- "$gnulib_path" || exit $?
|
|
|
|
+ else
|
|
|
|
+ # Older git can't clone into an empty directory.
|
|
|
|
+ rmdir "$gnulib_path" 2>/dev/null
|
|
|
|
+ git clone --reference "$GNULIB_SRCDIR" \
|
|
|
|
+ "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
|
|
|
|
+ && git submodule init -- "$gnulib_path" \
|
|
|
|
+ && git submodule update -- "$gnulib_path" \
|
|
|
|
+ || exit $?
|
|
|
|
+ fi
|
|
fi
|
|
fi
|
|
|
|
+ GNULIB_SRCDIR=$gnulib_path
|
|
fi
|
|
fi
|
|
- GNULIB_SRCDIR=$gnulib_path
|
|
|
|
|
|
+ ;;
|
|
|
|
+ esac
|
|
|
|
+
|
|
|
|
+ if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \
|
|
|
|
+ && ! git_modules_config submodule.gnulib.url >/dev/null; then
|
|
|
|
+ (cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib
|
|
fi
|
|
fi
|
|
- ;;
|
|
|
|
-esac
|
|
|
|
|
|
|
|
-# $GNULIB_SRCDIR now points to the version of gnulib to use, and
|
|
|
|
-# we no longer need to use git or $gnulib_path below here.
|
|
|
|
|
|
+ # $GNULIB_SRCDIR now points to the version of gnulib to use, and
|
|
|
|
+ # we no longer need to use git or $gnulib_path below here.
|
|
|
|
+
|
|
|
|
+ if $bootstrap_sync; then
|
|
|
|
+ cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
|
|
|
|
+ echo "$0: updating bootstrap and restarting..."
|
|
|
|
+ case $(sh -c 'echo "$1"' -- a) in
|
|
|
|
+ a) ignored=--;;
|
|
|
|
+ *) ignored=ignored;;
|
|
|
|
+ esac
|
|
|
|
+ exec sh -c \
|
|
|
|
+ 'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
|
|
|
|
+ $ignored "$GNULIB_SRCDIR/build-aux/bootstrap" \
|
|
|
|
+ "$0" "$@" --no-bootstrap-sync
|
|
|
|
+ }
|
|
|
|
+ fi
|
|
|
|
|
|
-if $bootstrap_sync; then
|
|
|
|
- cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
|
|
|
|
- echo "$0: updating bootstrap and restarting..."
|
|
|
|
- case $(sh -c 'echo "$1"' -- a) in
|
|
|
|
- a) ignored=--;;
|
|
|
|
- *) ignored=ignored;;
|
|
|
|
- esac
|
|
|
|
- exec sh -c \
|
|
|
|
- 'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
|
|
|
|
- $ignored "$GNULIB_SRCDIR/build-aux/bootstrap" \
|
|
|
|
- "$0" "$@" --no-bootstrap-sync
|
|
|
|
- }
|
|
|
|
|
|
+ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
|
|
|
+ <$gnulib_tool || exit $?
|
|
fi
|
|
fi
|
|
|
|
|
|
-gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
|
|
|
-<$gnulib_tool || exit $?
|
|
|
|
-
|
|
|
|
# Get translations.
|
|
# Get translations.
|
|
|
|
|
|
download_po_files() {
|
|
download_po_files() {
|
|
subdir=$1
|
|
subdir=$1
|
|
domain=$2
|
|
domain=$2
|
|
echo "$me: getting translations into $subdir for $domain..."
|
|
echo "$me: getting translations into $subdir for $domain..."
|
|
- cmd=$(printf "$po_download_command_format" "$domain" "$subdir")
|
|
|
|
- eval "$cmd" && return
|
|
|
|
- # Fallback to HTTP.
|
|
|
|
- cmd=$(printf "$po_download_command_format2" "$subdir" "$domain")
|
|
|
|
|
|
+ cmd=$(printf "$po_download_command_format" "$subdir" "$domain")
|
|
eval "$cmd"
|
|
eval "$cmd"
|
|
}
|
|
}
|
|
|
|
|
|
@@ -896,36 +961,47 @@ fi
|
|
|
|
|
|
# Import from gnulib.
|
|
# Import from gnulib.
|
|
|
|
|
|
-gnulib_tool_options="\
|
|
|
|
- --import\
|
|
|
|
- --no-changelog\
|
|
|
|
- --aux-dir $build_aux\
|
|
|
|
- --doc-base $doc_base\
|
|
|
|
- --lib $gnulib_name\
|
|
|
|
- --m4-base $m4_base/\
|
|
|
|
- --source-base $source_base/\
|
|
|
|
- --tests-base $tests_base\
|
|
|
|
- --local-dir $local_gl_dir\
|
|
|
|
- $gnulib_tool_option_extras\
|
|
|
|
-"
|
|
|
|
-if test $use_libtool = 1; then
|
|
|
|
- case "$gnulib_tool_options " in
|
|
|
|
- *' --libtool '*) ;;
|
|
|
|
- *) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
|
|
|
|
- esac
|
|
|
|
-fi
|
|
|
|
-echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
|
|
|
|
-$gnulib_tool $gnulib_tool_options --import $gnulib_modules \
|
|
|
|
- || die "gnulib-tool failed"
|
|
|
|
|
|
+if $use_gnulib; then
|
|
|
|
+ gnulib_tool_options="\
|
|
|
|
+ --no-changelog\
|
|
|
|
+ --aux-dir=$build_aux\
|
|
|
|
+ --doc-base=$doc_base\
|
|
|
|
+ --lib=$gnulib_name\
|
|
|
|
+ --m4-base=$m4_base/\
|
|
|
|
+ --source-base=$source_base/\
|
|
|
|
+ --tests-base=$tests_base\
|
|
|
|
+ --local-dir=$local_gl_dir\
|
|
|
|
+ $gnulib_tool_option_extras\
|
|
|
|
+ "
|
|
|
|
+ if test $use_libtool = 1; then
|
|
|
|
+ case "$gnulib_tool_options " in
|
|
|
|
+ *' --libtool '*) ;;
|
|
|
|
+ *) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
|
|
|
|
+ esac
|
|
|
|
+ fi
|
|
|
|
+ echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
|
|
|
|
+ $gnulib_tool $gnulib_tool_options --import $gnulib_modules \
|
|
|
|
+ || die "gnulib-tool failed"
|
|
|
|
|
|
-for file in $gnulib_files; do
|
|
|
|
- symlink_to_dir "$GNULIB_SRCDIR" $file \
|
|
|
|
- || die "failed to symlink $file"
|
|
|
|
-done
|
|
|
|
|
|
+ for file in $gnulib_files; do
|
|
|
|
+ symlink_to_dir "$GNULIB_SRCDIR" $file \
|
|
|
|
+ || die "failed to symlink $file"
|
|
|
|
+ done
|
|
|
|
+fi
|
|
|
|
|
|
bootstrap_post_import_hook \
|
|
bootstrap_post_import_hook \
|
|
|| die "bootstrap_post_import_hook failed"
|
|
|| die "bootstrap_post_import_hook failed"
|
|
|
|
|
|
|
|
+# Don't proceed if there are uninitialized submodules. In particular,
|
|
|
|
+# the next step will remove dangling links, which might be links into
|
|
|
|
+# uninitialized submodules.
|
|
|
|
+#
|
|
|
|
+# Uninitialized submodules are listed with an initial dash.
|
|
|
|
+if $use_git && git submodule | grep '^-' >/dev/null; then
|
|
|
|
+ die "some git submodules are not initialized. " \
|
|
|
|
+ "Run 'git submodule update --init' and bootstrap again."
|
|
|
|
+fi
|
|
|
|
+
|
|
# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
|
|
# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
|
|
# gnulib-populated directories. Such .m4 files would cause aclocal to fail.
|
|
# gnulib-populated directories. Such .m4 files would cause aclocal to fail.
|
|
# The following requires GNU find 4.2.3 or newer. Considering the usual
|
|
# The following requires GNU find 4.2.3 or newer. Considering the usual
|
|
@@ -1018,9 +1094,9 @@ bootstrap_epilogue
|
|
echo "$0: done. Now you can run './configure'."
|
|
echo "$0: done. Now you can run './configure'."
|
|
|
|
|
|
# Local variables:
|
|
# Local variables:
|
|
-# eval: (add-hook 'write-file-hooks 'time-stamp)
|
|
|
|
|
|
+# eval: (add-hook 'before-save-hook 'time-stamp)
|
|
# time-stamp-start: "scriptversion="
|
|
# time-stamp-start: "scriptversion="
|
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
-# time-stamp-time-zone: "UTC"
|
|
|
|
|
|
+# time-stamp-time-zone: "UTC0"
|
|
# time-stamp-end: "; # UTC"
|
|
# time-stamp-end: "; # UTC"
|
|
# End:
|
|
# End:
|