timeval: don't create the wrong illusion that nsecs should be stored in pa_usec_t
[pulseaudio-mirror.git] / bootstrap.sh
blobd5025db61a06056b6a4ca22224cc7ab84b98e520
1 #!/bin/bash
3 # This file is part of PulseAudio.
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.
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.
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with PulseAudio; if not, write to the Free Software Foundation,
17 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19 VERSION=1.11
21 run_versioned() {
22 local P
23 local V
25 V=$(echo "$2" | sed -e 's,\.,,g')
27 if [ -e "`which $1$V 2> /dev/null`" ] ; then
28 P="$1$V"
29 else
30 if [ -e "`which $1-$2 2> /dev/null`" ] ; then
31 P="$1-$2"
32 else
33 P="$1"
37 shift 2
38 "$P" "$@"
41 set -ex
43 if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
44 echo "Activating pre-commit hook."
45 cp -av .git/hooks/pre-commit.sample .git/hooks/pre-commit
46 chmod -c +x .git/hooks/pre-commit
49 # We check for this here, because if pkg-config is not found in the
50 # system, it's likely that the pkg.m4 macro file is also not present,
51 # which will make PKG_PROG_PKG_CONFIG be undefined and the generated
52 # configure file faulty.
53 if ! pkg-config --version &>/dev/null; then
54 echo "pkg-config is required to bootstrap this program" &>/dev/null
55 exit 1
58 if type -p colorgcc > /dev/null ; then
59 export CC=colorgcc
62 if [ "x$1" = "xam" ] ; then
63 run_versioned automake "$VERSION" -a -c --foreign
64 ./config.status
65 else
66 rm -rf autom4te.cache
67 rm -f config.cache
69 rm -f Makefile.am~ configure.ac~
70 # Evil, evil, evil, evil hack
71 sed 's/read dummy/\#/' `which gettextize` | bash -s -- --copy --force
72 test -f Makefile.am~ && mv Makefile.am~ Makefile.am
73 test -f configure.ac~ && mv configure.ac~ configure.ac
75 touch config.rpath
76 test "x$LIBTOOLIZE" = "x" && LIBTOOLIZE=libtoolize
78 intltoolize --copy --force --automake
79 "$LIBTOOLIZE" -c --force
80 run_versioned aclocal "$VERSION" -I m4
81 run_versioned autoconf 2.63 -Wall
82 run_versioned autoheader 2.63
83 run_versioned automake "$VERSION" --copy --foreign --add-missing
85 if test "x$NOCONFIGURE" = "x"; then
86 CFLAGS="-g -O0" ./configure --sysconfdir=/etc --localstatedir=/var --enable-force-preopen "$@"
87 make clean