Update:
[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="Wireshark"
9
10 # If you are going to use the non-default name for automake becase your OS
11 # installaion has multiple versions, you need to call both aclocal and automake
12 # with that version number, as they come from the same package.
13 #AM_VERSION='-1.8'
14
15 ACLOCAL=aclocal$AM_VERSION
16 AUTOHEADER=autoheader
17 AUTOMAKE=automake$AM_VERSION
18 AUTOCONF=autoconf
19
20 # Check for python. Python did not support --version before version 2.5.
21 # Until we require a version > 2.5, we should use -V.
22 PYVER=`python -V 2>&1 | sed 's/Python *//'`
23 case "$PYVER" in
24 2*|3*)
25   ;;
26 *)
27   cat >&2 <<_EOF_
28
29         You must have Python in order to compile $PROJECT.
30         Download the appropriate package for your distribution/OS,
31         or get the source tarball at http://www.python.org/
32 _EOF_
33   DIE="exit 1"
34 esac
35
36
37 ACVER=`$AUTOCONF --version | grep '^autoconf' | sed 's/.*) *//'`
38 case "$ACVER" in
39 '' | 0.* | 1.* | 2.[0-5]* )
40   cat >&2 <<_EOF_
41
42         You must have autoconf 2.60 or later installed to compile $PROJECT.
43         Download the appropriate package for your distribution/OS,
44         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/autoconf/
45 _EOF_
46   DIE="exit 1"
47   ;;
48 esac
49
50
51 AMVER=`$AUTOMAKE --version | grep '^automake' | sed 's/.*) *//'`
52 case "$AMVER" in
53 1.9* | 1.[1][0-9]*)
54   ;;
55
56 *)
57
58   cat >&2 <<_EOF_
59
60         You must have automake 1.9 or later installed to compile $PROJECT.
61         Download the appropriate package for your distribution/OS,
62         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/
63 _EOF_
64   DIE="exit 1"
65   ;;
66 esac
67
68
69 #
70 # Apple's Developer Tools have a "libtool" that has nothing to do with
71 # the GNU libtool; they call the latter "glibtool".  They also call
72 # libtoolize "glibtoolize".
73 #
74 # Check for "glibtool" first.
75 #
76 LTVER=`glibtool --version 2>/dev/null | grep ' libtool)' | \
77     sed 's/.*libtool) \([0-9][0-9.]*\)[^ ]* .*/\1/'`
78 if test -z "$LTVER"
79 then
80         LTVER=`libtool --version | grep ' libtool)' | \
81             sed 's/.*) \([0-9][0-9.]*\)[^ ]* .*/\1/' `
82         LIBTOOLIZE=libtoolize
83 else
84         LIBTOOLIZE=glibtoolize
85 fi
86 case "$LTVER" in
87 '' | 0.* | 1.[0-3]* )
88
89   cat >&2 <<_EOF_
90
91         You must have libtool 1.4 or later installed to compile $PROJECT.
92         Download the appropriate package for your distribution/OS,
93         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/libtool/
94 _EOF_
95   DIE="exit 1"
96   ;;
97 esac
98
99 $DIE
100
101 aclocal_flags=`./aclocal-flags`
102 aclocalinclude="$ACLOCAL_FLAGS $aclocal_flags";
103 echo $ACLOCAL $aclocalinclude
104 $ACLOCAL $aclocalinclude || exit 1
105 #
106 # We do NOT want libtoolize overwriting our versions of config.guess and
107 # config.sub, so move them away and then move them back.
108 # We don't omit "--force", as we want libtoolize to install other files
109 # without whining.
110 #
111 mv config.guess config.guess.save-libtool
112 mv config.sub config.sub.save-libtool
113 LTARGS=" --copy --force"
114 echo $LIBTOOLIZE $LTARGS
115 $LIBTOOLIZE $LTARGS || exit 1
116 rm -f config.guess config.sub
117 mv config.guess.save-libtool config.guess
118 mv config.sub.save-libtool config.sub
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
126 #./configure "$@" || exit 1
127
128 echo
129 echo "Now type \"./configure [options]\" and \"make\" to compile $PROJECT."