From Jamie Fournier: AFS 4 UPDATE server support.
[obnox/wireshark/wip.git] / autogen.sh
1 #!/bin/sh
2 #
3 # Run this to generate all the initial makefiles.
4 #
5 # $Id: autogen.sh,v 1.21 2002/09/27 02:55:00 gerald Exp $
6
7 DIE=true
8 PROJECT="Ethereal"
9
10
11 # Check for python. There's no "--version" option!
12 python -c "print 'Checking for python.'"
13 if [ $? != 0 ] ; then
14   cat >&2 <<_EOF_
15
16         You must have Python in order to compile $PROJECT.
17         Download the appropriate package for your distribution/OS,
18         or get the source tarball at http://www.python.org/
19 _EOF_
20   DIE="exit 1"
21 fi
22
23
24 VER=`autoconf --version | grep '^autoconf' | sed 's/.*)//'`
25 case "$VER" in
26 0* | 1\.* | 2\.[0-9] | 2\.[0-9][a-z]* | \
27 2\.1[0-2] | 2\.1[0-2][a-z]* )
28   cat >&2 <<_EOF_
29
30         You must have autoconf 2.13 or later installed to compile $PROJECT.
31         Download the appropriate package for your distribution/OS,
32         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/autoconf/
33 _EOF_
34   DIE="exit 1"
35   ;;
36 esac
37
38
39 VER=`automake --version | grep '^automake' | sed 's/.*)//'`
40 case "$VER" in
41 0* | 1\.[0-3] | 1\.[0-3][a-z]* )
42
43   cat >&2 <<_EOF_
44
45         You must have automake 1.4 or later installed to compile $PROJECT.
46         Download the appropriate package for your distribution/OS,
47         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/
48 _EOF_
49   DIE="exit 1"
50   ;;
51 esac
52
53
54 VER=`libtool --version | grep ' libtool)' | \
55 sed 's/.*) \([0-9][0-9.]*\) .*/\1/' `
56 case "$VER" in
57 0* | 1\.[0-2] | 1\.[0-2][a-z]* | \
58 1\.3\.[0-2] | 1\.3\.[0-2][a-z]* )
59
60   cat >&2 <<_EOF_
61
62         You must have libtool 1.3.3 or later installed to compile $PROJECT.
63         Download the appropriate package for your distribution/OS,
64         or get the source tarball at ftp://ftp.gnu.org/pub/gnu/libtool/
65 _EOF_
66   DIE="exit 1"
67   ;;
68 esac
69
70 $DIE
71
72 #
73 # We do NOT want libtoolize overwriting our versions of config.guess and
74 # config.sub, so move them away and then move them back.
75 # We don't omit "--force", as we want libtoolize to install other files
76 # without whining.
77 #
78 mv config.guess config.guess.save-libtool
79 mv config.sub config.sub.save-libtool
80 libtoolize --copy --force || exit 1
81 rm -f config.guess config.sub
82 mv config.guess.save-libtool config.guess
83 mv config.sub.save-libtool config.sub
84
85 if test -z "$*"; then
86         echo "Running ./configure with no arguments. If you wish to pass any,"
87         echo "please specify them on the $0 command line."
88 fi
89
90 aclocal_flags="`./aclocal-flags`"
91
92 if glib-config --version >/dev/null 2>&1 ; then
93         rm -f aclocal-missing/glib.m4
94 else
95         cp aclocal-fallback/glib.m4 aclocal-missing/
96 fi
97 if gtk-config --version >/dev/null 2>&1 ; then
98         rm -f aclocal-missing/gtk.m4
99 else
100         cp aclocal-fallback/gtk.m4 aclocal-missing/
101 fi
102 if pkg-config glib-2.0 >/dev/null 2>&1 ; then
103         rm -f aclocal-missing/glib-2.0.m4
104 else
105         cp aclocal-fallback/glib-2.0.m4 aclocal-missing/
106 fi
107 if pkg-config gtk+-2.0 >/dev/null 2>&1 ; then
108         rm -f aclocal-missing/gtk-2.0.m4
109 else
110         cp aclocal-fallback/gtk-2.0.m4 aclocal-missing/
111 fi
112
113 for dir in . epan wiretap ;  do
114   echo processing $dir
115   (
116     cd $dir
117     if [ "$dir" = "." ] ; then
118         topdir=.
119     else
120         topdir=..
121     fi
122     aclocal_missing="-I $topdir/aclocal-missing"
123     aclocalinclude="$ACLOCAL_FLAGS $aclocal_flags $aclocal_missing";
124     echo aclocal $aclocalinclude
125     aclocal $aclocalinclude || exit 1
126     echo autoheader
127     autoheader || exit 1
128     echo automake --add-missing --gnu $am_opt
129     automake --add-missing --gnu $am_opt || exit 1
130     echo autoconf
131     autoconf || exit 1
132   ) || exit 1
133 done
134
135 ./configure "$@" || exit 1
136
137 echo
138 echo "Now type 'make' to compile $PROJECT."