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