Chris@41: #!/bin/sh Chris@41: # Run this to set up the build system: configure, makefiles, etc. Chris@41: # (based on the version in enlightenment's cvs) Chris@41: Chris@41: package="libsamplerate" Chris@41: Chris@41: ACLOCAL_FLAGS="-I M4" Chris@41: Chris@41: olddir=`pwd` Chris@41: srcdir=`dirname $0` Chris@41: test -z "$srcdir" && srcdir=. Chris@41: Chris@41: cd "$srcdir" Chris@41: DIE=0 Chris@41: Chris@41: echo "checking for autoconf... " Chris@41: (autoconf --version) < /dev/null > /dev/null 2>&1 || { Chris@41: echo Chris@41: echo "You must have autoconf installed to compile $package." Chris@41: echo "Download the appropriate package for your distribution," Chris@41: echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" Chris@41: DIE=1 Chris@41: } Chris@41: Chris@41: VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/" Chris@41: VERSIONMKMAJ="sed -e s/\([0-9][0-9]*\)[^0-9].*/\\1/" Chris@41: VERSIONMKMIN="sed -e s/.*[0-9][0-9]*\.//" Chris@41: Chris@41: # do we need automake? Chris@41: if test -r Makefile.am; then Chris@41: AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am` Chris@41: AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP` Chris@41: if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then Chris@41: AM_NEEDED="" Chris@41: fi Chris@41: if test -z $AM_NEEDED; then Chris@41: echo -n "checking for automake... " Chris@41: AUTOMAKE=automake Chris@41: ACLOCAL=aclocal Chris@41: if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then Chris@41: echo "yes" Chris@41: else Chris@41: echo "no" Chris@41: AUTOMAKE= Chris@41: fi Chris@41: else Chris@41: echo -n "checking for automake $AM_NEEDED or later... " Chris@41: majneeded=`echo $AM_NEEDED | $VERSIONMKMAJ` Chris@41: minneeded=`echo $AM_NEEDED | $VERSIONMKMIN` Chris@41: for am in automake-$AM_NEEDED automake$AM_NEEDED \ Chris@41: automake automake-1.7 automake-1.8 automake-1.9 automake-1.10; do Chris@41: ($am --version < /dev/null > /dev/null 2>&1) || continue Chris@41: ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP` Chris@41: maj=`echo $ver | $VERSIONMKMAJ` Chris@41: min=`echo $ver | $VERSIONMKMIN` Chris@41: if test $maj -eq $majneeded -a $min -ge $minneeded; then Chris@41: AUTOMAKE=$am Chris@41: echo $AUTOMAKE Chris@41: break Chris@41: fi Chris@41: done Chris@41: test -z $AUTOMAKE && echo "no" Chris@41: echo -n "checking for aclocal $AM_NEEDED or later... " Chris@41: for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED \ Chris@41: aclocal aclocal-1.7 aclocal-1.8 aclocal-1.9 aclocal-1.10; do Chris@41: ($ac --version < /dev/null > /dev/null 2>&1) || continue Chris@41: ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP` Chris@41: maj=`echo $ver | $VERSIONMKMAJ` Chris@41: min=`echo $ver | $VERSIONMKMIN` Chris@41: if test $maj -eq $majneeded -a $min -ge $minneeded; then Chris@41: ACLOCAL=$ac Chris@41: echo $ACLOCAL Chris@41: break Chris@41: fi Chris@41: done Chris@41: test -z $ACLOCAL && echo "no" Chris@41: fi Chris@41: test -z $AUTOMAKE || test -z $ACLOCAL && { Chris@41: echo Chris@41: echo "You must have automake installed to compile $package." Chris@41: echo "Download the appropriate package for your distribution," Chris@41: echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" Chris@41: exit 1 Chris@41: } Chris@41: fi Chris@41: Chris@41: echo -n "checking for libtool... " Chris@41: for LIBTOOLIZE in libtoolize glibtoolize nope; do Chris@41: ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break Chris@41: done Chris@41: if test x$LIBTOOLIZE = xnope; then Chris@41: echo "nope." Chris@41: LIBTOOLIZE=libtoolize Chris@41: else Chris@41: echo $LIBTOOLIZE Chris@41: fi Chris@41: ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { Chris@41: echo Chris@41: echo "You must have libtool installed to compile $package." Chris@41: echo "Download the appropriate package for your system," Chris@41: echo "or get the source from one of the GNU ftp sites" Chris@41: echo "listed in http://www.gnu.org/order/ftp.html" Chris@41: DIE=1 Chris@41: } Chris@41: Chris@41: if test "$DIE" -eq 1; then Chris@41: exit 1 Chris@41: fi Chris@41: Chris@41: if test -z "$*"; then Chris@41: echo "I am going to run ./configure with no arguments - if you wish " Chris@41: echo "to pass any to it, please specify them on the $0 command line." Chris@41: fi Chris@41: Chris@41: echo "Generating configuration files for $package, please wait...." Chris@41: Chris@41: echo " $ACLOCAL $ACLOCAL_FLAGS" Chris@41: $ACLOCAL $ACLOCAL_FLAGS || exit 1 Chris@41: echo " $LIBTOOLIZE --automake" Chris@41: $LIBTOOLIZE --automake || exit 1 Chris@41: echo " autoheader" Chris@41: autoheader || exit 1 Chris@41: echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS" Chris@41: $AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1 Chris@41: echo " autoconf" Chris@41: autoconf || exit 1 Chris@41: Chris@41: cd $olddir Chris@41: $srcdir/configure --enable-gcc-werror "$@" && echo