summaryrefslogtreecommitdiffstats
path: root/autogen.sh
diff options
context:
space:
mode:
authorRuediger Meier2014-06-10 12:08:51 +0200
committerKarel Zak2014-06-10 13:41:11 +0200
commit91c520bc9b90dea6d93d41b1437ae25ec948e639 (patch)
tree18c79f77c7fc9d362fb124ed17ec7ba6f59ccbbd /autogen.sh
parentlibblkid: cleanup internal return codes (diff)
downloadkernel-qcow2-util-linux-91c520bc9b90dea6d93d41b1437ae25ec948e639.tar.gz
kernel-qcow2-util-linux-91c520bc9b90dea6d93d41b1437ae25ec948e639.tar.xz
kernel-qcow2-util-linux-91c520bc9b90dea6d93d41b1437ae25ec948e639.zip
build-sys: use gettext 0.18.3 if possible
We add a little hack for backward compatibility on systems with older gettext installed See 0576dbd3 and 81ed13ed. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh31
1 files changed, 30 insertions, 1 deletions
diff --git a/autogen.sh b/autogen.sh
index 48e26add6..7bbcc75ec 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -13,6 +13,34 @@ THEDIR=`pwd`
cd $srcdir
DIE=0
+autopoint_fun ()
+{
+ # we have to deal with set -e ...
+ rm -f configure.ac.autogenbak
+ ret="0"
+ GT_VER_MIN="0.18"
+ GT_VER_DEF=$(sed -n 's/AM_GNU_GETTEXT_VERSION(\[\(.*\)\])/\1/p' configure.ac)
+ GT_VER_HAVE="$(gettext --version | head -n 1 | sed 's/.* //g')"
+
+ tmp=$(echo -e "$GT_VER_MIN\n$GT_VER_HAVE" | sort -V | tail -n1)
+ tmp=$(echo -e "$GT_VER_DEF\n$tmp" | sort -V | head -n1)
+
+ if [ "$tmp" != "$GT_VER_DEF" ]; then
+ echo "warning, force autopoint to use old gettext $tmp"
+ sed -i.autogenbak configure.ac \
+ -e "s/\(AM_GNU_GETTEXT_VERSION\).*/\1([$tmp])/"
+ fi
+
+ autopoint "$@" || ret=$?
+ ret=$?
+
+ if [ "$tmp" != "$GT_VER_DEF" ]; then
+ mv configure.ac.autogenbak configure.ac
+ fi
+
+ return $ret
+}
+
test -f sys-utils/mount.c || {
echo
echo "You must run this script in the top-level util-linux directory"
@@ -66,6 +94,7 @@ fi
echo
echo "Generate build-system by:"
+
echo " autopoint: $(autopoint --version | head -1)"
echo " aclocal: $(aclocal --version | head -1)"
echo " autoconf: $(autoconf --version | head -1)"
@@ -77,7 +106,7 @@ rm -rf autom4te.cache
set -e
po/update-potfiles
-autopoint --force $AP_OPTS
+autopoint_fun --force $AP_OPTS
if ! grep -q datarootdir po/Makefile.in.in; then
echo autopoint does not honor dataroot variable, patching.
sed -i -e 's/^datadir *=\(.*\)/datarootdir = @datarootdir@\