OSDN Git Service

Introduce --with-pkgconfdir, add 64-bit defaults to gitcompile
[android-x86/external-alsa-lib.git] / gitcompile
1 #!/bin/bash
2
3 set -e
4
5 bit32=
6 if [ $# -ne 0 -a "$1" == "32" ]; then
7   bit32=yes
8   echo "Forced 32-bit library build..."
9 fi
10 if [ $# -ne 0 -a -z "$bit32" ]; then
11   args="$@"
12 elif [ -r /etc/asound/library_args ]; then
13   args="`cat /etc/asound/library_args`"
14   if [ -z "$bit32" ]; then
15     test -r /etc/asound/library64_args && \
16       args="`cat /etc/asound/library64_args`"
17   fi
18 else
19   prefix="/usr"
20   libdir="/usr/lib"
21   libdir2="/usr/lib"
22   if [ -z "$bit32" ]; then
23     test -d /usr/lib64 && libdir="/usr/lib64"
24     test -f /lib64/libasound.so.2 && libdir="/lib64"
25     test -d /usr/lib64 && libdir2="/usr/lib64"
26   else
27     test -f /lib/libasound.so.2 && libdir="/lib"
28   fi
29   args="--disable-aload --prefix=$prefix --libdir=$libdir"
30   args="$args --with-plugindir=$libdir2/alsa-lib"
31   args="$args --with-pkgconfdir=$libdir2/pkgconfig"
32 fi
33       
34 touch ltconfig
35 libtoolize --force --copy --automake
36 aclocal $ACLOCAL_FLAGS
37 autoheader
38 automake --foreign --copy --add-missing
39 touch depcomp           # seems to be missing for old automake
40 autoconf
41 export CFLAGS='-O2 -Wall -W -pipe -g'
42 echo "CFLAGS=$CFLAGS"
43 echo "./configure $args"
44 ./configure $args || exit 1
45 unset CFLAGS
46 if [ -z "$GITCOMPILE_NO_MAKE" ]; then
47   make
48 fi