]>
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 | if which gtkdocize >/dev/null 2>/dev/null; then | |
32 | gtkdocize --docdir docs/ --flavour no-tmpl | |
33 | gtkdocargs=--enable-gtk-doc | |
34 | else | |
35 | echo "You don't have gtk-doc installed, and thus won't be able to generate the documentation." | |
36 | rm -f docs/gtk-doc.make | |
37 | echo 'EXTRA_DIST =' > docs/gtk-doc.make | |
38 | fi | |
39 | ||
40 | intltoolize --force --automake | |
41 | autoreconf --force --install --symlink | |
42 | ||
43 | libdir() { | |
44 | echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd) | |
45 | } | |
46 | ||
47 | args="\ | |
48 | --sysconfdir=/etc \ | |
49 | --localstatedir=/var \ | |
50 | --libdir=$(libdir /usr/lib) \ | |
51 | $gtkdocargs" | |
52 | ||
53 | if [ -f "$topdir/.config.args" ]; then | |
54 | args="$args $(cat $topdir/.config.args)" | |
55 | fi | |
56 | ||
57 | if [ ! -L /bin ]; then | |
58 | args="$args \ | |
59 | --with-rootprefix= \ | |
60 | --with-rootlibdir=$(libdir /lib) \ | |
61 | " | |
62 | fi | |
63 | ||
64 | cd $oldpwd | |
65 | ||
66 | if [ "x$1" = "xc" ]; then | |
67 | $topdir/configure CFLAGS='-g -O0 -ftrapv' --enable-compat-libs --enable-kdbus $args | |
68 | make clean | |
69 | elif [ "x$1" = "xt" ]; then | |
70 | $topdir/configure CFLAGS='-g -O0 -ftrapv' --enable-compat-libs --enable-kdbus --enable-terminal $args | |
71 | make clean | |
72 | elif [ "x$1" = "xg" ]; then | |
73 | $topdir/configure CFLAGS='-g -Og -ftrapv' --enable-compat-libs --enable-kdbus $args | |
74 | make clean | |
75 | elif [ "x$1" = "xa" ]; then | |
76 | $topdir/configure CFLAGS='-g -O0 -Wsuggest-attribute=pure -Wsuggest-attribute=const -ftrapv' --enable-compat-libs --enable-kdbus $args | |
77 | make clean | |
78 | elif [ "x$1" = "xl" ]; then | |
79 | $topdir/configure CC=clang CFLAGS='-g -O0 -ftrapv' --enable-compat-libs --enable-kdbus $args | |
80 | make clean | |
81 | elif [ "x$1" = "xs" ]; then | |
82 | scan-build $topdir/configure CFLAGS='-std=gnu99 -g -O0 -ftrapv' --enable-kdbus $args | |
83 | scan-build make | |
84 | else | |
85 | echo | |
86 | echo "----------------------------------------------------------------" | |
87 | echo "Initialized build system. For a common configuration please run:" | |
88 | echo "----------------------------------------------------------------" | |
89 | echo | |
90 | echo "$topdir/configure CFLAGS='-g -O0 -ftrapv' --enable-compat-libs --enable-kdbus $args" | |
91 | echo | |
92 | fi |