blob: 381f31c8839fb0157b0ffdb657d8f9d632bde8dc [file] [log] [blame]
Sebastien Estiennefa3d2c42005-10-23 15:58:47 +00001#!/bin/sh
Sebastien Estiennefa3d2c42005-10-23 15:58:47 +00002
3# This file is part of libdaemon.
4#
Lennart Poettering7892e9b2008-07-28 20:50:57 +02005# Copyright 2003-2008 Lennart Poettering
6#
Brandon Philips0630da02012-08-29 17:42:24 -07007# 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 Estiennefa3d2c42005-10-23 15:58:47 +000013#
Brandon Philips0630da02012-08-29 17:42:24 -070014# The above copyright notice and this permission notice shall be included in
15# all copies or substantial portions of the Software.
Sebastien Estiennefa3d2c42005-10-23 15:58:47 +000016#
Brandon Philips0630da02012-08-29 17:42:24 -070017# 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 Estiennefa3d2c42005-10-23 15:58:47 +000024
25VERSION=1.9
26
27run_versioned() {
28 local P
29 local V
30
31 V=$(echo "$2" | sed -e 's,\.,,g')
Lennart Poetteringebe00d62008-07-28 20:35:53 +020032
33 if [ -e "`which $1$V 2> /dev/null`" ] ; then
34 P="$1$V"
Sebastien Estiennefa3d2c42005-10-23 15:58:47 +000035 else
Lennart Poetteringebe00d62008-07-28 20:35:53 +020036 if [ -e "`which $1-$2 2> /dev/null`" ] ; then
37 P="$1-$2"
Sebastien Estiennea6a50fc2005-10-23 16:10:31 +000038 else
39 P="$1"
40 fi
Sebastien Estiennefa3d2c42005-10-23 15:58:47 +000041 fi
42
43 shift 2
44 "$P" "$@"
45}
46
47set -ex
48
49if [ "x$1" = "xam" ] ; then
50 run_versioned automake "$VERSION" -a -c --foreign
51 ./config.status
Lennart Poetteringebe00d62008-07-28 20:35:53 +020052else
Sebastien Estiennefa3d2c42005-10-23 15:58:47 +000053 rm -rf autom4te.cache
54 rm -f config.cache
55
Lennart Poetteringebe00d62008-07-28 20:35:53 +020056 touch config.rpath
Sebastien Estiennefa3d2c42005-10-23 15:58:47 +000057 test "x$LIBTOOLIZE" = "x" && LIBTOOLIZE=libtoolize
58
Lennart Poettering693536c2008-06-18 03:25:08 +020059 mkdir -p common
60
Lennart Poetteringebe00d62008-07-28 20:35:53 +020061 "$LIBTOOLIZE" -c --force
Diego Elio 'Flameeyes' Pettenò6c3cb8e2008-12-04 21:42:21 +010062 run_versioned aclocal "$VERSION" -I m4
Sebastien Estiennefa3d2c42005-10-23 15:58:47 +000063 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 Poetteringebe00d62008-07-28 20:35:53 +020068 CFLAGS="-g -O0" ./configure --sysconfdir=/etc --localstatedir=/var "$@"
Sebastien Estiennefa3d2c42005-10-23 15:58:47 +000069 make clean
70 fi
71fi