Code

14a941b052c373349feb72c55a603feccec9e08e
[fusedav.git] / bootstrap.sh
1 #!/bin/bash
2 # $Id$
4 # Copyright (c) 2004-2006 Lennart Poettering
5 #
6 # Permission is hereby granted, free of charge, to any person
7 # obtaining a copy of this software and associated documentation files
8 # (the "Software"), to deal in the Software without restriction,
9 # including without limitation the rights to use, copy, modify, merge,
10 # publish, distribute, sublicense, and/or sell copies of the Software,
11 # and to permit persons to whom the Software is furnished to do so,
12 # subject to the following conditions:
13 #
14 # The above copyright notice and this permission notice shall be
15 # included in all copies or substantial portions of the Software.
16 #
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
21 # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22 # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 # SOFTWARE.
26 VERSION=1.9
28 run_versioned() {
29     local P
30     local V
32     V=$(echo "$2" | sed -e 's,\.,,g')
34     if [ -e "`which $1$V`" ] ; then
35         P="$1$V"
36     else
37         if [ -e "`which $1-$2`" ] ; then
38             P="$1-$2"
39         else
40             P="$1"
41         fi
42     fi
44     shift 2
45     "$P" "$@"
46 }
48 set -ex
50 if [ "x$1" = "xam" ] ; then
51     run_versioned automake "$VERSION" -a -c --foreign
52     ./config.status
53 else
54     rm -rf autom4te.cache
55     rm -f config.cache
57     run_versioned aclocal "$VERSION"
58     run_versioned autoconf 2.59 -Wall
59     run_versioned autoheader 2.59
60     run_versioned automake "$VERSION" -a -c --foreign
62     if test "x$NOCONFIGURE" = "x"; then
63         CFLAGS="-g -O0" ./configure --sysconfdir=/etc "$@"
64         make clean
65     fi
66 fi