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