summaryrefslogtreecommitdiffstats
path: root/autogen.sh
diff options
context:
space:
mode:
authorRuediger Meier2014-06-10 18:44:08 +0200
committerRuediger Meier2014-06-10 20:20:35 +0200
commitf8d75a6647830b496d6ff4697925204cb4d420d9 (patch)
tree1d60a1d474302d59577a711f9320a50c244fbf88 /autogen.sh
parentbuild-sys: use gettext 0.18.3 if possible (diff)
downloadkernel-qcow2-util-linux-f8d75a6647830b496d6ff4697925204cb4d420d9.tar.gz
kernel-qcow2-util-linux-f8d75a6647830b496d6ff4697925204cb4d420d9.tar.xz
kernel-qcow2-util-linux-f8d75a6647830b496d6ff4697925204cb4d420d9.zip
build-sys: fix autopoint gettext version fun
We avoid or fix many portability issues. The first more generic "sort --version-sort" solution was almost useless anyway because autopoint itself can also only deal with a few hardcoded versions. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh21
1 files changed, 9 insertions, 12 deletions
diff --git a/autogen.sh b/autogen.sh
index 7bbcc75ec..d1a686c16 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -13,28 +13,26 @@ THEDIR=`pwd`
cd $srcdir
DIE=0
+# provide simple gettext backward compatibility
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)
+ # check against this hardcoded set of alternative gettext versions
+ gt_ver=`gettext --version |\
+ sed -n -e 's/.* \(0\.18\|0\.18\.[1-2]\)$/\1/p'`
- if [ "$tmp" != "$GT_VER_DEF" ]; then
- echo "warning, force autopoint to use old gettext $tmp"
+ if [ -n "$gt_ver" ]; then
+ echo "warning, force autopoint to use old gettext $gt_ver"
+ rm -f configure.ac.autogenbak
sed -i.autogenbak configure.ac \
- -e "s/\(AM_GNU_GETTEXT_VERSION\).*/\1([$tmp])/"
+ -e "s/\(AM_GNU_GETTEXT_VERSION\).*/\1([$gt_ver])/"
fi
autopoint "$@" || ret=$?
- ret=$?
- if [ "$tmp" != "$GT_VER_DEF" ]; then
+ if [ -n "$gt_ver" ]; then
mv configure.ac.autogenbak configure.ac
fi
@@ -94,7 +92,6 @@ 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)"