Blame autogen.sh

Packit 3ae693
#!/bin/bash
Packit 3ae693
Packit 3ae693
# This file is part of libcanberra.
Packit 3ae693
#
Packit 3ae693
# Copyright 2008 Lennart Poettering
Packit 3ae693
#
Packit 3ae693
# libcanberra is free software; you can redistribute it and/or modify
Packit 3ae693
# it under the terms of the GNU Lesser General Public License as
Packit 3ae693
# published by the Free Software Foundation, either version 2.1 of the
Packit 3ae693
# License, or (at your option) any later version.
Packit 3ae693
#
Packit 3ae693
# libcanberra is distributed in the hope that it will be useful, but
Packit 3ae693
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 3ae693
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Packit 3ae693
# Lesser General Public License for more details.
Packit 3ae693
#
Packit 3ae693
# You should have received a copy of the GNU Lesser General Public
Packit 3ae693
# License along with libcanberra. If not, see
Packit 3ae693
# <http://www.gnu.org/licenses/>.
Packit 3ae693
Packit 3ae693
if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
Packit 3ae693
        cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
Packit 3ae693
        chmod +x .git/hooks/pre-commit && \
Packit 3ae693
        echo "Activated pre-commit hook."
Packit 3ae693
fi
Packit 3ae693
Packit 3ae693
GTKDOCIZE=$(which gtkdocize 2>/dev/null)
Packit 3ae693
if test -z $GTKDOCIZE; then
Packit 3ae693
        echo "You don't have gtk-doc installed, and thus won't be able to generate the documentation."
Packit 3ae693
        echo 'EXTRA_DIST =' > gtkdoc/gtk-doc.make
Packit 3ae693
else
Packit 3ae693
        gtkdocize --docdir gtkdoc/
Packit 3ae693
        gtkdocargs=--enable-gtk-doc
Packit 3ae693
fi
Packit 3ae693
Packit 3ae693
autoreconf --force --install --symlink
Packit 3ae693
Packit 3ae693
libdir() {
Packit 3ae693
        echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
Packit 3ae693
}
Packit 3ae693
Packit 3ae693
args="\
Packit 3ae693
--sysconfdir=/etc \
Packit 3ae693
--localstatedir=/var \
Packit 3ae693
--libdir=$(libdir /usr/lib) \
Packit 3ae693
--libexecdir=/usr/lib \
Packit 3ae693
$gtkdocargs"
Packit 3ae693
Packit 3ae693
if [ "x$1" == "xc" ]; then
Packit 3ae693
        ./configure CFLAGS='-g -O0 -Wp,-U_FORTIFY_SOURCE' $args
Packit 3ae693
        make clean
Packit 3ae693
else
Packit 3ae693
        echo
Packit 3ae693
        echo "----------------------------------------------------------------"
Packit 3ae693
        echo "Initialized build system. For a common configuration please run:"
Packit 3ae693
        echo "----------------------------------------------------------------"
Packit 3ae693
        echo
Packit 3ae693
        echo "./configure CFLAGS='-g -O0 -Wp,-U_FORTIFY_SOURCE' $args"
Packit 3ae693
        echo
Packit 3ae693
fi