Sebastien Estienne | fa3d2c4 | 2005-10-23 15:58:47 +0000 | [diff] [blame] | 1 | #!/bin/sh |
Sebastien Estienne | fa3d2c4 | 2005-10-23 15:58:47 +0000 | [diff] [blame] | 2 | |
| 3 | # This file is part of libdaemon. |
| 4 | # |
Lennart Poettering | 7892e9b | 2008-07-28 20:50:57 +0200 | [diff] [blame] | 5 | # Copyright 2003-2008 Lennart Poettering |
| 6 | # |
Brandon Philips | 0630da0 | 2012-08-29 17:42:24 -0700 | [diff] [blame] | 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | # of this software and associated documentation files (the "Software"), to deal |
| 9 | # in the Software without restriction, including without limitation the rights |
| 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | # copies of the Software, and to permit persons to whom the Software is |
| 12 | # furnished to do so, subject to the following conditions: |
Sebastien Estienne | fa3d2c4 | 2005-10-23 15:58:47 +0000 | [diff] [blame] | 13 | # |
Brandon Philips | 0630da0 | 2012-08-29 17:42:24 -0700 | [diff] [blame] | 14 | # The above copyright notice and this permission notice shall be included in |
| 15 | # all copies or substantial portions of the Software. |
Sebastien Estienne | fa3d2c4 | 2005-10-23 15:58:47 +0000 | [diff] [blame] | 16 | # |
Brandon Philips | 0630da0 | 2012-08-29 17:42:24 -0700 | [diff] [blame] | 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | # SOFTWARE. |
Sebastien Estienne | fa3d2c4 | 2005-10-23 15:58:47 +0000 | [diff] [blame] | 24 | |
| 25 | VERSION=1.9 |
| 26 | |
| 27 | run_versioned() { |
| 28 | local P |
| 29 | local V |
| 30 | |
| 31 | V=$(echo "$2" | sed -e 's,\.,,g') |
Lennart Poettering | ebe00d6 | 2008-07-28 20:35:53 +0200 | [diff] [blame] | 32 | |
| 33 | if [ -e "`which $1$V 2> /dev/null`" ] ; then |
| 34 | P="$1$V" |
Sebastien Estienne | fa3d2c4 | 2005-10-23 15:58:47 +0000 | [diff] [blame] | 35 | else |
Lennart Poettering | ebe00d6 | 2008-07-28 20:35:53 +0200 | [diff] [blame] | 36 | if [ -e "`which $1-$2 2> /dev/null`" ] ; then |
| 37 | P="$1-$2" |
Sebastien Estienne | a6a50fc | 2005-10-23 16:10:31 +0000 | [diff] [blame] | 38 | else |
| 39 | P="$1" |
| 40 | fi |
Sebastien Estienne | fa3d2c4 | 2005-10-23 15:58:47 +0000 | [diff] [blame] | 41 | fi |
| 42 | |
| 43 | shift 2 |
| 44 | "$P" "$@" |
| 45 | } |
| 46 | |
| 47 | set -ex |
| 48 | |
| 49 | if [ "x$1" = "xam" ] ; then |
| 50 | run_versioned automake "$VERSION" -a -c --foreign |
| 51 | ./config.status |
Lennart Poettering | ebe00d6 | 2008-07-28 20:35:53 +0200 | [diff] [blame] | 52 | else |
Sebastien Estienne | fa3d2c4 | 2005-10-23 15:58:47 +0000 | [diff] [blame] | 53 | rm -rf autom4te.cache |
| 54 | rm -f config.cache |
| 55 | |
Lennart Poettering | ebe00d6 | 2008-07-28 20:35:53 +0200 | [diff] [blame] | 56 | touch config.rpath |
Sebastien Estienne | fa3d2c4 | 2005-10-23 15:58:47 +0000 | [diff] [blame] | 57 | test "x$LIBTOOLIZE" = "x" && LIBTOOLIZE=libtoolize |
| 58 | |
Lennart Poettering | 693536c | 2008-06-18 03:25:08 +0200 | [diff] [blame] | 59 | mkdir -p common |
| 60 | |
Lennart Poettering | ebe00d6 | 2008-07-28 20:35:53 +0200 | [diff] [blame] | 61 | "$LIBTOOLIZE" -c --force |
Diego Elio 'Flameeyes' Pettenò | 6c3cb8e | 2008-12-04 21:42:21 +0100 | [diff] [blame] | 62 | run_versioned aclocal "$VERSION" -I m4 |
Sebastien Estienne | fa3d2c4 | 2005-10-23 15:58:47 +0000 | [diff] [blame] | 63 | run_versioned autoconf 2.59 -Wall |
| 64 | run_versioned autoheader 2.59 |
| 65 | run_versioned automake "$VERSION" -a -c --foreign |
| 66 | |
| 67 | if test "x$NOCONFIGURE" = "x"; then |
Lennart Poettering | ebe00d6 | 2008-07-28 20:35:53 +0200 | [diff] [blame] | 68 | CFLAGS="-g -O0" ./configure --sysconfdir=/etc --localstatedir=/var "$@" |
Sebastien Estienne | fa3d2c4 | 2005-10-23 15:58:47 +0000 | [diff] [blame] | 69 | make clean |
| 70 | fi |
| 71 | fi |