annotate autogen.sh @ 0:d39e1d0d75b6

initial add
author paulo@hit-nxdomain.opendns.com
date Sat, 20 Feb 2010 21:18:28 -0800
parents
children
rev   line source
paulo@0 1 #! /bin/sh
paulo@0 2 # Run this to generate all the initial makefiles, etc.
paulo@0 3
paulo@0 4 # Stolen from the GNU Midnight Commander. Customized for giFTcurs. Stolen from
paulo@0 5 # giFTcurs. Customized for giFT. Stolen from giFT. Customized for OpenFT.
paulo@0 6 # Stolen from OpenFT.
paulo@0 7
paulo@0 8 # Make it possible to specify path in the environment
paulo@0 9 : ${AUTOCONF=autoconf}
paulo@0 10 : ${AUTOHEADER=autoheader}
paulo@0 11 : ${AUTOMAKE=automake}
paulo@0 12 : ${ACLOCAL=aclocal}
paulo@0 13 : ${LIBTOOLIZE=libtoolize}
paulo@0 14
paulo@0 15 srcdir=`dirname $0`
paulo@0 16 test -z "$srcdir" && srcdir=.
paulo@0 17
paulo@0 18 (
paulo@0 19 cd $srcdir
paulo@0 20
paulo@0 21 # The autoconf cache (version after 2.52) is not reliable yet.
paulo@0 22 rm -rf autom4te.cache
paulo@0 23
paulo@0 24 rm -f aclocal.m4
paulo@0 25 ACLOCAL_INCLUDES="-I m4"
paulo@0 26
paulo@0 27 # Some old version of GNU build tools fail to set error codes.
paulo@0 28 # Check that they generate some of the files they should.
paulo@0 29
paulo@0 30 echo "Running $ACLOCAL..."
paulo@0 31 $ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS || exit 1
paulo@0 32 test -f aclocal.m4 || \
paulo@0 33 { echo "aclocal failed to generate aclocal.m4" 2>&1; exit 1; }
paulo@0 34
paulo@0 35 echo "Running $AUTOHEADER..."
paulo@0 36 $AUTOHEADER || exit 1
paulo@0 37 test -f config.h.in || \
paulo@0 38 { echo "autoheader failed to generate config.h.in" 2>&1; exit 1; }
paulo@0 39
paulo@0 40 echo "Running $AUTOCONF..."
paulo@0 41 $AUTOCONF || exit 1
paulo@0 42 test -f configure || \
paulo@0 43 { echo "autoconf failed to generate configure" 2>&1; exit 1; }
paulo@0 44
paulo@0 45 # hack hack hack...i hate autotools.
paulo@0 46 echo "Running $LIBTOOLIZE --automake..."
paulo@0 47 $LIBTOOLIZE --automake || exit 1
paulo@0 48 test -f ltmain.sh || \
paulo@0 49 { echo "libtoolize failed to generate ltmain.sh" 2>&1; exit 1; }
paulo@0 50
paulo@0 51 # Workaround for Automake 1.5 to ensure that depcomp is distributed.
paulo@0 52 echo "Running $AUTOMAKE..."
paulo@0 53 $AUTOMAKE -a src/Makefile || exit 1
paulo@0 54 $AUTOMAKE -a || exit 1
paulo@0 55 test -f Makefile.in || \
paulo@0 56 { echo "automake failed to generate Makefile.in" 2>&1; exit 1; }
paulo@0 57
paulo@0 58 ) || exit 1
paulo@0 59
paulo@0 60 #conf_flags="--enable-maintainer-mode --enable-compile-warnings"
paulo@0 61 echo Running $srcdir/configure $conf_flags "$@" ...
paulo@0 62 $srcdir/configure --cache-file=config.cache $conf_flags "$@"