Let bootstrap.sh require version 1.10 of the various autofoo bits. Otherwise things...
[platform/upstream/pulseaudio.git] / bootstrap.sh
1 #!/bin/bash
2 # $Id$
3
4 # This file is part of PulseAudio.
5 #
6 # PulseAudio is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU Lesser General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # PulseAudio is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public License
17 # along with PulseAudio; if not, write to the Free Software Foundation,
18 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19
20 VERSION=1.10
21
22 run_versioned() {
23     local P
24     local V
25
26     V=$(echo "$2" | sed -e 's,\.,,g')
27     
28     if [ -e "`which $1$V 2> /dev/null`" ] ; then
29         P="$1$V" 
30     else
31         if [ -e "`which $1-$2 2> /dev/null`" ] ; then
32             P="$1-$2" 
33         else
34             P="$1"
35         fi
36     fi
37
38     shift 2
39     "$P" "$@"
40 }
41
42 set -ex
43
44 if [ "x$1" = "xam" ] ; then
45     run_versioned automake "$VERSION" -a -c --foreign
46     ./config.status
47 else 
48     rm -rf autom4te.cache
49     rm -f config.cache
50
51     touch config.rpath
52     test "x$LIBTOOLIZE" = "x" && LIBTOOLIZE=libtoolize
53
54     "$LIBTOOLIZE" -c --force --ltdl
55     run_versioned aclocal "$VERSION"
56     run_versioned autoconf 2.59 -Wall
57     run_versioned autoheader 2.59
58     run_versioned automake "$VERSION" --copy --foreign --add-missing
59
60     if test "x$NOCONFIGURE" = "x"; then
61         CFLAGS="-g -O0" ./configure --sysconfdir=/etc --localstatedir=/var --enable-force-preopen "$@" 
62         make clean
63     fi
64 fi