ue May 21 15:51:17 2002 Owen Taylor <otaylor@redhat.com>
[platform/upstream/glib.git] / autogen.sh
index e56df4f..9da7a60 100755 (executable)
@@ -8,33 +8,65 @@ ORIGDIR=`pwd`
 cd $srcdir
 PROJECT=GLib
 TEST_TYPE=-f
-FILE=glib.h
+FILE=glib/glib.h
 
 DIE=0
 
-(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+have_libtool=false
+if libtool --version < /dev/null > /dev/null 2>&1 ; then
+       libtool_version=`libtoolize --version |  libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
+       case $libtool_version in
+           1.4*)
+               have_libtool=true
+               ;;
+       esac
+fi
+if $have_libtool ; then : ; else
        echo
-       echo "You must have autoconf installed to compile $PROJECT."
-       echo "Download the appropriate package for your distribution,"
+       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
 
-(libtool --version) < /dev/null > /dev/null 2>&1 || {
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
        echo
-       echo "You must have libtool installed to compile $PROJECT."
-       echo "Get ftp://alpha.gnu.org/gnu/libtool-1.2d.tar.gz"
-       echo "(or a newer version if it is available)"
+       echo "You must have autoconf installed to compile $PROJECT."
+       echo "libtool the appropriate package for your distribution,"
+       echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
        DIE=1
 }
 
-(automake --version) < /dev/null > /dev/null 2>&1 || {
+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
        echo
-       echo "You must have automake installed to compile $PROJECT."
-       echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4.tar.gz"
+       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"
        echo "(or a newer version if it is available)"
        DIE=1
-}
+fi
+
+have_gettext=false
+if xgettext --version 2>/dev/null | grep 'GNU' > /dev/null ; then 
+        have_gettext=true
+fi
+
+if $have_gettext ; then : ; else
+       echo
+       echo "GNU gettext must be installed to build GLib from CVS"
+       echo "GNU gettext is available from http://www.gnu.org/software/gettext/"
+       DIE=1
+fi
 
 if test "$DIE" -eq 1; then
        exit 1
@@ -45,9 +77,11 @@ test $TEST_TYPE $FILE || {
        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."
+if test -z "$AUTOGEN_SUBDIR_MODE"; then
+        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
 fi
 
 case $CC in
@@ -59,11 +93,13 @@ aclocal $ACLOCAL_FLAGS
 # optionally feature autoheader
 (autoheader --version)  < /dev/null > /dev/null 2>&1 && autoheader
 
-automake $am_opt
+automake -a $am_opt
 autoconf
 cd $ORIGDIR
 
-$srcdir/configure "$@"
+if test -z "$AUTOGEN_SUBDIR_MODE"; then
+        $srcdir/configure --enable-maintainer-mode --enable-gtk-doc "$@"
 
-echo 
-echo "Now type 'make' to compile $PROJECT."
+        echo 
+        echo "Now type 'make' to compile $PROJECT."
+fi
\ No newline at end of file