Index: autogen.sh =================================================================== RCS file: /cvsroot/classpath/classpath/autogen.sh,v retrieving revision 1.7 diff -u -r1.7 autogen.sh --- autogen.sh 29 Aug 2004 16:32:13 -0000 1.7 +++ autogen.sh 15 Oct 2004 06:55:41 -0000 @@ -1,48 +1,123 @@ #!/bin/sh +# Run this to generate all the initial makefiles, etc. -set -e +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. -LIBTOOLIZE=libtoolize -${LIBTOOLIZE} --version | head -n 1 -echo "libtoolize: minimum version required: 1.5" +ORIGDIR=`pwd` +cd $srcdir +PROJECT=classpath +TEST_TYPE=-f +FILE=java/lang/Object.java + +DIE=0 + +have_libtool=false +if libtoolize --version < /dev/null > /dev/null 2>&1 ; then + libtool_version=`libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` + case $libtool_version in + 1.5*) + have_libtool=true + ;; + esac +fi +if $have_libtool ; then : ; else + echo + echo "You must have libtool 1.5 installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/" + DIE=1 +fi -AUTOCONF=autoconf -${AUTOCONF} --version | head -n 1 -echo "autoconf: minimum version required: 2.59" +have_autoconf=false +if autoconf --version < /dev/null > /dev/null 2>&1 ; then + autoconf_version=`autoconf --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` + case $autoconf_version in + 2.59*) + have_autoconf=true + ;; + esac +fi +if $have_autoconf ; then : ; else + echo + echo "You must have autoconf 2.59 installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/" + DIE=1 +fi -# Autoheader is part of autoconf -AUTOHEADER=autoheader -${AUTOHEADER} --version | head -n 1 -echo "autoheader: minimum version required: 2.59" +have_automake=false +# We know each 1.9.x version works +if automake-1.9 --version < /dev/null > /dev/null 2>&1 ; then + AUTOMAKE=automake-1.9 + ACLOCAL=aclocal-1.9 + have_automake=true +elif automake --version < /dev/null > /dev/null 2>&1 ; then + AUTOMAKE=automake + ACLOCAL=aclocal + automake_version=`automake --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` + case $automake_version in + 1.9*) + have_automake=true + ;; + esac +fi +if $have_automake ; then : ; else + echo + echo "You must have automake 1.9 installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/" + DIE=1 +fi -AUTOMAKE=automake -if test -x /usr/bin/automake-1.9; then - AUTOMAKE=/usr/bin/automake-1.9 +if test "$DIE" -eq 1; then + exit 1 fi -${AUTOMAKE} --version | head -n 1 -echo "automake: minimum version required: 1.9.0" -# Aclocal is part of automake -ACLOCAL=aclocal -if test -x /usr/bin/aclocal-1.9; then - ACLOCAL=/usr/bin/aclocal-1.9 +test $TEST_TYPE $FILE || { + echo "You must run this script in the top-level $PROJECT directory" + exit 1 +} + +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 -${ACLOCAL} --version | head -n 1 -echo "aclocal: minimum version required: 1.9.0" -echo "libtoolize ..." -${LIBTOOLIZE} --force --copy +if test -z "$ACLOCAL_FLAGS"; then -echo "aclocal ..." -${ACLOCAL} -I . + acdir=`$ACLOCAL --print-ac-dir` + m4list="glib-2.0.m4 glib-gettext.m4" -echo "autoheader ..." -${AUTOHEADER} --force + 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 + +$ACLOCAL $ACLOCAL_FLAGS || exit $? + +libtoolize --force || exit $? -echo "automake ..." -${AUTOMAKE} --add-missing --copy +autoheader || exit $? -echo "autoconf ..." -${AUTOCONF} --force +$AUTOMAKE --add-missing || exit $? +autoconf || exit $? +cd $ORIGDIR || exit $? -echo "Finished" +if test "x$AUTOGEN_SUBDIR_MODE" = "xyes"; then + $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $? + + echo + echo "Now type 'make' to compile $PROJECT." +fi