]> granicus.if.org Git - procps-ng/blob - autogen.sh
top: avoid '%Cpu' distortion resulting from keystrokes
[procps-ng] / 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 autogen.sh || {
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 (automake --version) < /dev/null > /dev/null || {
34         echo "You must have automake installed to generate procps-ng build system."
35         DIE=1
36 }
37
38 LTVER=$(libtoolize --version | awk '/^libtoolize/ { print $4 }')
39 LTVER=${LTVER:-"none"}
40 test ${LTVER##2.} = "${LTVER}" && {
41         echo "You must have libtoolize version >= 2.x.x, but you have ${LTVER}."
42         DIE=1
43 }
44
45 if test ${DIE} -ne 0; then
46         exit 1
47 fi
48
49 echo "Generate build-system by:"
50 echo "   autopoint:  $(autopoint --version | head -1)"
51 echo "   aclocal:    $(aclocal --version | head -1)"
52 echo "   autoconf:   $(autoconf --version | head -1)"
53 echo "   autoheader: $(autoheader --version | head -1)"
54 echo "   automake:   $(automake --version | head -1)"
55 echo "   libtoolize: $(libtoolize --version | head -1)"
56
57 rm -rf autom4te.cache
58
59 set -e
60 po/update-potfiles
61 autopoint --force $AP_OPTS
62 if ! grep -q datarootdir po/Makefile.in.in; then
63         echo autopoint does not honor dataroot variable, patching.
64         sed -i -e 's/^datadir *=\(.*\)/datarootdir = @datarootdir@\
65 datadir = @datadir@/g' po/Makefile.in.in
66 fi
67 libtoolize --force ${LT_OPTS}
68 aclocal -I m4 ${AL_OPTS}
69 autoconf ${AC_OPTS}
70 autoheader ${AH_OPTS}
71
72 automake --add-missing ${AM_OPTS}
73
74 echo
75 echo "Now type '${SRCDIR}/configure' and 'make' to compile."