]> git.ipfire.org Git - thirdparty/systemd.git/blame - autogen.sh
shutdown: initialize the controlling terminal
[thirdparty/systemd.git] / autogen.sh
CommitLineData
47be870b
LP
1#!/bin/bash
2
3# This file is part of systemd.
4#
5# Copyright 2010 Lennart Poettering
6#
7# systemd is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# systemd is distributed in the hope that it will be useful, but
13# WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15# General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with systemd; If not, see <http://www.gnu.org/licenses/>.
19
20AM_VERSION=1.11
21AC_VERSION=2.63
22
23run_versioned() {
24 local P
25 local V
26
27 V=$(echo "$2" | sed -e 's,\.,,g')
28
29 if [ -e "`which $1$V 2> /dev/null`" ] ; then
30 P="$1$V"
31 else
32 if [ -e "`which $1-$2 2> /dev/null`" ] ; then
33 P="$1-$2"
34 else
35 P="$1"
36 fi
37 fi
38
39 shift 2
40 "$P" "$@"
41}
42
43set -ex
44
45if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
46 cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
47 chmod +x .git/hooks/pre-commit && \
48 echo "Activated pre-commit hook."
49fi
50
47be870b
LP
51if type -p colorgcc > /dev/null ; then
52 export CC=colorgcc
53fi
54
ae446765
KS
55libdir() {
56 echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
57}
58
47be870b 59if [ "x$1" = "xam" ] ; then
6398bea5 60 run_versioned automake "$AM_VERSION" -a -c --foreign
47be870b
LP
61 ./config.status
62else
63 rm -rf autom4te.cache
64 rm -f config.cache
65
139be57d 66 libtoolize -c --force
1c7dde3e 67 intltoolize -c -f
47be870b
LP
68 run_versioned aclocal "$AM_VERSION" -I m4
69 run_versioned autoconf "$AC_VERSION" -Wall
70 run_versioned autoheader "$AC_VERSION"
71 run_versioned automake "$AM_VERSION" --copy --foreign --add-missing
72
73 if [ "x$1" != "xac" ]; then
ae446765
KS
74 CFLAGS="$CFLAGS -g -O0" ./configure \
75 --sysconfdir=/etc \
76 --localstatedir=/var \
77 --libexecdir=/usr/lib \
78 --libdir=$(libdir /usr/local/lib) \
79 --with-rootdir= \
80 "$@"
47be870b
LP
81 make clean
82 fi
83fi