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