1#!/bin/bash 2 3set -e 4 5bit32= 6modules= 7alisp= 8lto= 9if [ $# -ne 0 ]; then 10 endloop= 11 while [ -z "$endloop" ]; do 12 case "$1" in 13 32) 14 bits32=yes 15 echo "Forced 32-bit library build..." 16 shift ;; 17 modules) 18 modules=yes 19 echo "Forced mixer modules build..." 20 shift ;; 21 alisp) 22 alisp=yes 23 echo "Forced alisp code build..." 24 shift ;; 25 python2) 26 python2=yes 27 echo "Forced python2 interpreter build..." 28 shift ;; 29 lto) 30 lto="-flto -flto-partition=none" 31 echo "Forced lto build..." 32 shift ;; 33 *) 34 endloop=yes 35 ;; 36 esac 37 done 38fi 39if [ $# -ne 0 -a -z "$bit32" ]; then 40 args="$@" 41elif [ -r /etc/asound/library_args ]; then 42 args="`cat /etc/asound/library_args`" 43 if [ -z "$bit32" ]; then 44 test -r /etc/asound/library64_args && \ 45 args="`cat /etc/asound/library64_args`" 46 fi 47else 48 prefix="/usr" 49 libdir="/usr/lib" 50 libdir2="/usr/lib" 51 if [ -z "$bit32" ]; then 52 test -d /usr/lib64 && libdir="/usr/lib64" 53 test -f /lib64/libasound.so.2 && libdir="/lib64" 54 test -d /usr/lib64 && libdir2="/usr/lib64" 55 else 56 test -f /lib/libasound.so.2 && libdir="/lib" 57 fi 58 args="--disable-aload --prefix=$prefix --libdir=$libdir" 59 args="$args --with-plugindir=$libdir2/alsa-lib" 60 args="$args --with-pkgconfdir=$libdir2/pkgconfig" 61fi 62 63if [ "$modules" = "yes" ]; then 64 args="$args --enable-mixer-modules" 65 args="$args --enable-mixer-pymods" 66fi 67 68if [ "$alisp" = "yes" ]; then 69 args="$args --enable-alisp" 70fi 71 72if [ "$python2" = "yes" ]; then 73 args="$args --enable-python2" 74fi 75 76touch ltconfig 77libtoolize --force --copy --automake 78aclocal $ACLOCAL_FLAGS 79autoheader 80automake --foreign --copy --add-missing 81touch depcomp # seems to be missing for old automake 82autoconf 83export CFLAGS="-O2 -Wall -W -Wunused-const-variable=0 -pipe -g $lto" 84if [ -n "$lto" ]; then 85 export AR="gcc-ar" 86 export RANLIB="gcc-ranlib" 87fi 88echo "CFLAGS=$CFLAGS" 89echo "./configure $args" 90./configure $args || exit 1 91unset CFLAGS 92if [ -z "$GITCOMPILE_NO_MAKE" ]; then 93 make 94fi 95