vorbis:
[platform/upstream/libvorbis.git] / autogen.sh
1 #!/bin/sh
2 # Run this to set up the build system: configure, makefiles, etc.
3 # (based on the version in enlightenment's cvs)
4
5 package="vorbis"
6
7 olddir=`pwd`
8 srcdir=`dirname $0`
9 test -z "$srcdir" && srcdir=.
10
11 cd "$srcdir"
12 DIE=0
13
14 echo "checking for autoconf... "
15 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
16         echo
17         echo "You must have autoconf installed to compile $package."
18         echo "Download the appropriate package for your distribution,"
19         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
20         DIE=1
21 }
22
23 echo "checking for automake... "
24 (automake --version) < /dev/null > /dev/null 2>&1 || {
25         echo
26         echo "You must have automake installed to compile $package."
27         echo "Download the appropriate package for your system,"
28         echo "or get the source from one of the GNU ftp sites"
29         echo "listed in http://www.gnu.org/order/ftp.html"
30         DIE=1
31 }
32
33 echo -n "checking for libtool... "
34 for LIBTOOLIZE in libtoolize glibtoolize nope; do
35   (type $LIBTOOLIZE) > /dev/null 2>&1 && break
36 done
37 if test x$LIBTOOLIZE = xnope; then
38   echo "nope."
39   LIBTOOLIZE=libtoolize
40 else
41   echo $LIBTOOLIZE
42 fi
43 ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
44         echo
45         echo "You must have libtool installed to compile $package."
46         echo "Download the appropriate package for your system,"
47         echo "or get the source from one of the GNU ftp sites"
48         echo "listed in http://www.gnu.org/order/ftp.html"
49         DIE=1
50 }
51
52 if test "$DIE" -eq 1; then
53         exit 1
54 fi
55
56 if test -z "$*"; then
57         echo "I am going to run ./configure with no arguments - if you wish "
58         echo "to pass any to it, please specify them on the $0 command line."
59 fi
60
61 echo "Generating configuration files for $package, please wait...."
62
63 echo "  aclocal $ACLOCAL_FLAGS"
64 aclocal $ACLOCAL_FLAGS || exit 1
65 echo "  autoheader"
66 autoheader || exit 1
67 echo "  $LIBTOOLIZE --automake"
68 $LIBTOOLIZE --automake || exit 1
69 echo "  automake --add-missing $AUTOMAKE_FLAGS"
70 automake --add-missing $AUTOMAKE_FLAGS || exit 1
71 echo "  autoconf"
72 autoconf || exit 1
73
74 cd $olddir
75 $srcdir/configure "$@" && echo