blob: 6b70b19acfab8bd690d5a7f8dc97b0a3672b84ec [file] [log] [blame]
Josh Coalson176eb562001-06-06 19:54:54 +00001#!/bin/sh
Josh Coalsonc7c1a8a2006-11-17 06:50:19 +00002# Run this to set up the build system: configure, makefiles, etc.
3# (based on the version in enlightenment's cvs)
Josh Coalson176eb562001-06-06 19:54:54 +00004
Josh Coalsonc7c1a8a2006-11-17 06:50:19 +00005package="flac"
Josh Coalson71fb9ff2002-12-03 06:29:10 +00006
Josh Coalsonc7c1a8a2006-11-17 06:50:19 +00007olddir=`pwd`
8srcdir=`dirname $0`
9test -z "$srcdir" && srcdir=.
10
11cd "$srcdir"
12DIE=0
13
Josh Coalson36b55272006-11-18 18:37:14 +000014ACLOCAL_FLAGS="-I m4 $ACLOCAL_FLAGS"
15
Josh Coalsonc7c1a8a2006-11-17 06:50:19 +000016echo "checking for autoconf... "
17(autoconf --version) < /dev/null > /dev/null 2>&1 || {
18 echo
19 echo "You must have autoconf installed to compile $package."
20 echo "Download the appropriate package for your distribution,"
21 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
22 DIE=1
23}
24
25VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
26VERSIONMKINT="sed -e s/[^0-9]//"
27
28# do we need automake?
29if test -r Makefile.am; then
30 AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am`
31 AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP`
32 if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then
33 AM_NEEDED=""
34 fi
35 if test -z $AM_NEEDED; then
36 echo -n "checking for automake... "
37 AUTOMAKE=automake
38 ACLOCAL=aclocal
39 if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
40 echo "yes"
41 else
42 echo "no"
43 AUTOMAKE=
44 fi
45 else
46 echo -n "checking for automake $AM_NEEDED or later... "
47 for am in automake-$AM_NEEDED automake$AM_NEEDED \
48 automake automake-1.7 automake-1.8 automake-1.9; do
49 ($am --version < /dev/null > /dev/null 2>&1) || continue
50 ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT`
51 verneeded=`echo $AM_NEEDED | $VERSIONMKINT`
52 if test $ver -ge $verneeded; then
53 AUTOMAKE=$am
54 echo $AUTOMAKE
55 break
56 fi
57 done
58 test -z $AUTOMAKE && echo "no"
59 echo -n "checking for aclocal $AM_NEEDED or later... "
60 for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED \
61 aclocal aclocal-1.7 aclocal-1.8 aclocal-1.9; do
62 ($ac --version < /dev/null > /dev/null 2>&1) || continue
63 ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT`
64 verneeded=`echo $AM_NEEDED | $VERSIONMKINT`
65 if test $ver -ge $verneeded; then
66 ACLOCAL=$ac
67 echo $ACLOCAL
68 break
69 fi
70 done
71 test -z $ACLOCAL && echo "no"
72 fi
73 test -z $AUTOMAKE || test -z $ACLOCAL && {
74 echo
75 echo "You must have automake installed to compile $package."
76 echo "Download the appropriate package for your distribution,"
77 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
78 exit 1
79 }
80fi
81
82echo -n "checking for libtool... "
83for LIBTOOLIZE in libtoolize glibtoolize nope; do
84 ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break
85done
86if test x$LIBTOOLIZE = xnope; then
87 echo "nope."
88 LIBTOOLIZE=libtoolize
89else
90 echo $LIBTOOLIZE
91fi
92($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
93 echo
94 echo "You must have libtool installed to compile $package."
95 echo "Download the appropriate package for your system,"
96 echo "or get the source from one of the GNU ftp sites"
97 echo "listed in http://www.gnu.org/order/ftp.html"
98 DIE=1
99}
100
101if test "$DIE" -eq 1; then
102 exit 1
103fi
104
105if test -z "$*"; then
106 echo "I am going to run ./configure with no arguments - if you wish "
107 echo "to pass any to it, please specify them on the $0 command line."
108fi
109
110echo "Generating configuration files for $package, please wait...."
111
112echo " $ACLOCAL $ACLOCAL_FLAGS"
113$ACLOCAL $ACLOCAL_FLAGS || exit 1
114echo " $LIBTOOLIZE --automake"
115$LIBTOOLIZE --automake || exit 1
116echo " autoheader"
117autoheader || exit 1
118echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS"
119$AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1
120echo " autoconf"
121autoconf || exit 1
122
123cd $olddir
124$srcdir/configure --enable-maintainer-mode "$@" && echo