]> git.ipfire.org Git - thirdparty/systemd.git/blob - autogen.sh
sd-radv: Receive Router Solicitations
[thirdparty/systemd.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 verb="$1"
21
22 case "$verb" in
23 "") ;;
24 [cgals]) shift ;;
25 *) echo "Unexpected argument: $verb" >&2; exit 1 ;;
26 esac
27
28 oldpwd=$(pwd)
29 topdir=$(dirname $0)
30 cd $topdir
31
32 if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then
33 # This part is allowed to fail
34 cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
35 chmod +x .git/hooks/pre-commit && \
36 echo "Activated pre-commit hook." || :
37 fi
38
39 intltoolize --force --automake
40 autoreconf --force --install --symlink
41
42 libdir() {
43 echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd)
44 }
45
46 args="\
47 --sysconfdir=/etc \
48 --localstatedir=/var \
49 --libdir=$(libdir /usr/lib) \
50 "
51
52 if [ -f "$topdir/.config.args" ]; then
53 args="$args $(cat $topdir/.config.args)"
54 fi
55
56 if [ ! -L /bin ]; then
57 args="$args \
58 --with-rootprefix=/ \
59 --with-rootlibdir=$(libdir /lib) \
60 "
61 fi
62
63 args="$args $@"
64 cd $oldpwd
65
66 if [ "$verb" = "c" ]; then
67 set -x
68 $topdir/configure CFLAGS='-g -O0 -ftrapv' $args
69 make clean >/dev/null
70 elif [ "$verb" = "g" ]; then
71 set -x
72 $topdir/configure CFLAGS='-g -Og -ftrapv' $args
73 make clean >/dev/null
74 elif [ "$verb" = "a" ]; then
75 set -x
76 $topdir/configure CFLAGS='-g -O0 -Wsuggest-attribute=pure -Wsuggest-attribute=const -ftrapv' $args
77 make clean >/dev/null
78 elif [ "$verb" = "l" ]; then
79 set -x
80 $topdir/configure CC=clang CFLAGS='-g -O0 -ftrapv' $args
81 make clean >/dev/null
82 elif [ "$verb" = "s" ]; then
83 set -x
84 scan-build $topdir/configure CFLAGS='-std=gnu99 -g -O0 -ftrapv' $args
85 scan-build make
86 else
87 echo
88 echo "----------------------------------------------------------------"
89 echo "Initialized build system. For a common configuration please run:"
90 echo "----------------------------------------------------------------"
91 echo
92 echo "$topdir/configure CFLAGS='-g -O0 -ftrapv' $args"
93 echo
94 fi