chiark / gitweb /
sd-daemon: remove unnecessary memset calls
[elogind.git] / autogen.sh
1 #!/bin/bash
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 if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
21         cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
22         chmod +x .git/hooks/pre-commit && \
23         echo "Activated pre-commit hook."
24 fi
25
26 GTKDOCIZE=$(which gtkdocize 2>/dev/null)
27 if test -z $GTKDOCIZE; then
28         echo "You don't have gtk-doc installed, and thus won't be able to generate the documentation."
29         echo 'EXTRA_DIST =' > docs/gtk-doc.make
30 else
31         gtkdocize --docdir docs/
32         gtkdocargs=--enable-gtk-doc
33 fi
34
35 intltoolize --force --automake
36 autoreconf --force --install --symlink
37
38 libdir() {
39         echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
40 }
41
42 args="\
43 --sysconfdir=/etc \
44 --localstatedir=/var \
45 --libdir=$(libdir /usr/lib) \
46 $gtkdocargs"
47
48 if [ ! -L /bin ]; then
49 args="$args \
50 --with-rootprefix= \
51 --with-rootlibdir=$(libdir /lib) \
52 "
53 fi
54
55 if [ "x$1" == "xc" ]; then
56         ./configure CFLAGS='-g -O0 -Wp,-U_FORTIFY_SOURCE' $args
57         make clean
58 else
59         echo
60         echo "----------------------------------------------------------------"
61         echo "Initialized build system. For a common configuration please run:"
62         echo "----------------------------------------------------------------"
63         echo
64         echo "./configure CFLAGS='-g -O0 -Wp,-U_FORTIFY_SOURCE' $args"
65         echo
66 fi