4 # Helps generate autoconf/automake stuff, when code is checked out from SCM.
6 # Copyright (C) 2006-2010 - Karel Zak <kzak@redhat.com>
10 test -z "$srcdir" && srcdir
=.
16 # provide simple gettext backward compatibility
19 # we have to deal with set -e ...
22 # check against this hardcoded set of alternative gettext versions
23 gt_ver
=`gettext --version |\
24 sed -n -e 's/.* \(0\.18\|0\.18\.[1-2]\)$/\1/p'`
26 if [ -n "$gt_ver" ]; then
27 echo "warning: forcing autopoint to use old gettext $gt_ver"
28 rm -f configure.ac.autogenbak
29 sed -i.autogenbak configure.ac \
30 -e "s/\(AM_GNU_GETTEXT_VERSION\).*/\1([$gt_ver])/"
33 autopoint
"$@" || ret
=$?
35 if [ -n "$gt_ver" ]; then
36 mv configure.ac.autogenbak configure.ac
42 test -f sys-utils
/mount.c ||
{
44 echo "You must run this script in the top-level util-linux directory."
49 (autopoint
--version) < /dev
/null
> /dev
/null
2>&1 ||
{
51 echo "You must have autopoint installed to generate the util-linux build system."
52 echo "The autopoint command is part of the GNU gettext package."
56 (autoconf
--version) < /dev
/null
> /dev
/null
2>&1 ||
{
58 echo "You must have autoconf installed to generate the util-linux build system."
62 (autoheader
--version) < /dev
/null
> /dev
/null
2>&1 ||
{
64 echo "You must have autoheader installed to generate the util-linux build system."
65 echo "The autoheader command is part of the GNU autoconf package."
69 (libtoolize
--version) < /dev
/null
> /dev
/null
2>&1 ||
{
71 echo "You must have libtool-2 installed to generate the util-linux build system."
75 (automake
--version) < /dev
/null
> /dev
/null
2>&1 ||
{
77 echo "You must have automake installed to generate the util-linux build system."
82 ltver
=$
(libtoolize
--version |
awk '/^libtoolize/ { print $4 }')
83 ltver
=${ltver:-"none"}
84 test ${ltver##2.} = "$ltver" && {
85 echo "You must have libtool version >= 2.x.x, but you have $ltver."
89 if test "$DIE" -eq 1; then
94 echo "Generating build-system with:"
95 echo " autopoint: $(autopoint --version | head -1)"
96 echo " aclocal: $(aclocal --version | head -1)"
97 echo " autoconf: $(autoconf --version | head -1)"
98 echo " autoheader: $(autoheader --version | head -1)"
99 echo " automake: $(automake --version | head -1)"
100 echo " libtoolize: $(libtoolize --version | head -1)"
102 rm -rf autom4te.cache
106 autopoint_fun
--force $AP_OPTS
107 if ! grep -q datarootdir po
/Makefile.
in.
in; then
108 echo autopoint does not honor dataroot variable
, patching.
109 sed -i -e 's/^datadir *=\(.*\)/datarootdir = @datarootdir@\
110 datadir = @datadir@/g' po
/Makefile.
in.
in
112 libtoolize
--force $LT_OPTS
113 aclocal
-I m4 $AL_OPTS
117 automake
--add-missing $AM_OPTS
122 echo "Now type '$srcdir/configure' and 'make' to compile."