Bump to procps-ng 3.3.16
[platform/upstream/procps-ng.git] / autogen.sh
1 #!/bin/sh
2 #
3 # Helps generate autoconf/automake stuff, when code is checked
4 # out from SCM.
5
6 SRCDIR=$(dirname ${0})
7 test -z "${SRCDIR}" && SRCDIR=.
8
9 THEDIR=$(pwd)
10 cd ${SRCDIR}
11 DIE=0
12
13 test -f free.c || {
14         echo "You must run this script in the top-level procps-ng directory"
15         DIE=1
16 }
17
18 (autopoint --version) < /dev/null > /dev/null 2>&1 || {
19         echo "You must have autopoint installed to generate procps-ng build system."
20         echo "The autopoint command is part of the GNU gettext package."
21         DIE=1
22 }
23
24 (autoconf --version) < /dev/null > /dev/null || {
25         echo "You must have autoconf installed to generate procps-ng build system."
26         DIE=1
27 }
28 (autoheader --version) < /dev/null > /dev/null || {
29         echo "You must have autoheader installed to generate procps-ng build system."
30         echo "The autoheader command is part of the GNU autoconf package."
31         DIE=1
32 }
33 (libtool --version) < /dev/null > /dev/null || {
34         echo "You must have libtool-2 installed to generate procps-ng build system."
35         DIE=1
36 }
37 (automake --version) < /dev/null > /dev/null || {
38         echo "You must have automake installed to generate procps-ng build system."
39         DIE=1
40 }
41
42 LTVER=$(libtoolize --version | awk '/^libtoolize/ { print $4 }')
43 LTVER=${LTVER:-"none"}
44 test ${LTVER##2.} = "${LTVER}" && {
45         echo "You must have libtoolize version >= 2.x.x, but you have ${LTVER}."
46         DIE=1
47 }
48
49 if test ${DIE} -ne 0; then
50         exit 1
51 fi
52
53 echo "Generate build-system by:"
54 echo "   autopoint:  $(autopoint --version | head -1)"
55 echo "   aclocal:    $(aclocal --version | head -1)"
56 echo "   autoconf:   $(autoconf --version | head -1)"
57 echo "   autoheader: $(autoheader --version | head -1)"
58 echo "   automake:   $(automake --version | head -1)"
59 echo "   libtoolize: $(libtoolize --version | head -1)"
60
61 rm -rf autom4te.cache
62
63 set -e
64 po/update-potfiles
65 autopoint --force $AP_OPTS
66 if ! grep -q datarootdir po/Makefile.in.in; then
67         echo autopoint does not honor dataroot variable, patching.
68         sed -i -e 's/^datadir *=\(.*\)/datarootdir = @datarootdir@\
69 datadir = @datadir@/g' po/Makefile.in.in
70 fi
71 libtoolize --force ${LT_OPTS}
72 aclocal -I m4 ${AL_OPTS}
73 autoconf ${AC_OPTS}
74 autoheader ${AH_OPTS}
75
76 automake --add-missing ${AM_OPTS}
77
78 echo
79 echo "Now type '${SRCDIR}/configure' and 'make' to compile."