]> git.ipfire.org Git - thirdparty/systemd.git/blame - autogen.sh
sd-network: add sd_network_linkg_get_domains()
[thirdparty/systemd.git] / autogen.sh
CommitLineData
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
18set -e
19
0f62019c
SW
20oldpwd=$(pwd)
21topdir=$(dirname $0)
22cd $topdir
23
72d25fd9
MM
24if [ -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
29fi
30
72d25fd9 31if which gtkdocize >/dev/null 2>/dev/null; then
58a25dac 32 gtkdocize --docdir docs/ --flavour no-tmpl
843605d3 33 gtkdocargs=--enable-gtk-doc
72d25fd9
MM
34else
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
92ec4495
JJ
38fi
39
6bd9fe5a
KS
40intltoolize --force --automake
41autoreconf --force --install --symlink
42
ae446765 43libdir() {
72d25fd9 44 echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd)
ae446765
KS
45}
46
6bd9fe5a 47args="\
6bd9fe5a
KS
48--sysconfdir=/etc \
49--localstatedir=/var \
50--libdir=$(libdir /usr/lib) \
80a5cbac 51$gtkdocargs"
6bd9fe5a 52
772f4698
KS
53if [ ! -L /bin ]; then
54args="$args \
55--with-rootprefix= \
56--with-rootlibdir=$(libdir /lib) \
57"
58fi
59
0f62019c
SW
60cd $oldpwd
61
72d25fd9 62if [ "x$1" = "xc" ]; then
0f62019c 63 $topdir/configure CFLAGS='-g -O0 -ftrapv' --enable-compat-libs --enable-kdbus $args
0fc6e1ed 64 make clean
a72e0374
DH
65elif [ "x$1" = "xt" ]; then
66 $topdir/configure CFLAGS='-g -O0 -ftrapv' --enable-compat-libs --enable-kdbus --enable-terminal $args
67 make clean
0fc6e1ed 68elif [ "x$1" = "xg" ]; then
0f62019c 69 $topdir/configure CFLAGS='-g -Og -ftrapv' --enable-compat-libs --enable-kdbus $args
843605d3 70 make clean
25ad8664 71elif [ "x$1" = "xa" ]; then
0f62019c 72 $topdir/configure CFLAGS='-g -O0 -Wsuggest-attribute=pure -Wsuggest-attribute=const -ftrapv' --enable-compat-libs --enable-kdbus $args
25ad8664 73 make clean
bd3539b2 74elif [ "x$1" = "xl" ]; then
0f62019c 75 $topdir/configure CC=clang CFLAGS='-g -O0 -ftrapv -Wno-gnu' --enable-compat-libs --enable-kdbus $args
bd3539b2 76 make clean
a8c78dec 77elif [ "x$1" = "xs" ]; then
5985ea4d 78 scan-build $topdir/configure CFLAGS='-std=gnu99 -g -O0 -ftrapv' --enable-kdbus $args
a8c78dec 79 scan-build make
843605d3
LP
80else
81 echo
82 echo "----------------------------------------------------------------"
83 echo "Initialized build system. For a common configuration please run:"
84 echo "----------------------------------------------------------------"
85 echo
0f62019c 86 echo "$topdir/configure CFLAGS='-g -O0 -ftrapv' --enable-compat-libs --enable-kdbus $args"
843605d3 87 echo
47be870b 88fi