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