autogen.sh 2.59 KB
Newer Older
1 2 3
#!/bin/sh
# Run this to generate all the initial makefiles, etc.

4 5 6
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

7 8
ORIGDIR=`pwd`
cd $srcdir
9 10 11 12
PROJECT=Gtk+
TEST_TYPE=-d
FILE=gdk

13 14
DIE=0

15 16
have_libtool=false
if libtool --version < /dev/null > /dev/null 2>&1 ; then
Owen Taylor's avatar
Owen Taylor committed
17
	libtool_version=`libtoolize --version |  libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
18 19 20 21 22 23 24 25 26 27 28 29 30 31
	case $libtool_version in
	    1.4*)
		have_libtool=true
		;;
	esac
fi
if $have_libtool ; then : ; else
	echo
	echo "You must have libtool 1.4 installed to compile $PROJECT."
	echo "Install the appropriate package for your distribution,"
	echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
	DIE=1
fi

32 33
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
	echo
34
	echo "You must have autoconf installed to compile $PROJECT."
35
	echo "libtool the appropriate package for your distribution,"
36 37 38 39
	echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
	DIE=1
}

40 41 42 43 44 45 46 47 48 49 50 51
have_automake=false
if automake --version < /dev/null > /dev/null 2>&1 ; then
	automake_version=`automake --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
	case $automake_version in
	   1.2*|1.3*|1.4) 
		;;
	   *)
		have_automake=true
		;;
	esac
fi
if $have_automake ; then : ; else
52
	echo
53 54
	echo "You must have automake 1.4-p1 installed to compile $PROJECT."
	echo "Get ftp://ftp.gnu.org/pub/gnu/automake/automake-1.4-p1.tar.gz"
55 56
	echo "(or a newer version if it is available)"
	DIE=1
57
fi
58 59 60 61 62

if test "$DIE" -eq 1; then
	exit 1
fi

63 64
test $TEST_TYPE $FILE || {
	echo "You must run this script in the top-level $PROJECT directory"
65 66 67 68 69 70 71 72
	exit 1
}

if test -z "$*"; then
	echo "I am going to run ./configure with no arguments - if you wish "
        echo "to pass any to it, please specify them on the $0 command line."
fi

73
case $CC in
Joel Becker's avatar
Joel Becker committed
74
*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
75 76
esac

77 78 79
if test -z "$ACLOCAL_FLAGS"; then

	acdir=`aclocal --print-ac-dir`
80
        m4list="glib-2.0.m4 glib-gettext.m4"
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95

	for file in $m4list
	do
		if [ ! -f "$acdir/$file" ]; then
			echo "WARNING: aclocal's directory is $acdir, but..."
			echo "         no file $acdir/$file"
			echo "         You may see fatal macro warnings below."
			echo "         If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
			echo "         environment variable to \"-I /some/dir\", or install"
			echo "         $acdir/$file."
			echo ""
		fi
	done
fi

96 97
aclocal $ACLOCAL_FLAGS

98 99 100
# optionally feature autoheader
(autoheader --version)  < /dev/null > /dev/null 2>&1 && autoheader

Manish Singh's avatar
Manish Singh committed
101
automake -a $am_opt
Tim Janik's avatar
Tim Janik committed
102
autoconf
103
cd $ORIGDIR
Tim Janik's avatar
Tim Janik committed
104

105
$srcdir/configure --enable-maintainer-mode "$@"
106 107

echo 
108
echo "Now type 'make' to compile $PROJECT."