debian: copyright: add details for src/getopt*
[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
17 test -f src/dhcpd-pools.c || {
18         echo
19         echo "You must run this script in the top-level dhcpd-pools directory"
20         echo
21         DIE=1
22 }
23
24 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
25         echo
26         echo "You must have autoconf installed to generate dhcpd-pools build system."
27         echo
28         DIE=1
29 }
30 (autoheader --version) < /dev/null > /dev/null 2>&1 || {
31         echo
32         echo "You must have autoheader installed to generate dhcpd-pools build system."
33         echo "The autoheader command is part of the GNU autoconf package."
34         echo
35         DIE=1
36 }
37 (libtool --version) < /dev/null > /dev/null 2>&1 || {
38         echo
39         echo "You must have libtool-2 installed to generate dhcpd-pools build system."
40         echo
41         DIE=1
42 }
43 (automake --version) < /dev/null > /dev/null 2>&1 || {
44         echo
45         echo "You must have automake installed to generate dhcpd-pools build system."
46         echo 
47         DIE=1
48 }
49
50 ltver=$(libtoolize --version | awk '/^libtoolize/ { print $4 }')
51 test ${ltver##2.} = "$ltver" && {
52         echo "You must have libtool version >= 2.x.x, but you have $ltver."
53         DIE=1
54 }
55
56 if test "$DIE" -eq 1; then
57         exit 1
58 fi
59
60 echo
61 echo "Generate build-system by:"
62 echo "   aclocal:    $(aclocal --version | head -1)"
63 echo "   autoconf:   $(autoconf --version | head -1)"
64 echo "   autoheader: $(autoheader --version | head -1)"
65 echo "   automake:   $(automake --version | head -1)"
66 echo "   libtoolize: $(libtoolize --version | head -1)"
67
68 set -e
69 libtoolize --force $LT_OPTS
70 aclocal $AL_OPTS
71 autoconf $AC_OPTS
72 autoheader $AH_OPTS
73 automake --add-missing $AM_OPTS
74
75 cd $THEDIR
76
77 echo
78 echo "Now type '$srcdir/configure' and 'make' to compile."
79 echo