packet-kerberos: remember in what frame a key was learned
[metze/wireshark/wip.git] / autogen.sh
1 #!/bin/sh
2 #
3 # Run this to generate all the initial makefiles.
4 #
5 # Copyright 2014 The Wireshark Authors
6 #
7 # Wireshark - Network traffic analyzer
8 # By Gerald Combs <gerald@wireshark.org>
9 # Copyright 1998 Gerald Combs
10 #
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License
13 # as published by the Free Software Foundation; either version 2
14 # of the License, or (at your option) any later version.
15 #
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
25 DIE=true
26 PROJECT="Wireshark"
27
28 # If you are going to use the non-default name for automake becase your OS
29 # installaion has multiple versions, you need to call both aclocal and automake
30 # with that version number, as they come from the same package.
31 #AM_VERSION='-1.8'
32
33 ACLOCAL=aclocal$AM_VERSION
34 AUTOHEADER=autoheader
35 AUTOMAKE=automake$AM_VERSION
36 AUTOCONF=autoconf
37
38 # Check for python. Python did not support --version before version 2.5.
39 # Until we require a version > 2.5, we should use -V.
40 PYVER=`python -V 2>&1 | sed 's/Python *//'`
41 case "$PYVER" in
42 2*|3*)
43   ;;
44 *)
45   cat >&2 <<_EOF_
46
47         You must have Python in order to compile $PROJECT.
48         Download the appropriate package for your distribution/OS,
49         or get the source tarball at http://www.python.org/
50 _EOF_
51   DIE="exit 1"
52 esac
53
54
55 ACVER=`$AUTOCONF --version | grep '^autoconf' | sed 's/.*) *//'`
56 case "$ACVER" in
57 '' | 0.* | 1.* | 2.[0-5]* )
58   cat >&2 <<_EOF_
59
60         You must have autoconf 2.60 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/autoconf/
63 _EOF_
64   DIE="exit 1"
65   ;;
66 esac
67
68
69 AMVER=`$AUTOMAKE --version | grep '^automake' | sed 's/.*) *//'`
70 case "$AMVER" in
71 1.9* | 1.[1][0-9]*)
72   ;;
73
74 *)
75
76   cat >&2 <<_EOF_
77
78         You must have automake 1.9 or later installed to compile $PROJECT.
79         Download the appropriate package for your distribution/OS,
80         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/
81 _EOF_
82   DIE="exit 1"
83   ;;
84 esac
85
86
87 #
88 # Apple's Developer Tools have a "libtool" that has nothing to do with
89 # the GNU libtool; they call the latter "glibtool".  They also call
90 # libtoolize "glibtoolize".
91 #
92 # Check for "glibtool" first.
93 #
94 LTVER=`glibtool --version 2>/dev/null | grep ' libtool)' | \
95     sed 's/.*libtool) \([0-9][0-9.]*\)[^ ]* .*/\1/'`
96 if test -z "$LTVER"
97 then
98         LTVER=`libtool --version | grep ' libtool)' | \
99             sed 's/.*) \([0-9][0-9.]*\)[^ ]* .*/\1/' `
100         LIBTOOLIZE=libtoolize
101 else
102         LIBTOOLIZE=glibtoolize
103 fi
104 case "$LTVER" in
105 '' | 0.* | 1.[0-3]* )
106
107   cat >&2 <<_EOF_
108
109         You must have libtool 1.4 or later installed to compile $PROJECT.
110         Download the appropriate package for your distribution/OS,
111         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/libtool/
112 _EOF_
113   DIE="exit 1"
114   ;;
115 esac
116
117 $DIE
118
119 aclocal_flags=`./aclocal-flags`
120 aclocalinclude="$ACLOCAL_FLAGS $aclocal_flags";
121 echo $ACLOCAL $aclocalinclude
122 $ACLOCAL $aclocalinclude || exit 1
123 #
124 # We do NOT want libtoolize overwriting our versions of config.guess and
125 # config.sub, so move them away and then move them back.
126 # We don't omit "--force", as we want libtoolize to install other files
127 # without whining.
128 #
129 mv config.guess config.guess.save-libtool
130 mv config.sub config.sub.save-libtool
131 LTARGS=" --copy --force"
132 echo $LIBTOOLIZE $LTARGS
133 $LIBTOOLIZE $LTARGS || exit 1
134 rm -f config.guess config.sub
135 mv config.guess.save-libtool config.guess
136 mv config.sub.save-libtool config.sub
137 echo $AUTOHEADER
138 $AUTOHEADER || exit 1
139 echo $AUTOMAKE --add-missing --gnu $am_opt
140 $AUTOMAKE --add-missing --gnu $am_opt || exit 1
141 echo $AUTOCONF
142 $AUTOCONF || exit 1
143
144 if [ `uname -s` = Darwin ] ; then
145     echo
146     echo "To configure Wireshark on OS X, you will need to type:"
147     echo "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/X11/lib/pkgconfig"
148     echo "before you can run configure."
149 fi
150
151 echo
152 echo "Now type \"./configure [options]\" and \"make\" to compile $PROJECT."