Docs: Remove a bunch of GTK+ references.
[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 # SPDX-License-Identifier: GPL-2.0-or-later
12
13 DIE=true
14 PROJECT="Wireshark"
15
16 # If you are going to use the non-default name for automake becase your OS
17 # installation has multiple versions, you need to call both aclocal and automake
18 # with that version number, as they come from the same package.
19 #AM_VERSION='-1.8'
20
21 ACLOCAL=aclocal$AM_VERSION
22 AUTOHEADER=autoheader
23 AUTOMAKE=automake$AM_VERSION
24 AUTOCONF=autoconf
25 PKG_CONFIG=pkg-config
26
27 # Check for python. Python did not support --version before version 2.5.
28 # Until we require a version > 2.5, we should use -V.
29 PYVER=`exec python -V 2>&1 | sed 's/Python *//'`
30 # If "python" isn't found, try "python3"
31 if test "$PYVER" = "exec: python: not found"
32 then
33     PYVER=`exec python3 -V 2>&1 | sed 's/Python *//'`
34 fi
35 case "$PYVER" in
36 2*|3*)
37   ;;
38 *)
39   cat >&2 <<_EOF_
40
41         You must have Python in order to compile $PROJECT.
42         Download the appropriate package for your distribution/OS,
43         or get the source tarball at http://www.python.org/
44 _EOF_
45   DIE="exit 1"
46 esac
47
48 ACVER=`$AUTOCONF --version | grep '^autoconf' | sed 's/.*) *//'`
49 case "$ACVER" in
50 '' | 0.* | 1.* | 2.[0-5]* | 2.6[0123]* )
51   cat >&2 <<_EOF_
52
53         You must have autoconf 2.64 or later installed to compile $PROJECT.
54         Download the appropriate package for your distribution/OS,
55         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/autoconf/
56 _EOF_
57   DIE="exit 1"
58   ;;
59 esac
60
61
62 AMVER=`$AUTOMAKE --version | grep '^automake' | sed 's/.*) *//'`
63 case "$AMVER" in
64 1.11* | 1.1[2-9]*)
65   ;;
66
67 *)
68
69   cat >&2 <<_EOF_
70
71         You must have automake 1.11 or later installed to compile $PROJECT.
72         Download the appropriate package for your distribution/OS,
73         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/
74 _EOF_
75   DIE="exit 1"
76   ;;
77 esac
78
79
80 #
81 # Apple's Developer Tools have a "libtool" that has nothing to do with
82 # the GNU libtool; they call the latter "glibtool".  They also call
83 # libtoolize "glibtoolize".
84 #
85 # Check for "glibtool" first.
86 #
87 LTVER=`glibtool --version 2>/dev/null | grep ' libtool)' | \
88     sed 's/.*libtool) \([0-9][0-9.]*\)[^ ]* .*/\1/'`
89 if test -z "$LTVER"
90 then
91         LTVER=`libtool --version | grep ' libtool)' | \
92             sed 's/.*) \([0-9][0-9.]*\)[^ ]* .*/\1/' `
93         LIBTOOLIZE=libtoolize
94 else
95         LIBTOOLIZE=glibtoolize
96 fi
97 case "$LTVER" in
98 '' | 0.* | 1.* | 2.2 )
99
100   cat >&2 <<_EOF_
101
102         You must have libtool 2.2.2 or later installed to compile $PROJECT.
103         Download the appropriate package for your distribution/OS,
104         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/libtool/
105 _EOF_
106   DIE="exit 1"
107   ;;
108 esac
109
110 #
111 # XXX - is there some minimum version for which we should be checking?
112 #
113 PCVER=`pkg-config --version`
114 if test -z "$PCVER"; then
115   cat >&2 <<_EOF_
116
117         You must have pkg-config installed to compile $PROJECT.
118         Download the appropriate package for your distribution/OS,
119         or get the source tarball at http://pkgconfig.freedesktop.org/releases/
120 _EOF_
121   DIE="exit 1"
122 fi
123
124 $DIE
125
126 LTARGS=" --copy --force"
127 echo $LIBTOOLIZE $LTARGS
128 $LIBTOOLIZE $LTARGS || exit 1
129 aclocal_flags="-I m4"
130 aclocalinclude="$ACLOCAL_FLAGS $aclocal_flags";
131 echo $ACLOCAL $aclocalinclude
132 $ACLOCAL $aclocalinclude || exit 1
133 echo $AUTOHEADER
134 $AUTOHEADER || exit 1
135 echo $AUTOMAKE --add-missing --gnu $am_opt
136 $AUTOMAKE --add-missing --gnu $am_opt || exit 1
137 echo $AUTOCONF
138 $AUTOCONF || exit 1
139
140 echo "Now type \"./configure [options]\" and \"make\" to compile $PROJECT."