Josh Coalson | 176eb56 | 2001-06-06 19:54:54 +0000 | [diff] [blame] | 1 | #!/bin/sh |
Josh Coalson | c7c1a8a | 2006-11-17 06:50:19 +0000 | [diff] [blame] | 2 | # Run this to set up the build system: configure, makefiles, etc. |
| 3 | # (based on the version in enlightenment's cvs) |
Josh Coalson | 176eb56 | 2001-06-06 19:54:54 +0000 | [diff] [blame] | 4 | |
Josh Coalson | 1fd370b | 2006-11-21 01:40:57 +0000 | [diff] [blame] | 5 | # Some notes: |
| 6 | # |
| 7 | # You may need to specify -I /SOME_PATH/share/aclocal in ACLOCAL_FLAGS |
| 8 | # if any packages FLAC relies on (autotools, libogg, libiconv) are |
| 9 | # installed in non-standard places. |
| 10 | # |
| 11 | # If you don't have XMMS installed at all, you should comment out |
| 12 | # AM_PATH_XMMS in configure.in. |
| 13 | # |
| 14 | # FLAC uses iconv but not gettext. iconv requires config.rpath which |
| 15 | # is supplied by gettext, which is copied in by gettextize. But we |
| 16 | # can't run gettextize since we do not fulfill all it's requirements |
| 17 | # (because we don't use it). So you may have to: |
| 18 | # |
| 19 | # cp /usr/share/gettext/config.rpath . |
| 20 | # |
| 21 | # before running autogen.sh |
| 22 | # |
| 23 | # Also watchout, if you replace ltmain.sh, there is a bug in some |
| 24 | # versions of libtool (or maybe autoconf) on some platforms where the |
| 25 | # configure-generated libtool does not have $SED defined. See also: |
| 26 | # |
| 27 | # http://lists.gnu.org/archive/html/libtool/2003-11/msg00131.html |
| 28 | |
Josh Coalson | c7c1a8a | 2006-11-17 06:50:19 +0000 | [diff] [blame] | 29 | package="flac" |
Josh Coalson | 71fb9ff | 2002-12-03 06:29:10 +0000 | [diff] [blame] | 30 | |
Josh Coalson | c7c1a8a | 2006-11-17 06:50:19 +0000 | [diff] [blame] | 31 | olddir=`pwd` |
| 32 | srcdir=`dirname $0` |
| 33 | test -z "$srcdir" && srcdir=. |
| 34 | |
| 35 | cd "$srcdir" |
| 36 | DIE=0 |
| 37 | |
Josh Coalson | 36b5527 | 2006-11-18 18:37:14 +0000 | [diff] [blame] | 38 | ACLOCAL_FLAGS="-I m4 $ACLOCAL_FLAGS" |
| 39 | |
Josh Coalson | c7c1a8a | 2006-11-17 06:50:19 +0000 | [diff] [blame] | 40 | echo "checking for autoconf... " |
| 41 | (autoconf --version) < /dev/null > /dev/null 2>&1 || { |
| 42 | echo |
| 43 | echo "You must have autoconf installed to compile $package." |
| 44 | echo "Download the appropriate package for your distribution," |
| 45 | echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" |
| 46 | DIE=1 |
| 47 | } |
| 48 | |
| 49 | VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/" |
| 50 | VERSIONMKINT="sed -e s/[^0-9]//" |
| 51 | |
| 52 | # do we need automake? |
| 53 | if test -r Makefile.am; then |
| 54 | AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am` |
| 55 | AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP` |
| 56 | if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then |
| 57 | AM_NEEDED="" |
| 58 | fi |
| 59 | if test -z $AM_NEEDED; then |
| 60 | echo -n "checking for automake... " |
| 61 | AUTOMAKE=automake |
| 62 | ACLOCAL=aclocal |
| 63 | if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then |
| 64 | echo "yes" |
| 65 | else |
| 66 | echo "no" |
| 67 | AUTOMAKE= |
| 68 | fi |
| 69 | else |
| 70 | echo -n "checking for automake $AM_NEEDED or later... " |
| 71 | for am in automake-$AM_NEEDED automake$AM_NEEDED \ |
| 72 | automake automake-1.7 automake-1.8 automake-1.9; do |
| 73 | ($am --version < /dev/null > /dev/null 2>&1) || continue |
| 74 | ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT` |
| 75 | verneeded=`echo $AM_NEEDED | $VERSIONMKINT` |
| 76 | if test $ver -ge $verneeded; then |
| 77 | AUTOMAKE=$am |
| 78 | echo $AUTOMAKE |
| 79 | break |
| 80 | fi |
| 81 | done |
| 82 | test -z $AUTOMAKE && echo "no" |
| 83 | echo -n "checking for aclocal $AM_NEEDED or later... " |
| 84 | for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED \ |
| 85 | aclocal aclocal-1.7 aclocal-1.8 aclocal-1.9; do |
| 86 | ($ac --version < /dev/null > /dev/null 2>&1) || continue |
| 87 | ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT` |
| 88 | verneeded=`echo $AM_NEEDED | $VERSIONMKINT` |
| 89 | if test $ver -ge $verneeded; then |
| 90 | ACLOCAL=$ac |
| 91 | echo $ACLOCAL |
| 92 | break |
| 93 | fi |
| 94 | done |
| 95 | test -z $ACLOCAL && echo "no" |
| 96 | fi |
| 97 | test -z $AUTOMAKE || test -z $ACLOCAL && { |
| 98 | echo |
| 99 | echo "You must have automake installed to compile $package." |
| 100 | echo "Download the appropriate package for your distribution," |
| 101 | echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" |
| 102 | exit 1 |
| 103 | } |
| 104 | fi |
| 105 | |
| 106 | echo -n "checking for libtool... " |
| 107 | for LIBTOOLIZE in libtoolize glibtoolize nope; do |
| 108 | ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break |
| 109 | done |
| 110 | if test x$LIBTOOLIZE = xnope; then |
| 111 | echo "nope." |
| 112 | LIBTOOLIZE=libtoolize |
| 113 | else |
| 114 | echo $LIBTOOLIZE |
| 115 | fi |
| 116 | ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { |
| 117 | echo |
| 118 | echo "You must have libtool installed to compile $package." |
| 119 | echo "Download the appropriate package for your system," |
| 120 | echo "or get the source from one of the GNU ftp sites" |
| 121 | echo "listed in http://www.gnu.org/order/ftp.html" |
| 122 | DIE=1 |
| 123 | } |
| 124 | |
| 125 | if test "$DIE" -eq 1; then |
| 126 | exit 1 |
| 127 | fi |
| 128 | |
| 129 | if test -z "$*"; then |
| 130 | echo "I am going to run ./configure with no arguments - if you wish " |
| 131 | echo "to pass any to it, please specify them on the $0 command line." |
| 132 | fi |
| 133 | |
| 134 | echo "Generating configuration files for $package, please wait...." |
| 135 | |
| 136 | echo " $ACLOCAL $ACLOCAL_FLAGS" |
| 137 | $ACLOCAL $ACLOCAL_FLAGS || exit 1 |
| 138 | echo " $LIBTOOLIZE --automake" |
| 139 | $LIBTOOLIZE --automake || exit 1 |
| 140 | echo " autoheader" |
| 141 | autoheader || exit 1 |
| 142 | echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS" |
| 143 | $AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1 |
| 144 | echo " autoconf" |
| 145 | autoconf || exit 1 |
| 146 | |
| 147 | cd $olddir |
| 148 | $srcdir/configure --enable-maintainer-mode "$@" && echo |