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