]>
Commit | Line | Data |
---|---|---|
72d25fd9 | 1 | #!/bin/sh |
47be870b LP |
2 | |
3 | # This file is part of systemd. | |
4 | # | |
47be870b | 5 | # systemd is free software; you can redistribute it and/or modify it |
5430f7f2 LP |
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 | |
47be870b LP |
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 | |
5430f7f2 | 13 | # Lesser General Public License for more details. |
47be870b | 14 | # |
5430f7f2 | 15 | # You should have received a copy of the GNU Lesser General Public License |
47be870b LP |
16 | # along with systemd; If not, see <http://www.gnu.org/licenses/>. |
17 | ||
2fd8b540 ZJS |
18 | set -e |
19 | ||
0f62019c SW |
20 | oldpwd=$(pwd) |
21 | topdir=$(dirname $0) | |
22 | cd $topdir | |
23 | ||
72d25fd9 MM |
24 | if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then |
25 | # This part is allowed to fail | |
843605d3 LP |
26 | cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \ |
27 | chmod +x .git/hooks/pre-commit && \ | |
72d25fd9 | 28 | echo "Activated pre-commit hook." || : |
47be870b LP |
29 | fi |
30 | ||
6bd9fe5a KS |
31 | intltoolize --force --automake |
32 | autoreconf --force --install --symlink | |
33 | ||
ae446765 | 34 | libdir() { |
72d25fd9 | 35 | echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd) |
ae446765 KS |
36 | } |
37 | ||
6bd9fe5a | 38 | args="\ |
6bd9fe5a KS |
39 | --sysconfdir=/etc \ |
40 | --localstatedir=/var \ | |
41 | --libdir=$(libdir /usr/lib) \ | |
23756070 | 42 | " |
6bd9fe5a | 43 | |
9a20fcbc DH |
44 | if [ -f "$topdir/.config.args" ]; then |
45 | args="$args $(cat $topdir/.config.args)" | |
46 | fi | |
47 | ||
772f4698 KS |
48 | if [ ! -L /bin ]; then |
49 | args="$args \ | |
759b98c5 | 50 | --with-rootprefix=/ \ |
772f4698 KS |
51 | --with-rootlibdir=$(libdir /lib) \ |
52 | " | |
53 | fi | |
54 | ||
0f62019c SW |
55 | cd $oldpwd |
56 | ||
72d25fd9 | 57 | if [ "x$1" = "xc" ]; then |
4de282cf | 58 | $topdir/configure CFLAGS='-g -O0 -ftrapv' --enable-kdbus $args |
0fc6e1ed LP |
59 | make clean |
60 | elif [ "x$1" = "xg" ]; then | |
4de282cf | 61 | $topdir/configure CFLAGS='-g -Og -ftrapv' --enable-kdbus $args |
843605d3 | 62 | make clean |
25ad8664 | 63 | elif [ "x$1" = "xa" ]; then |
4de282cf | 64 | $topdir/configure CFLAGS='-g -O0 -Wsuggest-attribute=pure -Wsuggest-attribute=const -ftrapv' --enable-kdbus $args |
25ad8664 | 65 | make clean |
bd3539b2 | 66 | elif [ "x$1" = "xl" ]; then |
4de282cf | 67 | $topdir/configure CC=clang CFLAGS='-g -O0 -ftrapv' --enable-kdbus $args |
bd3539b2 | 68 | make clean |
a8c78dec | 69 | elif [ "x$1" = "xs" ]; then |
5985ea4d | 70 | scan-build $topdir/configure CFLAGS='-std=gnu99 -g -O0 -ftrapv' --enable-kdbus $args |
a8c78dec | 71 | scan-build make |
843605d3 LP |
72 | else |
73 | echo | |
74 | echo "----------------------------------------------------------------" | |
75 | echo "Initialized build system. For a common configuration please run:" | |
76 | echo "----------------------------------------------------------------" | |
77 | echo | |
4de282cf | 78 | echo "$topdir/configure CFLAGS='-g -O0 -ftrapv' --enable-kdbus $args" |
843605d3 | 79 | echo |
47be870b | 80 | fi |