autogen.sh 2.16 KB
Newer Older
1 2 3 4 5
#!/bin/sh
#
# Helps generate autoconf/automake stuff, when code is checked
# out from SCM.

6 7
SRCDIR=$(dirname ${0})
test -z "${SRCDIR}" && SRCDIR=.
8

9 10
THEDIR=$(pwd)
cd ${SRCDIR}
11 12
DIE=0

13
test -f free.c || {
14
	echo "You must run this script in the top-level procps-ng directory"
15 16 17
	DIE=1
}

18
(autopoint --version) < /dev/null > /dev/null 2>&1 || {
19
	echo "You must have autopoint installed to generate procps-ng build system."
20 21 22 23
	echo "The autopoint command is part of the GNU gettext package."
	DIE=1
}

24
(autoconf --version) < /dev/null > /dev/null || {
25
	echo "You must have autoconf installed to generate procps-ng build system."
26 27
	DIE=1
}
28
(autoheader --version) < /dev/null > /dev/null || {
29
	echo "You must have autoheader installed to generate procps-ng build system."
30 31 32
	echo "The autoheader command is part of the GNU autoconf package."
	DIE=1
}
33
(libtool --version) < /dev/null > /dev/null || {
34
	echo "You must have libtool-2 installed to generate procps-ng build system."
35 36
	DIE=1
}
37
(automake --version) < /dev/null > /dev/null || {
38
	echo "You must have automake installed to generate procps-ng build system."
39 40 41
	DIE=1
}

42 43 44 45
LTVER=$(libtoolize --version | awk '/^libtoolize/ { print $4 }')
LTVER=${LTVER:-"none"}
test ${LTVER##2.} = "${LTVER}" && {
	echo "You must have libtoolize version >= 2.x.x, but you have ${LTVER}."
46 47 48
	DIE=1
}

49
if test ${DIE} -ne 0; then
50 51 52 53
	exit 1
fi

echo "Generate build-system by:"
54
echo "   autopoint:  $(autopoint --version | head -1)"
55 56 57 58 59 60 61 62 63
echo "   aclocal:    $(aclocal --version | head -1)"
echo "   autoconf:   $(autoconf --version | head -1)"
echo "   autoheader: $(autoheader --version | head -1)"
echo "   automake:   $(automake --version | head -1)"
echo "   libtoolize: $(libtoolize --version | head -1)"

rm -rf autom4te.cache

set -e
Sami Kerola's avatar
Sami Kerola committed
64 65 66 67 68 69 70
po/update-potfiles
autopoint --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@\
datadir = @datadir@/g' po/Makefile.in.in
fi
71 72 73 74
libtoolize --force ${LT_OPTS}
aclocal -I m4 ${AL_OPTS}
autoconf ${AC_OPTS}
autoheader ${AH_OPTS}
75

76
automake --add-missing ${AM_OPTS}
77 78

echo
79
echo "Now type '${SRCDIR}/configure' and 'make' to compile."