chiark / gitweb /
tree-wide: sort includes in *.h
[elogind.git] / autogen.sh
1 #!/bin/sh
2
3 #  This file is part of systemd.
4 #
5 #  systemd is free software; you can redistribute it and/or modify it
6 #  under the terms of the GNU Lesser General Public License as published by
7 #  the Free Software Foundation; either version 2.1 of the License, or
8 #  (at your option) any later version.
9 #
10 #  systemd is distributed in the hope that it will be useful, but
11 #  WITHOUT ANY WARRANTY; without even the implied warranty of
12 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 #  Lesser General Public License for more details.
14 #
15 #  You should have received a copy of the GNU Lesser General Public License
16 #  along with systemd; If not, see <http://www.gnu.org/licenses/>.
17
18 set -e
19
20 oldpwd=$(pwd)
21 topdir=$(dirname $0)
22 cd $topdir
23
24 # We do not need this, we are not systemd upstream!
25 #if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then
26 #        # This part is allowed to fail
27 #        cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
28 #        chmod +x .git/hooks/pre-commit && \
29 #        echo "Activated pre-commit hook." || :
30 #fi
31
32 intltoolize --force --automake
33 autoreconf --force --install --symlink
34
35 libdir() {
36         echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd)
37 }
38
39 args="\
40 --sysconfdir=/etc \
41 --localstatedir=/var \
42 --libdir=$(libdir /usr/lib) \
43 "
44
45 if [ -f "$topdir/.config.args" ]; then
46         args="$args $(cat $topdir/.config.args)"
47 fi
48
49 if [ ! -L /bin ]; then
50 args="$args \
51 --with-rootprefix=/ \
52 --with-rootlibdir=$(libdir /lib) \
53 "
54 fi
55
56 cd $oldpwd
57
58 echo
59 echo "----------------------------------------------------------------"
60 echo "Initialized build system. For a common configuration please run:"
61 echo "----------------------------------------------------------------"
62 echo
63 echo "$topdir/configure CFLAGS='-g -O0 -ftrapv' --enable-kdbus $args"
64 echo