]>
Commit | Line | Data |
---|---|---|
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 | if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then | |
25 | # This part is allowed to fail | |
26 | cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \ | |
27 | chmod +x .git/hooks/pre-commit && \ | |
28 | echo "Activated pre-commit hook." || : | |
29 | fi | |
30 | ||
31 | intltoolize --force --automake | |
32 | autoreconf --force --install --symlink | |
33 | ||
34 | libdir() { | |
35 | echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd) | |
36 | } | |
37 | ||
38 | args="\ | |
39 | --sysconfdir=/etc \ | |
40 | --localstatedir=/var \ | |
41 | --libdir=$(libdir /usr/lib) \ | |
42 | " | |
43 | ||
44 | if [ -f "$topdir/.config.args" ]; then | |
45 | args="$args $(cat $topdir/.config.args)" | |
46 | fi | |
47 | ||
48 | if [ ! -L /bin ]; then | |
49 | args="$args \ | |
50 | --with-rootprefix=/ \ | |
51 | --with-rootlibdir=$(libdir /lib) \ | |
52 | " | |
53 | fi | |
54 | ||
55 | cd $oldpwd | |
56 | ||
57 | if [ "x$1" = "xc" ]; then | |
58 | $topdir/configure CFLAGS='-g -O0 -ftrapv' --enable-compat-libs --enable-kdbus $args | |
59 | make clean | |
60 | elif [ "x$1" = "xg" ]; then | |
61 | $topdir/configure CFLAGS='-g -Og -ftrapv' --enable-compat-libs --enable-kdbus $args | |
62 | make clean | |
63 | elif [ "x$1" = "xa" ]; then | |
64 | $topdir/configure CFLAGS='-g -O0 -Wsuggest-attribute=pure -Wsuggest-attribute=const -ftrapv' --enable-compat-libs --enable-kdbus $args | |
65 | make clean | |
66 | elif [ "x$1" = "xl" ]; then | |
67 | $topdir/configure CC=clang CFLAGS='-g -O0 -ftrapv' --enable-compat-libs --enable-kdbus $args | |
68 | make clean | |
69 | elif [ "x$1" = "xs" ]; then | |
70 | scan-build $topdir/configure CFLAGS='-std=gnu99 -g -O0 -ftrapv' --enable-kdbus $args | |
71 | scan-build make | |
72 | else | |
73 | echo | |
74 | echo "----------------------------------------------------------------" | |
75 | echo "Initialized build system. For a common configuration please run:" | |
76 | echo "----------------------------------------------------------------" | |
77 | echo | |
78 | echo "$topdir/configure CFLAGS='-g -O0 -ftrapv' --enable-compat-libs --enable-kdbus $args" | |
79 | echo | |
80 | fi |