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