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