Make sure that the IPv4 and IPv6 address parameters are always processed to support...
[obnox/wireshark/wip.git] / autogen.sh
1 #!/bin/sh
2 #
3 # Run this to generate all the initial makefiles.
4 #
5 # $Id$
6
7 DIE=true
8 PROJECT="Ethereal"
9
10 ACLOCAL=aclocal
11 AUTOHEADER=autoheader
12 AUTOMAKE=automake
13 AUTOCONF=autoconf
14
15 # Check for python. There's no "--version" option!
16 python -c "print 'Checking for python.'"
17 if [ $? != 0 ] ; then
18   cat >&2 <<_EOF_
19
20         You must have Python in order to compile $PROJECT.
21         Download the appropriate package for your distribution/OS,
22         or get the source tarball at http://www.python.org/
23 _EOF_
24   DIE="exit 1"
25 fi
26
27
28 ACVER=`$AUTOCONF --version | grep '^autoconf' | sed 's/.*) *//'`
29 case "$ACVER" in
30 '' | 0.* | 1.* | 2.[0-4]* | \
31 2.5[0-1] | 2.5[0-1][a-z]* )
32   cat >&2 <<_EOF_
33
34         You must have autoconf 2.52 or later installed to compile $PROJECT.
35         Download the appropriate package for your distribution/OS,
36         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/autoconf/
37 _EOF_
38   DIE="exit 1"
39   ;;
40 esac
41
42
43 AMVER=`$AUTOMAKE --version | grep '^automake' | sed 's/.*) *//'`
44 case "$AMVER" in
45 '' | 0.* | 1.[0-5]* )
46
47   cat >&2 <<_EOF_
48
49         You must have automake 1.6 or later installed to compile $PROJECT.
50         Download the appropriate package for your distribution/OS,
51         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/
52 _EOF_
53   DIE="exit 1"
54   ;;
55 esac
56
57
58 #
59 # Apple's Developer Tools have a "libtool" that has nothing to do with
60 # the GNU libtool; they call the latter "glibtool".  They also call
61 # libtoolize "glibtoolize".
62 #
63 # Check for "glibtool" first.
64 #
65 LTVER=`glibtool --version 2>/dev/null | grep ' libtool)' | \
66     sed 's/.*libtool) \([0-9][0-9.]*\)[^ ]* .*/\1/'`
67 if test -z "$LTVER"
68 then
69         LTVER=`libtool --version | grep ' libtool)' | \
70             sed 's/.*) \([0-9][0-9.]*\)[^ ]* .*/\1/' `
71         LIBTOOLIZE=libtoolize
72 else
73         LIBTOOLIZE=glibtoolize
74 fi
75 case "$LTVER" in
76 '' | 0.* | 1.[0-3]* )
77
78   cat >&2 <<_EOF_
79
80         You must have libtool 1.4 or later installed to compile $PROJECT.
81         Download the appropriate package for your distribution/OS,
82         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/libtool/
83 _EOF_
84   DIE="exit 1"
85   ;;
86 esac
87
88 $DIE
89
90 for dir in . wiretap ;  do
91   echo processing $dir
92   (
93     cd $dir
94     if [ "$dir" = "." ] ; then
95         topdir=.
96     else
97         topdir=..
98     fi
99     aclocal_flags=`$topdir/aclocal-flags`
100     aclocalinclude="$ACLOCAL_FLAGS $aclocal_flags";
101     echo $ACLOCAL $aclocalinclude
102     $ACLOCAL $aclocalinclude || exit 1
103     if [ "$dir" = "." ] ; then
104         #
105         # We do NOT want libtoolize overwriting our versions of config.guess and
106         # config.sub, so move them away and then move them back.
107         # We don't omit "--force", as we want libtoolize to install other files
108         # without whining.
109         #
110         mv config.guess config.guess.save-libtool
111         mv config.sub config.sub.save-libtool
112         LTARGS=" --copy --force"
113         echo $LIBTOOLIZE $LTARGS
114         $LIBTOOLIZE $LTARGS || exit 1
115         rm -f config.guess config.sub
116         mv config.guess.save-libtool config.guess
117         mv config.sub.save-libtool config.sub
118     fi
119     echo $AUTOHEADER
120     $AUTOHEADER || exit 1
121     echo $AUTOMAKE --add-missing --gnu $am_opt
122     $AUTOMAKE --add-missing --gnu $am_opt || exit 1
123     echo $AUTOCONF
124     $AUTOCONF || exit 1
125   ) || exit 1
126 done
127
128 #./configure "$@" || exit 1
129
130 echo
131 echo "Now type \"./configure [options]\" and \"make\" to compile $PROJECT."