All files that autotools will generate are removed.
[debian/dhcpd-pools.git] / autogen.sh
1 #!/bin/sh
2
3 #
4 # Helps generate autoconf/automake stuff, when code is checked
5 # out from SCM.
6 #
7 # The script is copied from util-linux package.
8 #
9
10 srcdir=`dirname $0`
11 test -z "$srcdir" && srcdir=.
12
13 THEDIR=`pwd`
14 cd $srcdir
15 DIE=0
16 HAS_GTKDOC=1
17
18 test -f src/dhcpd-pools.c || {
19         echo
20         echo "You must run this script in the top-level util-linux directory"
21         echo
22         DIE=1
23 }
24
25 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
26         echo
27         echo "You must have autoconf installed to generate util-linux build system."
28         echo
29         DIE=1
30 }
31 (autoheader --version) < /dev/null > /dev/null 2>&1 || {
32         echo
33         echo "You must have autoheader installed to generate util-linux build system."
34         echo "The autoheader command is part of the GNU autoconf package."
35         echo
36         DIE=1
37 }
38 (libtool --version) < /dev/null > /dev/null 2>&1 || {
39         echo
40         echo "You must have libtool-2 installed to generate util-linux build system."
41         echo
42         DIE=1
43 }
44 (automake --version) < /dev/null > /dev/null 2>&1 || {
45         echo
46         echo "You must have automake installed to generate util-linux build system."
47         echo 
48         DIE=1
49 }
50
51 ltver=$(libtoolize --version | awk '/^libtoolize/ { print $4 }')
52 test ${ltver##2.} == "$ltver" && {
53         echo "You must have libtool version >= 2.x.x, but you have $ltver."
54         DIE=1
55 }
56
57 if test "$DIE" -eq 1; then
58         exit 1
59 fi
60
61 echo
62 echo "Generate build-system by:"
63 echo "   aclocal:    $(aclocal --version | head -1)"
64 echo "   autoconf:   $(autoconf --version | head -1)"
65 echo "   autoheader: $(autoheader --version | head -1)"
66 echo "   automake:   $(automake --version | head -1)"
67 echo "   libtoolize: $(libtoolize --version | head -1)"
68
69 set -e
70 libtoolize --force $LT_OPTS
71 aclocal $AL_OPTS
72 autoconf $AC_OPTS
73 autoheader $AH_OPTS
74
75 automake --add-missing $AM_OPTS
76
77 cd $THEDIR
78
79 echo
80 echo "Now type '$srcdir/configure' and 'make' to compile."
81 echo
82
83