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