2007-01-03 22:20:44 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#
|
|
|
|
# Helps generate autoconf/automake stuff, when code is checked out from SCM.
|
|
|
|
#
|
2011-01-05 12:49:05 +01:00
|
|
|
# Copyright (C) 2006-2010 - Karel Zak <kzak@redhat.com>
|
2007-01-03 22:20:44 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
srcdir=`dirname $0`
|
2009-02-13 10:54:24 +01:00
|
|
|
test -z "$srcdir" && srcdir=.
|
2007-01-03 22:20:44 +01:00
|
|
|
|
|
|
|
THEDIR=`pwd`
|
|
|
|
cd $srcdir
|
|
|
|
DIE=0
|
|
|
|
|
2014-06-10 18:44:08 +02:00
|
|
|
# provide simple gettext backward compatibility
|
2014-06-10 12:08:51 +02:00
|
|
|
autopoint_fun ()
|
|
|
|
{
|
|
|
|
# we have to deal with set -e ...
|
|
|
|
ret="0"
|
|
|
|
|
2014-06-10 18:44:08 +02:00
|
|
|
# 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'`
|
2014-06-10 12:08:51 +02:00
|
|
|
|
2014-06-10 18:44:08 +02:00
|
|
|
if [ -n "$gt_ver" ]; then
|
|
|
|
echo "warning, force autopoint to use old gettext $gt_ver"
|
|
|
|
rm -f configure.ac.autogenbak
|
2014-06-10 12:08:51 +02:00
|
|
|
sed -i.autogenbak configure.ac \
|
2014-06-10 18:44:08 +02:00
|
|
|
-e "s/\(AM_GNU_GETTEXT_VERSION\).*/\1([$gt_ver])/"
|
2014-06-10 12:08:51 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
autopoint "$@" || ret=$?
|
|
|
|
|
2014-06-10 18:44:08 +02:00
|
|
|
if [ -n "$gt_ver" ]; then
|
2014-06-10 12:08:51 +02:00
|
|
|
mv configure.ac.autogenbak configure.ac
|
|
|
|
fi
|
|
|
|
|
|
|
|
return $ret
|
|
|
|
}
|
|
|
|
|
2012-05-30 17:16:11 +02:00
|
|
|
test -f sys-utils/mount.c || {
|
2011-01-05 12:49:05 +01:00
|
|
|
echo
|
|
|
|
echo "You must run this script in the top-level util-linux directory"
|
|
|
|
echo
|
|
|
|
DIE=1
|
|
|
|
}
|
|
|
|
|
2007-01-03 22:20:44 +01:00
|
|
|
(autopoint --version) < /dev/null > /dev/null 2>&1 || {
|
|
|
|
echo
|
2011-01-05 12:49:05 +01:00
|
|
|
echo "You must have autopoint installed to generate util-linux build system."
|
|
|
|
echo "The autopoint command is part of the GNU gettext package."
|
|
|
|
echo
|
2007-01-03 22:20:44 +01:00
|
|
|
DIE=1
|
|
|
|
}
|
|
|
|
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
|
|
|
|
echo
|
2010-11-30 11:41:59 +01:00
|
|
|
echo "You must have autoconf installed to generate util-linux build system."
|
2007-01-03 22:20:44 +01:00
|
|
|
echo
|
|
|
|
DIE=1
|
|
|
|
}
|
2011-01-05 12:49:05 +01:00
|
|
|
(autoheader --version) < /dev/null > /dev/null 2>&1 || {
|
|
|
|
echo
|
|
|
|
echo "You must have autoheader installed to generate util-linux build system."
|
|
|
|
echo "The autoheader command is part of the GNU autoconf package."
|
|
|
|
echo
|
|
|
|
DIE=1
|
|
|
|
}
|
2011-01-05 13:17:12 +01:00
|
|
|
(libtool --version) < /dev/null > /dev/null 2>&1 || {
|
|
|
|
echo
|
|
|
|
echo "You must have libtool-2 installed to generate util-linux build system."
|
|
|
|
echo
|
|
|
|
DIE=1
|
|
|
|
}
|
2007-01-03 22:20:44 +01:00
|
|
|
(automake --version) < /dev/null > /dev/null 2>&1 || {
|
|
|
|
echo
|
2010-11-30 11:41:59 +01:00
|
|
|
echo "You must have automake installed to generate util-linux build system."
|
2007-01-03 22:20:44 +01:00
|
|
|
echo
|
|
|
|
DIE=1
|
|
|
|
}
|
|
|
|
|
2011-01-05 13:17:12 +01:00
|
|
|
ltver=$(libtoolize --version | awk '/^libtoolize/ { print $4 }')
|
2011-10-01 13:18:17 +02:00
|
|
|
ltver=${ltver:-"none"}
|
2011-01-26 20:01:33 +01:00
|
|
|
test ${ltver##2.} = "$ltver" && {
|
2011-01-05 13:17:12 +01:00
|
|
|
echo "You must have libtool version >= 2.x.x, but you have $ltver."
|
|
|
|
DIE=1
|
|
|
|
}
|
2009-02-13 10:54:24 +01:00
|
|
|
|
2011-01-05 12:49:05 +01:00
|
|
|
if test "$DIE" -eq 1; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2007-09-02 13:43:31 +02:00
|
|
|
echo
|
|
|
|
echo "Generate build-system by:"
|
|
|
|
echo " autopoint: $(autopoint --version | head -1)"
|
|
|
|
echo " aclocal: $(aclocal --version | head -1)"
|
|
|
|
echo " autoconf: $(autoconf --version | head -1)"
|
|
|
|
echo " autoheader: $(autoheader --version | head -1)"
|
|
|
|
echo " automake: $(automake --version | head -1)"
|
2011-01-05 13:17:12 +01:00
|
|
|
echo " libtoolize: $(libtoolize --version | head -1)"
|
2007-09-02 13:43:31 +02:00
|
|
|
|
2011-03-31 22:10:07 +02:00
|
|
|
rm -rf autom4te.cache
|
|
|
|
|
2007-04-10 16:54:22 +02:00
|
|
|
set -e
|
2010-12-29 20:51:58 +01:00
|
|
|
po/update-potfiles
|
2014-06-10 12:08:51 +02:00
|
|
|
autopoint_fun --force $AP_OPTS
|
2011-03-15 21:58:07 +01:00
|
|
|
if ! grep -q datarootdir po/Makefile.in.in; then
|
|
|
|
echo autopoint does not honor dataroot variable, patching.
|
|
|
|
sed -i -e 's/^datadir *=\(.*\)/datarootdir = @datarootdir@\
|
|
|
|
datadir = @datadir@/g' po/Makefile.in.in
|
|
|
|
fi
|
2011-01-05 13:17:12 +01:00
|
|
|
libtoolize --force $LT_OPTS
|
2007-07-25 18:45:01 +02:00
|
|
|
aclocal -I m4 $AL_OPTS
|
|
|
|
autoconf $AC_OPTS
|
|
|
|
autoheader $AH_OPTS
|
2009-09-16 21:25:38 +02:00
|
|
|
|
2007-07-25 18:45:01 +02:00
|
|
|
automake --add-missing $AM_OPTS
|
2007-01-03 22:20:44 +01:00
|
|
|
|
|
|
|
cd $THEDIR
|
|
|
|
|
2007-09-02 13:43:31 +02:00
|
|
|
echo
|
2007-05-07 20:06:39 +02:00
|
|
|
echo "Now type '$srcdir/configure' and 'make' to compile."
|
2007-09-02 13:43:31 +02:00
|
|
|
echo
|
2007-01-03 22:20:44 +01:00
|
|
|
|
|
|
|
|