cannam@86: #!/bin/sh cannam@86: # Run this to set up the build system: configure, makefiles, etc. cannam@86: # (based on the version in enlightenment's cvs) cannam@86: cannam@86: # Some notes: cannam@86: # cannam@86: # You may need to specify -I /SOME_PATH/share/aclocal in ACLOCAL_FLAGS cannam@86: # if any packages FLAC relies on (autotools, libogg, libiconv) are cannam@86: # installed in non-standard places. cannam@86: # cannam@86: # If you don't have XMMS installed at all, you should comment out cannam@86: # AM_PATH_XMMS in configure.in. cannam@86: # cannam@86: # FLAC uses iconv but not gettext. iconv requires config.rpath which cannam@86: # is supplied by gettext, which is copied in by gettextize. But we cannam@86: # can't run gettextize since we do not fulfill all it's requirements cannam@86: # (because we don't use it). So you may have to: cannam@86: # cannam@86: # cp /usr/share/gettext/config.rpath . cannam@86: # cannam@86: # before running autogen.sh cannam@86: # cannam@86: # If you are running on OS X and get errors related to the AM_ICONV cannam@86: # and/or AM_LANGINFO_CODESET macros, replace those 2 lines in cannam@86: # configure.in with cannam@86: # cannam@86: # AC_DEFINE([HAVE_ICONV], [], [Whether we have libiconv available]) LIBICONV="-liconv" cannam@86: # AC_SUBST(LIBICONV) cannam@86: # cannam@86: # See also http://lists.xiph.org/pipermail/flac-dev/2007-September/002384.html cannam@86: # cannam@86: # Also watchout, if you replace ltmain.sh, there is a bug in some cannam@86: # versions of libtool (or maybe autoconf) on some platforms where the cannam@86: # configure-generated libtool does not have $SED defined. See also: cannam@86: # cannam@86: # http://lists.gnu.org/archive/html/libtool/2003-11/msg00131.html cannam@86: cannam@86: package="flac" cannam@86: cannam@86: olddir=`pwd` cannam@86: srcdir=`dirname $0` cannam@86: test -z "$srcdir" && srcdir=. cannam@86: cannam@86: cd "$srcdir" cannam@86: DIE=0 cannam@86: cannam@86: ACLOCAL_FLAGS="-I m4 $ACLOCAL_FLAGS" cannam@86: cannam@86: echo "checking for autoconf... " cannam@86: (autoconf --version) < /dev/null > /dev/null 2>&1 || { cannam@86: echo cannam@86: echo "You must have autoconf installed to compile $package." cannam@86: echo "Download the appropriate package for your distribution," cannam@86: echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" cannam@86: DIE=1 cannam@86: } cannam@86: cannam@86: VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/" cannam@86: VERSIONMKMAJ="sed -e s/\([0-9][0-9]*\)[^0-9].*/\\1/" cannam@86: VERSIONMKMIN="sed -e s/.*[0-9][0-9]*\.//" cannam@86: cannam@86: # do we need automake? cannam@86: if test -r Makefile.am; then cannam@86: AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am` cannam@86: AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP` cannam@86: if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then cannam@86: AM_NEEDED="" cannam@86: fi cannam@86: if test -z $AM_NEEDED; then cannam@86: echo -n "checking for automake... " cannam@86: AUTOMAKE=automake cannam@86: ACLOCAL=aclocal cannam@86: if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then cannam@86: echo "yes" cannam@86: else cannam@86: echo "no" cannam@86: AUTOMAKE= cannam@86: fi cannam@86: else cannam@86: echo -n "checking for automake $AM_NEEDED or later... " cannam@86: majneeded=`echo $AM_NEEDED | $VERSIONMKMAJ` cannam@86: minneeded=`echo $AM_NEEDED | $VERSIONMKMIN` cannam@86: for am in automake-$AM_NEEDED automake$AM_NEEDED \ cannam@86: automake automake-1.7 automake-1.8 automake-1.9 automake-1.10; do cannam@86: ($am --version < /dev/null > /dev/null 2>&1) || continue cannam@86: ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP` cannam@86: maj=`echo $ver | $VERSIONMKMAJ` cannam@86: min=`echo $ver | $VERSIONMKMIN` cannam@86: if test $maj -eq $majneeded -a $min -ge $minneeded; then cannam@86: AUTOMAKE=$am cannam@86: echo $AUTOMAKE cannam@86: break cannam@86: fi cannam@86: done cannam@86: test -z $AUTOMAKE && echo "no" cannam@86: echo -n "checking for aclocal $AM_NEEDED or later... " cannam@86: for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED \ cannam@86: aclocal aclocal-1.7 aclocal-1.8 aclocal-1.9 aclocal-1.10; do cannam@86: ($ac --version < /dev/null > /dev/null 2>&1) || continue cannam@86: ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP` cannam@86: maj=`echo $ver | $VERSIONMKMAJ` cannam@86: min=`echo $ver | $VERSIONMKMIN` cannam@86: if test $maj -eq $majneeded -a $min -ge $minneeded; then cannam@86: ACLOCAL=$ac cannam@86: echo $ACLOCAL cannam@86: break cannam@86: fi cannam@86: done cannam@86: test -z $ACLOCAL && echo "no" cannam@86: fi cannam@86: test -z $AUTOMAKE || test -z $ACLOCAL && { cannam@86: echo cannam@86: echo "You must have automake installed to compile $package." cannam@86: echo "Download the appropriate package for your distribution," cannam@86: echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" cannam@86: exit 1 cannam@86: } cannam@86: fi cannam@86: cannam@86: echo -n "checking for libtool... " cannam@86: for LIBTOOLIZE in libtoolize glibtoolize nope; do cannam@86: ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break cannam@86: done cannam@86: if test x$LIBTOOLIZE = xnope; then cannam@86: echo "nope." cannam@86: LIBTOOLIZE=libtoolize cannam@86: else cannam@86: echo $LIBTOOLIZE cannam@86: fi cannam@86: ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { cannam@86: echo cannam@86: echo "You must have libtool installed to compile $package." cannam@86: echo "Download the appropriate package for your system," cannam@86: echo "or get the source from one of the GNU ftp sites" cannam@86: echo "listed in http://www.gnu.org/order/ftp.html" cannam@86: DIE=1 cannam@86: } cannam@86: cannam@86: if test "$DIE" -eq 1; then cannam@86: exit 1 cannam@86: fi cannam@86: cannam@86: if test -z "$*"; then cannam@86: echo "I am going to run ./configure with no arguments - if you wish " cannam@86: echo "to pass any to it, please specify them on the $0 command line." cannam@86: fi cannam@86: cannam@86: echo "Generating configuration files for $package, please wait...." cannam@86: cannam@86: echo " $ACLOCAL $ACLOCAL_FLAGS" cannam@86: $ACLOCAL $ACLOCAL_FLAGS || exit 1 cannam@86: echo " $LIBTOOLIZE --automake" cannam@86: $LIBTOOLIZE --automake || exit 1 cannam@86: echo " autoheader" cannam@86: autoheader || exit 1 cannam@86: echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS" cannam@86: $AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1 cannam@86: echo " autoconf" cannam@86: autoconf || exit 1 cannam@86: cannam@86: cd $olddir cannam@86: $srcdir/configure --enable-maintainer-mode "$@" && echo