diff options
author | Michael Jennings <mej@kainx.org> | 2004-03-03 17:20:09 +0000 |
---|---|---|
committer | Michael Jennings <mej@kainx.org> | 2004-03-03 17:20:09 +0000 |
commit | e4cee70895139b920d2dd2a3a6892e35b4734c35 (patch) | |
tree | 1e2041be8cecd0b4b0e75c283ecac078522d9a96 /autogen.sh | |
parent | 78058bf8947bdc16a82cca96b7ceb6fc90294129 (diff) | |
download | libast-e4cee70895139b920d2dd2a3a6892e35b4734c35.tar.gz |
Wed Mar 3 12:25:22 2004 Michael Jennings (mej)
New and improved autogen stuff. Prefers autoconf 2.13 and automake
1.4, but it's also been tested with autoconf 2.57 and automake 1.6.3.
SVN revision: 9210
Diffstat (limited to 'autogen.sh')
-rwxr-xr-x | autogen.sh | 77 |
1 files changed, 47 insertions, 30 deletions
@@ -2,46 +2,63 @@ # Run this to generate all the initial makefiles, etc. # $Id$ +broken() { + echo + echo "You need libtool, autoconf, and automake. Install them" + echo "and try again. Get source at ftp://ftp.gnu.org/pub/gnu/" + echo "ERROR: $1 not found." + exit -1 +} + DIE=0 echo "Generating configuration files for libast, please wait...." -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile libast." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} +LIBTOOLIZE_CHOICES="$LIBTOOLIZE libtoolize" +AUTOHEADER_CHOICES="$AUTOHEADER autoheader213 autoheader-2.13 autoheader" +ACLOCAL_CHOICES="$ACLOCAL aclocal14 aclocal-1.4 aclocal" +AUTOMAKE_CHOICES="$AUTOMAKE automake14 automake-1.4 automake" +AUTOCONF_CHOICES="$AUTOCONF autoconf213 autoconf-2.13 autoconf" -(libtoolize --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have libtool installed to compile libast." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} +for i in $LIBTOOLIZE_CHOICES ; do + $i --version </dev/null >/dev/null 2>&1 && LIBTOOLIZE=$i && break +done +[ "x$LIBTOOLIZE" = "x" ] && broken libtool -(automake --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have automake installed to compile libast." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} +for i in $AUTOHEADER_CHOICES ; do + $i --version </dev/null >/dev/null 2>&1 && AUTOHEADER=$i && break +done +[ "x$AUTOHEADER" = "x" ] && broken autoconf -if test "$DIE" -eq 1; then - exit 1 -fi +for i in $ACLOCAL_CHOICES ; do + $i --version </dev/null >/dev/null 2>&1 && ACLOCAL=$i && break +done +[ "x$ACLOCAL" = "x" ] && broken automake + +for i in $AUTOMAKE_CHOICES ; do + $i --version </dev/null >/dev/null 2>&1 && AUTOMAKE=$i && break +done +[ "x$AUTOMAKE" = "x" ] && broken automake + +for i in $AUTOCONF_CHOICES ; do + $i --version </dev/null >/dev/null 2>&1 && AUTOCONF=$i && break +done +[ "x$AUTOCONF" = "x" ] && broken autoconf + +# Export them so configure can AC_SUBST() them. +export LIBTOOLIZE AUTOHEADER ACLOCAL AUTOMAKE AUTOCONF -if test ! -f "`aclocal --print-ac-dir`/libast.m4"; then +# Check for existing libast.m4 we can use. Use the local one if not. +if test ! -f "`$ACLOCAL --print-ac-dir`/libast.m4"; then ACLOCAL_FLAGS="-I . $ACLOCAL_FLAGS" fi -(set -x && libtoolize -c -f) -(set -x && autoheader) -(set -x && aclocal $ACLOCAL_FLAGS) -(set -x && automake -a -c) -(set -x && autoconf) +# Run the stuff. +(set -x && $LIBTOOLIZE -c -f) +(set -x && $AUTOHEADER) +(set -x && $ACLOCAL $ACLOCAL_FLAGS) +(set -x && $AUTOMAKE -a -c) +(set -x && $AUTOCONF) +# Run configure. ./configure "$@" |