card-restore: Fix memory leak
[platform/upstream/pulseaudio.git] / bootstrap.sh
1 #!/usr/bin/env bash
2
3 # This file is part of PulseAudio.
4 #
5 # PulseAudio 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 of the License, or
8 # (at your option) any later version.
9 #
10 # PulseAudio 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 # General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
17
18 if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
19     cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
20     chmod +x .git/hooks/pre-commit && \
21     echo "Activated pre-commit hook."
22 fi
23
24 if [ -f .tarball-version ]; then
25     echo "Marking tarball version as modified."
26     echo -n `cat .tarball-version | sed 's/-rebootstrapped$//'`-rebootstrapped >.tarball-version
27 fi
28
29 # We check for this here, because if pkg-config is not found in the
30 # system, it's likely that the pkg.m4 macro file is also not present,
31 # which will make PKG_PROG_PKG_CONFIG be undefined and the generated
32 # configure file faulty.
33 if ! pkg-config --version &>/dev/null; then
34     echo "pkg-config is required to bootstrap this program"
35     exit 1
36 fi
37 # Other necessary programs
38 if ! autopoint --version &>/dev/null ; then
39     echo "autopoint is required to bootstrap this program"
40     exit 1
41 fi
42
43 autoreconf --force --install --verbose
44
45 if test "x$NOCONFIGURE" = "x"; then
46     CFLAGS="$CFLAGS -g -O0" ./configure --enable-force-preopen "$@" && \
47         make clean
48 fi