2006-05-12 13:33:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2006-09-26 13:37:07 +00:00
|
|
|
set -e
|
|
|
|
|
2024-05-16 09:35:05 +00:00
|
|
|
bits32=
|
|
|
|
cbits32=
|
2017-11-27 20:38:18 +00:00
|
|
|
modules=
|
2017-11-27 20:43:22 +00:00
|
|
|
alisp=
|
2019-04-09 10:44:14 +00:00
|
|
|
lto=
|
2017-11-27 20:38:18 +00:00
|
|
|
if [ $# -ne 0 ]; then
|
|
|
|
endloop=
|
|
|
|
while [ -z "$endloop" ]; do
|
|
|
|
case "$1" in
|
|
|
|
32)
|
|
|
|
bits32=yes
|
2024-05-16 09:35:05 +00:00
|
|
|
cbits32="-m32"
|
2017-11-27 20:38:18 +00:00
|
|
|
echo "Forced 32-bit library build..."
|
|
|
|
shift ;;
|
|
|
|
modules)
|
|
|
|
modules=yes
|
|
|
|
echo "Forced mixer modules build..."
|
|
|
|
shift ;;
|
2017-11-27 20:43:22 +00:00
|
|
|
alisp)
|
|
|
|
alisp=yes
|
|
|
|
echo "Forced alisp code build..."
|
|
|
|
shift ;;
|
2018-03-27 12:50:36 +00:00
|
|
|
python2)
|
|
|
|
python2=yes
|
|
|
|
echo "Forced python2 interpreter build..."
|
|
|
|
shift ;;
|
2019-04-09 10:44:14 +00:00
|
|
|
lto)
|
|
|
|
lto="-flto -flto-partition=none"
|
|
|
|
echo "Forced lto build..."
|
|
|
|
shift ;;
|
2024-05-16 09:35:05 +00:00
|
|
|
static)
|
|
|
|
static=yes
|
|
|
|
echo "Selected static build..."
|
|
|
|
shift ;;
|
2017-11-27 20:38:18 +00:00
|
|
|
*)
|
|
|
|
endloop=yes
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
2012-01-20 15:14:44 +00:00
|
|
|
fi
|
|
|
|
if [ $# -ne 0 -a -z "$bit32" ]; then
|
|
|
|
args="$@"
|
|
|
|
elif [ -r /etc/asound/library_args ]; then
|
|
|
|
args="`cat /etc/asound/library_args`"
|
2024-05-16 09:35:05 +00:00
|
|
|
if [ -z "$bits32" ]; then
|
2012-01-20 15:14:44 +00:00
|
|
|
test -r /etc/asound/library64_args && \
|
|
|
|
args="`cat /etc/asound/library64_args`"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
prefix="/usr"
|
|
|
|
libdir="/usr/lib"
|
|
|
|
libdir2="/usr/lib"
|
2024-05-16 09:35:05 +00:00
|
|
|
if [ -z "$bits32" ]; then
|
2012-01-20 15:14:44 +00:00
|
|
|
test -d /usr/lib64 && libdir="/usr/lib64"
|
|
|
|
test -f /lib64/libasound.so.2 && libdir="/lib64"
|
|
|
|
test -d /usr/lib64 && libdir2="/usr/lib64"
|
|
|
|
else
|
|
|
|
test -f /lib/libasound.so.2 && libdir="/lib"
|
|
|
|
fi
|
|
|
|
args="--disable-aload --prefix=$prefix --libdir=$libdir"
|
|
|
|
args="$args --with-plugindir=$libdir2/alsa-lib"
|
|
|
|
args="$args --with-pkgconfdir=$libdir2/pkgconfig"
|
|
|
|
fi
|
2017-11-27 20:38:18 +00:00
|
|
|
|
|
|
|
if [ "$modules" = "yes" ]; then
|
|
|
|
args="$args --enable-mixer-modules"
|
2018-03-27 12:50:36 +00:00
|
|
|
args="$args --enable-mixer-pymods"
|
2017-11-27 20:38:18 +00:00
|
|
|
fi
|
|
|
|
|
2017-11-27 20:43:22 +00:00
|
|
|
if [ "$alisp" = "yes" ]; then
|
|
|
|
args="$args --enable-alisp"
|
|
|
|
fi
|
|
|
|
|
2018-03-27 12:50:36 +00:00
|
|
|
if [ "$python2" = "yes" ]; then
|
|
|
|
args="$args --enable-python2"
|
|
|
|
fi
|
|
|
|
|
2024-05-16 09:35:05 +00:00
|
|
|
if [ "$static" = "yes" ]; then
|
|
|
|
#args="$args --enable-shared=no --enable-static=yes"
|
|
|
|
args="$args --disable-shared"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2006-05-12 13:33:44 +00:00
|
|
|
touch ltconfig
|
|
|
|
libtoolize --force --copy --automake
|
|
|
|
aclocal $ACLOCAL_FLAGS
|
|
|
|
autoheader
|
|
|
|
automake --foreign --copy --add-missing
|
|
|
|
touch depcomp # seems to be missing for old automake
|
|
|
|
autoconf
|
2024-05-16 09:35:05 +00:00
|
|
|
export CFLAGS="$cbits32 -O2 -Wall -W -Wunused-const-variable=0 -pipe -g $lto"
|
2019-04-09 10:44:14 +00:00
|
|
|
if [ -n "$lto" ]; then
|
|
|
|
export AR="gcc-ar"
|
|
|
|
export RANLIB="gcc-ranlib"
|
|
|
|
fi
|
2006-05-12 13:33:44 +00:00
|
|
|
echo "CFLAGS=$CFLAGS"
|
2012-01-20 15:14:44 +00:00
|
|
|
echo "./configure $args"
|
|
|
|
./configure $args || exit 1
|
2006-05-12 13:33:44 +00:00
|
|
|
unset CFLAGS
|
2008-05-20 11:29:44 +00:00
|
|
|
if [ -z "$GITCOMPILE_NO_MAKE" ]; then
|
2006-05-12 13:33:44 +00:00
|
|
|
make
|
|
|
|
fi
|