]>
Commit | Line | Data |
---|---|---|
8eeb575c KZ |
1 | #!/bin/sh |
2 | ||
3 | # | |
4 | # Helps generate autoconf/automake stuff, when code is checked out from SCM. | |
5 | # | |
93e0319d | 6 | # Copyright (C) 2006-2010 - Karel Zak <kzak@redhat.com> |
8eeb575c KZ |
7 | # |
8 | ||
9 | srcdir=`dirname $0` | |
b12991dd | 10 | test -z "$srcdir" && srcdir=. |
8eeb575c KZ |
11 | |
12 | THEDIR=`pwd` | |
13 | cd $srcdir | |
14 | DIE=0 | |
15 | ||
d2feb47f | 16 | test -f sys-utils/mount.c || { |
93e0319d KZ |
17 | echo |
18 | echo "You must run this script in the top-level util-linux directory" | |
19 | echo | |
20 | DIE=1 | |
21 | } | |
22 | ||
8eeb575c KZ |
23 | (autopoint --version) < /dev/null > /dev/null 2>&1 || { |
24 | echo | |
93e0319d KZ |
25 | echo "You must have autopoint installed to generate util-linux build system." |
26 | echo "The autopoint command is part of the GNU gettext package." | |
27 | echo | |
8eeb575c KZ |
28 | DIE=1 |
29 | } | |
30 | (autoconf --version) < /dev/null > /dev/null 2>&1 || { | |
31 | echo | |
601d12fb | 32 | echo "You must have autoconf installed to generate util-linux build system." |
8eeb575c | 33 | echo |
8eeb575c KZ |
34 | DIE=1 |
35 | } | |
93e0319d KZ |
36 | (autoheader --version) < /dev/null > /dev/null 2>&1 || { |
37 | echo | |
38 | echo "You must have autoheader installed to generate util-linux build system." | |
39 | echo "The autoheader command is part of the GNU autoconf package." | |
40 | echo | |
41 | DIE=1 | |
42 | } | |
4b2ede3e KZ |
43 | (libtool --version) < /dev/null > /dev/null 2>&1 || { |
44 | echo | |
45 | echo "You must have libtool-2 installed to generate util-linux build system." | |
46 | echo | |
47 | DIE=1 | |
48 | } | |
8eeb575c KZ |
49 | (automake --version) < /dev/null > /dev/null 2>&1 || { |
50 | echo | |
601d12fb | 51 | echo "You must have automake installed to generate util-linux build system." |
8eeb575c | 52 | echo |
8eeb575c KZ |
53 | DIE=1 |
54 | } | |
8eeb575c | 55 | |
4b2ede3e | 56 | ltver=$(libtoolize --version | awk '/^libtoolize/ { print $4 }') |
13ba1df8 | 57 | ltver=${ltver:-"none"} |
aada54e0 | 58 | test ${ltver##2.} = "$ltver" && { |
4b2ede3e KZ |
59 | echo "You must have libtool version >= 2.x.x, but you have $ltver." |
60 | DIE=1 | |
61 | } | |
b12991dd | 62 | |
93e0319d KZ |
63 | if test "$DIE" -eq 1; then |
64 | exit 1 | |
65 | fi | |
66 | ||
952a06cf KZ |
67 | echo |
68 | echo "Generate build-system by:" | |
69 | echo " autopoint: $(autopoint --version | head -1)" | |
70 | echo " aclocal: $(aclocal --version | head -1)" | |
71 | echo " autoconf: $(autoconf --version | head -1)" | |
72 | echo " autoheader: $(autoheader --version | head -1)" | |
73 | echo " automake: $(automake --version | head -1)" | |
4b2ede3e | 74 | echo " libtoolize: $(libtoolize --version | head -1)" |
952a06cf | 75 | |
38c75b59 SK |
76 | rm -rf autom4te.cache |
77 | ||
f2c166ff | 78 | set -e |
7c2ee1d2 | 79 | po/update-potfiles |
1eca726f | 80 | autopoint --force $AP_OPTS |
cc3c3fdd SK |
81 | if ! grep -q datarootdir po/Makefile.in.in; then |
82 | echo autopoint does not honor dataroot variable, patching. | |
83 | sed -i -e 's/^datadir *=\(.*\)/datarootdir = @datarootdir@\ | |
84 | datadir = @datadir@/g' po/Makefile.in.in | |
85 | fi | |
4b2ede3e | 86 | libtoolize --force $LT_OPTS |
1eca726f KZ |
87 | aclocal -I m4 $AL_OPTS |
88 | autoconf $AC_OPTS | |
89 | autoheader $AH_OPTS | |
1e018c15 | 90 | |
1eca726f | 91 | automake --add-missing $AM_OPTS |
8eeb575c KZ |
92 | |
93 | cd $THEDIR | |
94 | ||
952a06cf | 95 | echo |
e1bc6da9 | 96 | echo "Now type '$srcdir/configure' and 'make' to compile." |
952a06cf | 97 | echo |
8eeb575c KZ |
98 | |
99 |