fix autogen.sh so that builddir != srcdir works
[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 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
15         echo
16         echo "You must have autoconf installed to compile $package."
17         echo "Download the appropriate package for your distribution,"
18         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
19         DIE=1
20 }
21
22 (automake --version) < /dev/null > /dev/null 2>&1 || {
23         echo
24         echo "You must have automake installed to compile $package."
25         echo "Download the appropriate package for your system,"
26         echo "or get the source from one of the GNU ftp sites"
27         echo "listed in http://www.gnu.org/order/ftp.html"
28         DIE=1
29 }
30
31 (libtoolize --version) < /dev/null > /dev/null 2>&1 || {
32         echo
33         echo "You must have libtool installed to compile $package."
34         echo "Download the appropriate package for your system,"
35         echo "or get the source from one of the GNU ftp sites"
36         echo "listed in http://www.gnu.org/order/ftp.html"
37         DIE=1
38 }
39
40 if test "$DIE" -eq 1; then
41         exit 1
42 fi
43
44 if test -z "$*"; then
45         echo "I am going to run ./configure with no arguments - if you wish "
46         echo "to pass any to it, please specify them on the $0 command line."
47 fi
48
49 echo "Generating configuration files for $package, please wait...."
50
51 echo "  aclocal $ACLOCAL_FLAGS"
52 aclocal $ACLOCAL_FLAGS
53 #echo "  autoheader"
54 #autoheader
55 echo "  libtoolize --automake"
56 libtoolize --automake
57 echo "  automake --add-missing $AUTOMAKE_FLAGS"
58 automake --add-missing $AUTOMAKE_FLAGS 
59 echo "  autoconf"
60 autoconf
61
62 cd $olddir
63 $srcdir/configure "$@" && echo