build-sys: update bootstrap from gnulib

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2025-04-28 14:00:35 +01:00
parent 5b7ab28314
commit f917d5b223
No known key found for this signature in database
GPG key ID: A9553245FDE9B739
3 changed files with 176 additions and 56 deletions

156
bootstrap
View file

@ -5,7 +5,7 @@
scriptversion=2024-07-04.10; # UTC
# Copyright (C) 2003-2024 Free Software Foundation, Inc.
# Copyright (C) 2003-2025 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
@ -37,9 +37,9 @@ medir=`dirname "$me"`
# A library of shell functions for autopull.sh, autogen.sh, and bootstrap.
scriptlibversion=2024-07-21.12; # UTC
scriptlibversion=2025-02-16.12; # UTC
# Copyright (C) 2003-2024 Free Software Foundation, Inc.
# Copyright (C) 2003-2025 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
@ -152,7 +152,8 @@ po_download_command_format=\
"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
# When extracting the package name from an AC_INIT invocation,
# prefer a non-empty tarname (4th argument of AC_INIT if given), else
# fall back to the package name (1st argument with munging).
extract_package_name='
/^AC_INIT(\[*/{
@ -164,18 +165,21 @@ extract_package_name='
q
}
s/[],)].*//
s/^GNU //
s/-/_/g
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g
p
}
'
package=$(${AUTOCONF:-autoconf} --trace AC_INIT:\$4 configure.ac 2>/dev/null)
normalize_package_name='
s/^GNU //
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g
'
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
package=$(echo "$package" | sed "$normalize_package_name")
gnulib_name=lib$package
build_aux=build-aux
@ -506,11 +510,10 @@ prepare_GNULIB_SRCDIR ()
# if the GNULIB_REVISION is a commit hash that only exists in
# origin. In this case, we need a 'git fetch' and then retry
# 'git checkout "$GNULIB_REVISION"'.
(cd "$GNULIB_SRCDIR" \
&& { git checkout "$GNULIB_REVISION" 2>/dev/null \
|| { git fetch origin && git checkout "$GNULIB_REVISION"; }
}
) || exit $?
git -C "$GNULIB_SRCDIR" checkout "$GNULIB_REVISION" 2>/dev/null \
|| { git -C "$GNULIB_SRCDIR" fetch origin \
&& git -C "$GNULIB_SRCDIR" checkout "$GNULIB_REVISION"; } \
|| exit $?
fi
else
if ! $use_git; then
@ -548,34 +551,78 @@ prepare_GNULIB_SRCDIR ()
echo "$0: getting gnulib files..."
trap cleanup_gnulib HUP INT PIPE TERM
gnulib_url=${GNULIB_URL:-$default_gnulib_url}
shallow=
if test -z "$GNULIB_REVISION"; then
if git clone -h 2>&1 | grep -- --depth > /dev/null; then
shallow='--depth 2'
fi
git clone $shallow "$gnulib_url" "$gnulib_path" \
|| cleanup_gnulib
if test -n "$GNULIB_REFDIR" && test -d "$GNULIB_REFDIR"/.git; then
# Use GNULIB_REFDIR as a reference.
git clone "$GNULIB_REFDIR" "$gnulib_path" \
&& git -C "$gnulib_path" remote set-url origin "$gnulib_url" \
&& if test -z "$GNULIB_REVISION"; then
git -C "$gnulib_path" pull origin \
&& {
# We want the default branch of "$gnulib_url" (since that's
# the behaviour if GNULIB_REFDIR is not specified), not the
# current branch of "$GNULIB_REFDIR".
default_branch=`LC_ALL=C git -C "$gnulib_path" \
remote show origin \
| sed -n -e 's/^ *HEAD branch: //p'`
test -n "$default_branch" || default_branch='master'
git -C "$gnulib_path" checkout "$default_branch"
}
else
# The 'git checkout "$GNULIB_REVISION"' command succeeds if the
# GNULIB_REVISION is a commit hash that exists locally, or if it
# is a branch name that can be fetched from origin. It fails,
# however, if the GNULIB_REVISION is a commit hash that only
# exists in origin. In this case, we need a 'git fetch' and then
# retry 'git checkout "$GNULIB_REVISION"'.
git -C "$gnulib_path" checkout "$GNULIB_REVISION" 2>/dev/null \
|| { git -C "$gnulib_path" fetch origin \
&& git -C "$gnulib_path" checkout "$GNULIB_REVISION"; }
fi \
|| cleanup_gnulib
else
if git fetch -h 2>&1 | grep -- --depth > /dev/null; then
shallow='--depth 2'
# GNULIB_REFDIR is not set or not usable. Ignore it.
shallow='--depth 2'
if test -z "$GNULIB_REVISION"; then
git clone $shallow "$gnulib_url" "$gnulib_path" \
|| cleanup_gnulib
else
# Only want a shallow checkout of $GNULIB_REVISION, but git does not
# support cloning by commit hash. So attempt a shallow fetch by
# commit hash to minimize the amount of data downloaded and changes
# needed to be processed, which can drastically reduce download and
# processing time for checkout. If the fetch by commit fails, a
# shallow fetch cannot be performed because we do not know what the
# depth of the commit is without fetching all commits. So fall back
# to fetching all commits.
# $GNULIB_REVISION can be a commit id, a tag name, or a branch name.
mkdir -p "$gnulib_path"
# Use a -c option to silence an annoying message
# "hint: Using 'master' as the name for the initial branch."
# (cf. <https://stackoverflow.com/questions/65524512/>).
git -C "$gnulib_path" -c init.defaultBranch=master init
git -C "$gnulib_path" remote add origin "$gnulib_url"
if git -C "$gnulib_path" fetch $shallow origin "$GNULIB_REVISION"
then
# "git fetch" of the specific commit succeeded.
git -C "$gnulib_path" reset --hard FETCH_HEAD \
|| cleanup_gnulib
# "git fetch" does not fetch tags (at least in git version 2.43).
# If $GNULIB_REVISION is a tag (not a commit id or branch name),
# add the tag explicitly.
revision=`git -C "$gnulib_path" log -1 --pretty=format:%H`
branch=`LC_ALL=C git -C "$gnulib_path" remote show origin \
| sed -n -e 's/^ \([^ ]*\) * tracked$/\1/p'`
test "$revision" = "$GNULIB_REVISION" \
|| test "$branch" = "$GNULIB_REVISION" \
|| git -C "$gnulib_path" tag "$GNULIB_REVISION"
else
# Fetch the entire repository.
git -C "$gnulib_path" fetch origin \
|| cleanup_gnulib
git -C "$gnulib_path" checkout "$GNULIB_REVISION" \
|| cleanup_gnulib
fi
fi
mkdir -p "$gnulib_path"
# Only want a shallow checkout of $GNULIB_REVISION, but git does not
# support cloning by commit hash. So attempt a shallow fetch by commit
# hash to minimize the amount of data downloaded and changes needed to
# be processed, which can drastically reduce download and processing
# time for checkout. If the fetch by commit fails, a shallow fetch can
# not be performed because we do not know what the depth of the commit
# is without fetching all commits. So fall back to fetching all
# commits.
git -C "$gnulib_path" init
git -C "$gnulib_path" remote add origin "$gnulib_url"
git -C "$gnulib_path" fetch $shallow origin "$GNULIB_REVISION" \
|| git -C "$gnulib_path" fetch origin \
|| cleanup_gnulib
git -C "$gnulib_path" reset --hard FETCH_HEAD
(cd "$gnulib_path" && git checkout "$GNULIB_REVISION") \
|| cleanup_gnulib
fi
trap - HUP INT PIPE TERM
else
@ -583,16 +630,15 @@ prepare_GNULIB_SRCDIR ()
if test -n "$GNULIB_REVISION"; then
if test -d "$gnulib_path/.git"; then
# The 'git checkout "$GNULIB_REVISION"' command succeeds if the
# GNULIB_REVISION is a commit hash that exists locally, or if it is
# branch name that can be fetched from origin. It fails, however,
# if the GNULIB_REVISION is a commit hash that only exists in
# origin. In this case, we need a 'git fetch' and then retry
# 'git checkout "$GNULIB_REVISION"'.
(cd "$gnulib_path" \
&& { git checkout "$GNULIB_REVISION" 2>/dev/null \
|| { git fetch origin && git checkout "$GNULIB_REVISION"; }
}
) || exit $?
# GNULIB_REVISION is a commit hash that exists locally, or if it
# is a branch name that can be fetched from origin. It fails,
# however, if the GNULIB_REVISION is a commit hash that only
# exists in origin. In this case, we need a 'git fetch' and then
# retry 'git checkout "$GNULIB_REVISION"'.
git -C "$gnulib_path" checkout "$GNULIB_REVISION" 2>/dev/null \
|| { git -C "$gnulib_path" fetch origin \
&& git -C "$gnulib_path" checkout "$GNULIB_REVISION"; } \
|| exit $?
else
die "Error: GNULIB_REVISION is specified in bootstrap.conf," \
"but '$gnulib_path' contains no git history"
@ -722,7 +768,8 @@ Gnulib sources can be fetched in various ways:
* 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.
to $default_gnulib_url; if GNULIB_REFDIR is set and is a git repository
its contents may be used to accelerate the process.
If the configuration variable GNULIB_REVISION is set in bootstrap.conf,
then that revision is checked out.
@ -890,9 +937,7 @@ update_po_files() {
&& ls "$ref_po_dir"/*.po 2>/dev/null |
sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return
langs=$(cd $ref_po_dir && echo *.po | sed 's/\.po//g')
test "$langs" = '*' && langs=x
for po in $langs; do
for po in x $(ls $ref_po_dir | sed -n 's/\.po$//p'); do
case $po in x) continue;; esac
new_po="$ref_po_dir/$po.po"
cksum_file="$ref_po_dir/$po.s1"
@ -1355,7 +1400,7 @@ autogen()
|| die 'cannot generate runtime-po/Makevars'
# Copy identical files from po to runtime-po.
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
cp -p po/Makefile.in.in po/*-quot po/*.header po/*.sed po/*.sin runtime-po
fi
fi
@ -1457,7 +1502,8 @@ Gnulib sources can be fetched in various ways:
* 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.
to $default_gnulib_url; if GNULIB_REFDIR is set and is a git repository
its contents may be used to accelerate the process.
If the configuration variable GNULIB_REVISION is set in bootstrap.conf,
then that revision is checked out.

View file

@ -1,6 +1,6 @@
# Bootstrap configuration. -*- sh -*-
# Copyright (C) 2006-2024 Free Software Foundation, Inc.
# Copyright (C) 2006-2025 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

74
lib/.gitignore vendored
View file

@ -1,5 +1,8 @@
/alloca.h
/alloca.in.h
/arg-nonnull.h
/arpa/
/arpa_inet.c
/arpa_inet.in.h
/assert.in.h
/attribute.h
@ -26,11 +29,13 @@
/dup2.c
/errno.in.h
/error.c
/error.h
/error.in.h
/exitfail.c
/exitfail.h
/fclose.c
/fcntl.c
/fcntl.h
/fcntl.in.h
/fd-hook.c
/fd-hook.h
@ -40,6 +45,7 @@
/flexmember.h
/float.c
/float+.h
/float.h
/float.in.h
/fopen.c
/fpending.c
@ -54,6 +60,8 @@
/ftell.c
/ftello.c
/getdtablesize.c
/getlocalename_l-unsafe.c
/getlocalename_l-unsafe.h
/getopt1.c
/getopt.c
/getopt-cdefs.in.h
@ -74,6 +82,7 @@
/inet_pton.c
/intprops.h
/intprops-internal.h
/inttypes.h
/inttypes.in.h
/isnan.c
/isnand.c
@ -83,9 +92,58 @@
/lc-charset-dispatch.c
/lc-charset-dispatch.h
/libc-config.h
/libdhcpd_pools.la
/libdhcpd_pools_la-arpa_inet.lo
/libdhcpd_pools_la-basename-lgpl.lo
/libdhcpd_pools_la-c32isprint.lo
/libdhcpd_pools_la-c-ctype.lo
/libdhcpd_pools_la-cloexec.lo
/libdhcpd_pools_la-closeout.lo
/libdhcpd_pools_la-close-stream.lo
/libdhcpd_pools_la-c-strcasecmp.lo
/libdhcpd_pools_la-exitfail.lo
/libdhcpd_pools_la-fclose.lo
/libdhcpd_pools_la-fcntl.lo
/libdhcpd_pools_la-fd-hook.lo
/libdhcpd_pools_la-fflush.lo
/libdhcpd_pools_la-float.lo
/libdhcpd_pools_la-fopen.lo
/libdhcpd_pools_la-fpurge.lo
/libdhcpd_pools_la-freading.lo
/libdhcpd_pools_la-fseek.lo
/libdhcpd_pools_la-fseeko.lo
/libdhcpd_pools_la-getprogname.lo
/libdhcpd_pools_la-hard-locale.lo
/libdhcpd_pools_la-ialloc.lo
/libdhcpd_pools_la-localcharset.lo
/libdhcpd_pools_la-malloca.lo
/libdhcpd_pools_la-math.lo
/libdhcpd_pools_la-mbrtoc32.lo
/libdhcpd_pools_la-mbrtowc.lo
/libdhcpd_pools_la-mbszero.lo
/libdhcpd_pools_la-mktime.lo
/libdhcpd_pools_la-nstrftime.lo
/libdhcpd_pools_la-progname.lo
/libdhcpd_pools_la-quotearg.lo
/libdhcpd_pools_la-reallocarray.lo
/libdhcpd_pools_la-realloc.lo
/libdhcpd_pools_la-setlocale_null.lo
/libdhcpd_pools_la-setlocale_null-unlocked.lo
/libdhcpd_pools_la-stat-time.lo
/libdhcpd_pools_la-stdlib.lo
/libdhcpd_pools_la-sys_socket.lo
/libdhcpd_pools_la-timegm.lo
/libdhcpd_pools_la-time_rz.lo
/libdhcpd_pools_la-unistd.lo
/libdhcpd_pools_la-wctype-h.lo
/libdhcpd_pools_la-xalloc-die.lo
/libdhcpd_pools_la-xmalloc.lo
/.libs/
/limits.h
/limits.in.h
/localcharset.c
/localcharset.h
/locale.h
/locale.in.h
/localename.h
/localename-unsafe.c
@ -95,6 +153,7 @@
/malloca.h
/malloc.c
/math.c
/math.h
/math.in.h
/mbrtoc32.c
/mbrtowc.c
@ -135,13 +194,18 @@
/stat-time.h
/stat-w32.c
/stat-w32.h
/stdckdint.h
/stdckdint.in.h
/stddef.h
/stddef.in.h
/stdint.in.h
/stdio.h
/stdio-impl.h
/stdio.in.h
/stdio-read.c
/stdio-write.c
/stdlib.c
/stdlib.h
/stdlib.in.h
/stpncpy.c
/strdup.c
@ -151,34 +215,44 @@
/strerror-override.h
/strftime.c
/strftime.h
/string.h
/string.in.h
/strstr.c
/strtod.c
/str-two-way.h
/sys/
/sys_socket.c
/sys_socket.in.h
/sys_stat.in.h
/sys_types.in.h
/sys_uio.in.h
/timegm.c
/time.h
/time.in.h
/time-internal.h
/time_r.c
/time_rz.c
/tzset.c
/uchar.h
/uchar.in.h
/unictype/
/unictype/bitmap.h
/unictype/ctype_print.c
/unictype/ctype_print.h
/unictype/.gitignore
/unictype.h
/unictype.in.h
/unistd.c
/unistd.h
/unistd.in.h
/unitypes.h
/unitypes.in.h
/unsetenv.c
/verify.h
/warn-on-use.h
/wchar.h
/wchar.in.h
/wctype.h
/wctype-h.c
/wctype.in.h
/windows-initguard.h