mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 01:15:19 +00:00
build: update to latest gnulib
Gnulib finally relaxed the isatty license, needed as first mentioned here: https://www.redhat.com/archives/libvir-list/2012-February/msg01022.html Other improvements include better syntax-check rules (we can delete one of ours now that it is a duplicate) and better compiler warning usage. * .gnulib: Update to latest, for isatty. * cfg.mk (sc_prohibit_strncpy): Drop a now-redundant rule. * bootstrap.conf (gnulib_modules): Add isatty. * bootstrap: Resync from gnulib. (cherry picked from commit e925ea3156f2cc8d57a29eeeb839202adc989391)
This commit is contained in:
parent
89a3feb8b6
commit
d66fa967b3
2
.gnulib
2
.gnulib
@ -1 +1 @@
|
|||||||
Subproject commit bb2f5640d5379c5b4eec2d62341413bbab1aa308
|
Subproject commit 77cef2022004c4066e805da09a83b2c77f17bdd3
|
151
bootstrap
151
bootstrap
@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Print a version string.
|
# Print a version string.
|
||||||
scriptversion=2012-04-25.17; # UTC
|
scriptversion=2012-05-15.06; # UTC
|
||||||
|
|
||||||
# Bootstrap this package from checked-out sources.
|
# Bootstrap this package from checked-out sources.
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ extract_package_name='
|
|||||||
p
|
p
|
||||||
}
|
}
|
||||||
'
|
'
|
||||||
package=`sed -n "$extract_package_name" configure.ac` || exit
|
package=$(sed -n "$extract_package_name" configure.ac) || exit
|
||||||
gnulib_name=lib$package
|
gnulib_name=lib$package
|
||||||
|
|
||||||
build_aux=build-aux
|
build_aux=build-aux
|
||||||
@ -256,7 +256,7 @@ do
|
|||||||
usage
|
usage
|
||||||
exit;;
|
exit;;
|
||||||
--gnulib-srcdir=*)
|
--gnulib-srcdir=*)
|
||||||
GNULIB_SRCDIR=`expr "X$option" : 'X--gnulib-srcdir=\(.*\)'`;;
|
GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
|
||||||
--skip-po)
|
--skip-po)
|
||||||
SKIP_PO=t;;
|
SKIP_PO=t;;
|
||||||
--force)
|
--force)
|
||||||
@ -307,7 +307,7 @@ insert_sorted_if_absent() {
|
|||||||
file=$1
|
file=$1
|
||||||
str=$2
|
str=$2
|
||||||
test -f $file || touch $file
|
test -f $file || touch $file
|
||||||
echo "$str" | sort_patterns - $file | cmp - $file > /dev/null \
|
echo "$str" | sort_patterns - $file | cmp -s - $file > /dev/null \
|
||||||
|| { echo "$str" | sort_patterns - $file > $file.bak \
|
|| { echo "$str" | sort_patterns - $file > $file.bak \
|
||||||
&& mv $file.bak $file; } \
|
&& mv $file.bak $file; } \
|
||||||
|| exit 1
|
|| exit 1
|
||||||
@ -323,7 +323,7 @@ insert_vc_ignore() {
|
|||||||
# A .gitignore entry that does not start with '/' applies
|
# A .gitignore entry that does not start with '/' applies
|
||||||
# recursively to subdirectories, so prepend '/' to every
|
# recursively to subdirectories, so prepend '/' to every
|
||||||
# .gitignore entry.
|
# .gitignore entry.
|
||||||
pattern=`echo "$pattern" | sed s,^,/,`;;
|
pattern=$(echo "$pattern" | sed s,^,/,);;
|
||||||
esac
|
esac
|
||||||
insert_sorted_if_absent "$vc_ignore_file" "$pattern"
|
insert_sorted_if_absent "$vc_ignore_file" "$pattern"
|
||||||
}
|
}
|
||||||
@ -427,12 +427,28 @@ check_versions() {
|
|||||||
$use_git || continue
|
$use_git || continue
|
||||||
fi
|
fi
|
||||||
# Honor $APP variables ($TAR, $AUTOCONF, etc.)
|
# Honor $APP variables ($TAR, $AUTOCONF, etc.)
|
||||||
appvar=`echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_'`
|
appvar=$(echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_')
|
||||||
test "$appvar" = TAR && appvar=AMTAR
|
test "$appvar" = TAR && appvar=AMTAR
|
||||||
case $appvar in
|
case $appvar in
|
||||||
GZIP) ;; # Do not use $GZIP: it contains gzip options.
|
GZIP) ;; # Do not use $GZIP: it contains gzip options.
|
||||||
*) eval "app=\${$appvar-$app}" ;;
|
*) eval "app=\${$appvar-$app}" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Handle the still-experimental Automake-NG programs specially.
|
||||||
|
# They remain named as the mainstream Automake programs ("automake",
|
||||||
|
# and "aclocal") to avoid gratuitous incompatibilities with
|
||||||
|
# pre-existing usages (by, say, autoreconf, or custom autogen.sh
|
||||||
|
# scripts), but correctly identify themselves (as being part of
|
||||||
|
# "GNU automake-ng") when asked their version.
|
||||||
|
case $app in
|
||||||
|
automake-ng|aclocal-ng)
|
||||||
|
app=${app%-ng}
|
||||||
|
($app --version | grep '(GNU automake-ng)') >/dev/null 2>&1 || {
|
||||||
|
echo "$me: Error: '$app' not found or not from Automake-NG" >&2
|
||||||
|
ret=1
|
||||||
|
continue
|
||||||
|
} ;;
|
||||||
|
esac
|
||||||
if [ "$req_ver" = "-" ]; then
|
if [ "$req_ver" = "-" ]; then
|
||||||
# Merely require app to exist; not all prereq apps are well-behaved
|
# Merely require app to exist; not all prereq apps are well-behaved
|
||||||
# so we have to rely on $? rather than get_version.
|
# so we have to rely on $? rather than get_version.
|
||||||
@ -496,10 +512,8 @@ esac
|
|||||||
|
|
||||||
# When we can deduce that gnulib-tool will require patch,
|
# When we can deduce that gnulib-tool will require patch,
|
||||||
# and when patch is not already listed as a prerequisite, add it, too.
|
# and when patch is not already listed as a prerequisite, add it, too.
|
||||||
if test ! -d "$local_gl_dir" \
|
if test -d "$local_gl_dir" \
|
||||||
|| find "$local_gl_dir" -name '*.diff' -exec false {} +; then
|
&& ! find "$local_gl_dir" -name '*.diff' -exec false {} +; then
|
||||||
:
|
|
||||||
else
|
|
||||||
case $buildreq in
|
case $buildreq in
|
||||||
*patch*) ;;
|
*patch*) ;;
|
||||||
*) buildreq="patch -
|
*) buildreq="patch -
|
||||||
@ -543,7 +557,7 @@ git_modules_config () {
|
|||||||
test -f .gitmodules && git config --file .gitmodules "$@"
|
test -f .gitmodules && git config --file .gitmodules "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
gnulib_path=`git_modules_config submodule.gnulib.path`
|
gnulib_path=$(git_modules_config submodule.gnulib.path)
|
||||||
test -z "$gnulib_path" && gnulib_path=gnulib
|
test -z "$gnulib_path" && gnulib_path=gnulib
|
||||||
|
|
||||||
# Get gnulib files.
|
# Get gnulib files.
|
||||||
@ -616,10 +630,10 @@ 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"`
|
cmd=$(printf "$po_download_command_format" "$domain" "$subdir")
|
||||||
eval "$cmd" && return
|
eval "$cmd" && return
|
||||||
# Fallback to HTTP.
|
# Fallback to HTTP.
|
||||||
cmd=`printf "$po_download_command_format2" "$subdir" "$domain"`
|
cmd=$(printf "$po_download_command_format2" "$subdir" "$domain")
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -642,7 +656,7 @@ update_po_files() {
|
|||||||
&& ls "$ref_po_dir"/*.po 2>/dev/null |
|
&& ls "$ref_po_dir"/*.po 2>/dev/null |
|
||||||
sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return
|
sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return
|
||||||
|
|
||||||
langs=`cd $ref_po_dir && echo *.po|sed 's/\.po//g'`
|
langs=$(cd $ref_po_dir && echo *.po | sed 's/\.po//g')
|
||||||
test "$langs" = '*' && langs=x
|
test "$langs" = '*' && langs=x
|
||||||
for po in $langs; do
|
for po in $langs; do
|
||||||
case $po in x) continue;; esac
|
case $po in x) continue;; esac
|
||||||
@ -679,18 +693,18 @@ symlink_to_dir()
|
|||||||
|
|
||||||
# If the destination directory doesn't exist, create it.
|
# If the destination directory doesn't exist, create it.
|
||||||
# This is required at least for "lib/uniwidth/cjk.h".
|
# This is required at least for "lib/uniwidth/cjk.h".
|
||||||
dst_dir=`dirname "$dst"`
|
dst_dir=$(dirname "$dst")
|
||||||
if ! test -d "$dst_dir"; then
|
if ! test -d "$dst_dir"; then
|
||||||
mkdir -p "$dst_dir"
|
mkdir -p "$dst_dir"
|
||||||
|
|
||||||
# If we've just created a directory like lib/uniwidth,
|
# If we've just created a directory like lib/uniwidth,
|
||||||
# tell version control system(s) it's ignorable.
|
# tell version control system(s) it's ignorable.
|
||||||
# FIXME: for now, this does only one level
|
# FIXME: for now, this does only one level
|
||||||
parent=`dirname "$dst_dir"`
|
parent=$(dirname "$dst_dir")
|
||||||
for dot_ig in x $vc_ignore; do
|
for dot_ig in x $vc_ignore; do
|
||||||
test $dot_ig = x && continue
|
test $dot_ig = x && continue
|
||||||
ig=$parent/$dot_ig
|
ig=$parent/$dot_ig
|
||||||
insert_vc_ignore $ig `echo "$dst_dir"|sed 's,.*/,,'`
|
insert_vc_ignore $ig "${dst_dir##*/}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -714,10 +728,10 @@ symlink_to_dir()
|
|||||||
# 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>.
|
# <http://lists.gnu.org/archive/html/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 &&
|
||||||
test "$src_i" = "$dst_i" &&
|
test "$src_i" = "$dst_i" &&
|
||||||
both_ls=`ls -dt "$src" "$dst"` &&
|
both_ls=$(ls -dt "$src" "$dst") &&
|
||||||
test "X$both_ls" = "X$dst$nl$src" || {
|
test "X$both_ls" = "X$dst$nl$src" || {
|
||||||
dot_dots=
|
dot_dots=
|
||||||
case $src in
|
case $src in
|
||||||
@ -740,6 +754,22 @@ symlink_to_dir()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
version_controlled_file() {
|
||||||
|
parent=$1
|
||||||
|
file=$2
|
||||||
|
if test -d .git; then
|
||||||
|
git rm -n "$file" > /dev/null 2>&1
|
||||||
|
elif test -d .svn; then
|
||||||
|
svn log -r HEAD "$file" > /dev/null 2>&1
|
||||||
|
elif test -d CVS; then
|
||||||
|
grep -F "/${file##*/}/" "$parent/CVS/Entries" 2>/dev/null |
|
||||||
|
grep '^/[^/]*/[0-9]' > /dev/null
|
||||||
|
else
|
||||||
|
echo "$me: no version control for $file?" >&2
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# NOTE: we have to be careful to run both autopoint and libtoolize
|
# NOTE: we have to be careful to run both autopoint and libtoolize
|
||||||
# before gnulib-tool, since gnulib-tool is likely to provide newer
|
# before gnulib-tool, since gnulib-tool is likely to provide newer
|
||||||
# versions of files "installed" by these two programs.
|
# versions of files "installed" by these two programs.
|
||||||
@ -752,43 +782,54 @@ with_gettext=yes
|
|||||||
grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
|
grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
|
||||||
with_gettext=no
|
with_gettext=no
|
||||||
|
|
||||||
if test $with_gettext = yes; then
|
if test $with_gettext = yes || test $use_libtool = 1; then
|
||||||
# Released autopoint has the tendency to install macros that have been
|
|
||||||
# obsoleted in current gnulib, so run this before gnulib-tool.
|
|
||||||
echo "$0: $AUTOPOINT --force"
|
|
||||||
$AUTOPOINT --force || exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Autoreconf runs aclocal before libtoolize, which causes spurious
|
tempbase=.bootstrap$$
|
||||||
# warnings if the initial aclocal is confused by the libtoolized
|
trap "rm -f $tempbase.0 $tempbase.1" 1 2 13 15
|
||||||
# (or worse out-of-date) macro directory.
|
|
||||||
# libtoolize 1.9b added the --install option; but we support back
|
|
||||||
# to libtoolize 1.5.22, where the install action was default.
|
|
||||||
if test $use_libtool = 1; then
|
|
||||||
install=
|
|
||||||
case $($LIBTOOLIZE --help) in
|
|
||||||
*--install*) install=--install ;;
|
|
||||||
esac
|
|
||||||
echo "running: $LIBTOOLIZE $install --copy"
|
|
||||||
$LIBTOOLIZE $install --copy
|
|
||||||
fi
|
|
||||||
|
|
||||||
version_controlled_file() {
|
> $tempbase.0 > $tempbase.1 &&
|
||||||
dir=$1
|
find . ! -type d -print | sort > $tempbase.0 || exit
|
||||||
file=$2
|
|
||||||
found=no
|
if test $with_gettext = yes; then
|
||||||
if test -d CVS; then
|
# Released autopoint has the tendency to install macros that have been
|
||||||
grep -F "/$file/" $dir/CVS/Entries 2>/dev/null |
|
# obsoleted in current gnulib, so run this before gnulib-tool.
|
||||||
grep '^/[^/]*/[0-9]' > /dev/null && found=yes
|
echo "$0: $AUTOPOINT --force"
|
||||||
elif test -d .git; then
|
$AUTOPOINT --force || exit
|
||||||
git rm -n "$dir/$file" > /dev/null 2>&1 && found=yes
|
|
||||||
elif test -d .svn; then
|
|
||||||
svn log -r HEAD "$dir/$file" > /dev/null 2>&1 && found=yes
|
|
||||||
else
|
|
||||||
echo "$me: no version control for $dir/$file?" >&2
|
|
||||||
fi
|
fi
|
||||||
test $found = yes
|
|
||||||
}
|
# Autoreconf runs aclocal before libtoolize, which causes spurious
|
||||||
|
# warnings if the initial aclocal is confused by the libtoolized
|
||||||
|
# (or worse out-of-date) macro directory.
|
||||||
|
# libtoolize 1.9b added the --install option; but we support back
|
||||||
|
# to libtoolize 1.5.22, where the install action was default.
|
||||||
|
if test $use_libtool = 1; then
|
||||||
|
install=
|
||||||
|
case $($LIBTOOLIZE --help) in
|
||||||
|
*--install*) install=--install ;;
|
||||||
|
esac
|
||||||
|
echo "running: $LIBTOOLIZE $install --copy"
|
||||||
|
$LIBTOOLIZE $install --copy
|
||||||
|
fi
|
||||||
|
|
||||||
|
find . ! -type d -print | sort >$tempbase.1
|
||||||
|
old_IFS=$IFS
|
||||||
|
IFS=$nl
|
||||||
|
for file in $(comm -13 $tempbase.0 $tempbase.1); do
|
||||||
|
IFS=$old_IFS
|
||||||
|
parent=${file%/*}
|
||||||
|
version_controlled_file "$parent" "$file" || {
|
||||||
|
for dot_ig in x $vc_ignore; do
|
||||||
|
test $dot_ig = x && continue
|
||||||
|
ig=$parent/$dot_ig
|
||||||
|
insert_vc_ignore "$ig" "${file##*/}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
done
|
||||||
|
IFS=$old_IFS
|
||||||
|
|
||||||
|
rm -f $tempbase.0 $tempbase.1
|
||||||
|
trap - 1 2 13 15
|
||||||
|
fi
|
||||||
|
|
||||||
# Import from gnulib.
|
# Import from gnulib.
|
||||||
|
|
||||||
@ -852,7 +893,7 @@ AUTOPOINT=true LIBTOOLIZE=true \
|
|||||||
for file in $gnulib_extra_files; do
|
for file in $gnulib_extra_files; do
|
||||||
case $file in
|
case $file in
|
||||||
*/INSTALL) dst=INSTALL;;
|
*/INSTALL) dst=INSTALL;;
|
||||||
build-aux/*) dst=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;;
|
build-aux/*) dst=$build_aux/${file#build-aux/};;
|
||||||
*) dst=$file;;
|
*) dst=$file;;
|
||||||
esac
|
esac
|
||||||
symlink_to_dir "$GNULIB_SRCDIR" $file $dst || exit
|
symlink_to_dir "$GNULIB_SRCDIR" $file $dst || exit
|
||||||
|
@ -60,6 +60,7 @@ ignore-value
|
|||||||
inet_pton
|
inet_pton
|
||||||
intprops
|
intprops
|
||||||
ioctl
|
ioctl
|
||||||
|
isatty
|
||||||
largefile
|
largefile
|
||||||
listen
|
listen
|
||||||
maintainer-makefile
|
maintainer-makefile
|
||||||
|
5
cfg.mk
5
cfg.mk
@ -372,11 +372,6 @@ sc_prohibit_sprintf:
|
|||||||
halt='use snprintf, not s'printf \
|
halt='use snprintf, not s'printf \
|
||||||
$(_sc_search_regexp)
|
$(_sc_search_regexp)
|
||||||
|
|
||||||
sc_prohibit_strncpy:
|
|
||||||
@prohibit='strncpy *\(' \
|
|
||||||
halt='use virStrncpy, not strncpy' \
|
|
||||||
$(_sc_search_regexp)
|
|
||||||
|
|
||||||
sc_prohibit_readlink:
|
sc_prohibit_readlink:
|
||||||
@prohibit='readlink *\(' \
|
@prohibit='readlink *\(' \
|
||||||
halt='use virFileResolveLink, not readlink' \
|
halt='use virFileResolveLink, not readlink' \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user