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