summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2004-10-15 07:00:25 +0000
committerMichael Koch <konqueror@gmx.de>2004-10-15 07:00:25 +0000
commit64eee726ae7ded9482b13f50fb69c6823105cb03 (patch)
tree7a0ce075769e934c1282b9e6b61e20744e044ee1 /autogen.sh
parentf07ec5a2eb21181cc314fa2643a0d1a2f4090b6b (diff)
downloadclasspath-64eee726ae7ded9482b13f50fb69c6823105cb03.tar.gz
2004-10-15 Michael Koch <konqueror@gmx.de>
* autogen.sh: Replaced with a GNOME-like script that aborts when the versions of autoconf, automake or libtool are not sufficient.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh141
1 files changed, 108 insertions, 33 deletions
diff --git a/autogen.sh b/autogen.sh
index 236c7a620..6824a8ee7 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -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
-AUTOCONF=autoconf
-${AUTOCONF} --version | head -n 1
-echo "autoconf: minimum version required: 2.59"
+DIE=0
-# Autoheader is part of autoconf
-AUTOHEADER=autoheader
-${AUTOHEADER} --version | head -n 1
-echo "autoheader: minimum version required: 2.59"
+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
+
+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
+
+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"
+
+ 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
-echo "autoheader ..."
-${AUTOHEADER} --force
+$ACLOCAL $ACLOCAL_FLAGS || exit $?
-echo "automake ..."
-${AUTOMAKE} --add-missing --copy
+libtoolize --force || exit $?
-echo "autoconf ..."
-${AUTOCONF} --force
+autoheader || exit $?
-echo "Finished"
+$AUTOMAKE --add-missing || exit $?
+autoconf || exit $?
+cd $ORIGDIR || exit $?
+
+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