Correct return value. Fixes bug #116621. Problem reported by Mario Lang.
[atk.git] / autogen.sh
blob32d042b3fc9e1a0e0f8c96fb1dc871dbb021f65e
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
4 srcdir=`dirname $0`
5 test -z "$srcdir" && srcdir=.
7 ORIGDIR=`pwd`
8 cd $srcdir
9 PROJECT=Atk
10 TEST_TYPE=-f
11 FILE=atk/atk.h
13 DIE=0
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*)
20 have_libtool=true
22 esac
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
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
40 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
41 echo
42 echo "You must have autoconf installed to compile $PROJECT."
43 echo "libtool the appropriate package for your distribution,"
44 echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
45 DIE=1
48 if automake-1.7 --version < /dev/null > /dev/null 2>&1 ; then
49 AUTOMAKE=automake-1.7
50 ACLOCAL=aclocal-1.7
51 else
52 echo
53 echo "You must have automake 1.7.x installed to compile $PROJECT."
54 echo "Install the appropriate package for your distribution,"
55 echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
56 DIE=1
60 if test "$DIE" -eq 1; then
61 exit 1
64 test $TEST_TYPE $FILE || {
65 echo "You must run this script in the top-level $PROJECT directory"
66 exit 1
69 if test -z "$AUTOGEN_SUBDIR_MODE"; then
70 if test -z "$*"; then
71 echo "I am going to run ./configure with no arguments - if you wish "
72 echo "to pass any to it, please specify them on the $0 command line."
77 if test -z "$ACLOCAL_FLAGS"; then
79 acdir=`aclocal-1.4 --print-ac-dir`
80 m4list="glib-2.0.m4 glib-gettext.m4"
82 for file in $m4list
84 if [ ! -f "$acdir/$file" ]; then
85 echo "WARNING: aclocal's directory is $acdir, but..."
86 echo " no file $acdir/$file"
87 echo " You may see fatal macro warnings below."
88 echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
89 echo " environment variable to \"-I /some/dir\", or install"
90 echo " $acdir/$file."
91 echo ""
93 done
96 $ACLOCAL $ACLOCAL_FLAGS || exit 1
98 libtoolize --force || exit 1
99 gtkdocize || exit 1
101 glib-gettextize --force || exit 1
103 autoheader || exit 1
105 $AUTOMAKE --add-missing || exit 1
106 autoconf || exit 1
107 cd $ORIGDIR
109 if test -z "$AUTOGEN_SUBDIR_MODE"; then
110 $srcdir/configure --enable-maintainer-mode --enable-gtk-doc "$@"
112 echo
113 echo "Now type 'make' to compile $PROJECT."