]> Pileus Git - ~andy/gtk/blob - autogen.sh
Try again to allow newer automake
[~andy/gtk] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4 srcdir=`dirname $0`
5 test -z "$srcdir" && srcdir=.
6
7 ORIGDIR=`pwd`
8 cd $srcdir
9 PROJECT=Gtk+
10 TEST_TYPE=-d
11 FILE=gdk
12
13 DIE=0
14
15 have_libtool=false
16 if libtoolize --version < /dev/null > /dev/null 2>&1 ; then
17         libtool_version=`libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
18         case $libtool_version in
19             1.4*|1.5*|2.2*)
20                 have_libtool=true
21                 ;;
22         esac
23 fi
24 if $have_libtool ; then : ; else
25         echo
26         echo "You must have libtool 1.4 installed to compile $PROJECT."
27         echo "Install the appropriate package for your distribution,"
28         echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/"
29         DIE=1
30 fi
31
32 (gtkdocize --version) < /dev/null > /dev/null 2>&1 || {
33         echo
34         echo "You must have gtk-doc installed to compile $PROJECT."
35         echo "Install the appropriate package for your distribution,"
36         echo "or get the source tarball at http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/"
37         DIE=1
38 }
39
40 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
41         echo
42         echo "You must have autoconf installed to compile $PROJECT."
43         echo "Install the appropriate package for your distribution,"
44         echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
45         DIE=1
46 }
47
48 if automake-1.11 --version < /dev/null > /dev/null 2>&1 ; then
49     AUTOMAKE=automake-1.11
50     ACLOCAL=aclocal-1.11
51 else if automake-1.10 --version < /dev/null > /dev/null 2>&1 ; then
52     AUTOMAKE=automake-1.10
53     ACLOCAL=aclocal-1.10
54 else if automake-1.7 --version < /dev/null > /dev/null 2>&1 ; then
55     AUTOMAKE=automake-1.7
56     ACLOCAL=aclocal-1.7
57 else
58         echo
59         echo "You must have automake 1.7.x, 1,10.x or 1.11.x installed to compile $PROJECT."
60         echo "Install the appropriate package for your distribution,"
61         echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
62         DIE=1
63 fi
64 fi
65 fi
66
67 if test "$DIE" -eq 1; then
68         exit 1
69 fi
70
71 test $TEST_TYPE $FILE || {
72         echo "You must run this script in the top-level $PROJECT directory"
73         exit 1
74 }
75
76 if test -z "$AUTOGEN_SUBDIR_MODE"; then
77         if test -z "$*"; then
78                 echo "I am going to run ./configure with no arguments - if you wish "
79                 echo "to pass any to it, please specify them on the $0 command line."
80         fi
81 fi
82
83 if test -z "$ACLOCAL_FLAGS"; then
84
85         acdir=`$ACLOCAL --print-ac-dir`
86         m4list="glib-2.0.m4 glib-gettext.m4"
87
88         for file in $m4list
89         do
90                 if [ ! -f "$acdir/$file" ]; then
91                         echo "WARNING: aclocal's directory is $acdir, but..."
92                         echo "         no file $acdir/$file"
93                         echo "         You may see fatal macro warnings below."
94                         echo "         If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
95                         echo "         environment variable to \"-I /some/dir\", or install"
96                         echo "         $acdir/$file."
97                         echo ""
98                 fi
99         done
100 fi
101
102 rm -rf autom4te.cache
103
104 # README and INSTALL are required by automake, but may be deleted by clean
105 # up rules. to get automake to work, simply touch these here, they will be
106 # regenerated from their corresponding *.in files by ./configure anyway.
107 touch README INSTALL
108
109 $ACLOCAL $ACLOCAL_FLAGS || exit $?
110
111 libtoolize --force || exit $?
112 gtkdocize || exit $?
113
114 autoheader || exit $?
115
116 $AUTOMAKE --add-missing || exit $?
117 autoconf || exit $?
118 cd $ORIGDIR || exit $?
119
120 if test -z "$AUTOGEN_SUBDIR_MODE"; then
121         $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $?
122
123         echo 
124         echo "Now type 'make' to compile $PROJECT."
125 fi