|
Packit Service |
db8eaa |
#!/bin/bash
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
set -e
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
bit32=
|
|
Packit Service |
db8eaa |
modules=
|
|
Packit Service |
db8eaa |
alisp=
|
|
Packit Service |
db8eaa |
lto=
|
|
Packit Service |
db8eaa |
if [ $# -ne 0 ]; then
|
|
Packit Service |
db8eaa |
endloop=
|
|
Packit Service |
db8eaa |
while [ -z "$endloop" ]; do
|
|
Packit Service |
db8eaa |
case "$1" in
|
|
Packit Service |
db8eaa |
32)
|
|
Packit Service |
db8eaa |
bits32=yes
|
|
Packit Service |
db8eaa |
echo "Forced 32-bit library build..."
|
|
Packit Service |
db8eaa |
shift ;;
|
|
Packit Service |
db8eaa |
modules)
|
|
Packit Service |
db8eaa |
modules=yes
|
|
Packit Service |
db8eaa |
echo "Forced mixer modules build..."
|
|
Packit Service |
db8eaa |
shift ;;
|
|
Packit Service |
db8eaa |
alisp)
|
|
Packit Service |
db8eaa |
alisp=yes
|
|
Packit Service |
db8eaa |
echo "Forced alisp code build..."
|
|
Packit Service |
db8eaa |
shift ;;
|
|
Packit Service |
db8eaa |
python2)
|
|
Packit Service |
db8eaa |
python2=yes
|
|
Packit Service |
db8eaa |
echo "Forced python2 interpreter build..."
|
|
Packit Service |
db8eaa |
shift ;;
|
|
Packit Service |
db8eaa |
lto)
|
|
Packit Service |
db8eaa |
lto="-flto -flto-partition=none"
|
|
Packit Service |
db8eaa |
echo "Forced lto build..."
|
|
Packit Service |
db8eaa |
shift ;;
|
|
Packit Service |
db8eaa |
*)
|
|
Packit Service |
db8eaa |
endloop=yes
|
|
Packit Service |
db8eaa |
;;
|
|
Packit Service |
db8eaa |
esac
|
|
Packit Service |
db8eaa |
done
|
|
Packit Service |
db8eaa |
fi
|
|
Packit Service |
db8eaa |
if [ $# -ne 0 -a -z "$bit32" ]; then
|
|
Packit Service |
db8eaa |
args="$@"
|
|
Packit Service |
db8eaa |
elif [ -r /etc/asound/library_args ]; then
|
|
Packit Service |
db8eaa |
args="`cat /etc/asound/library_args`"
|
|
Packit Service |
db8eaa |
if [ -z "$bit32" ]; then
|
|
Packit Service |
db8eaa |
test -r /etc/asound/library64_args && \
|
|
Packit Service |
db8eaa |
args="`cat /etc/asound/library64_args`"
|
|
Packit Service |
db8eaa |
fi
|
|
Packit Service |
db8eaa |
else
|
|
Packit Service |
db8eaa |
prefix="/usr"
|
|
Packit Service |
db8eaa |
libdir="/usr/lib"
|
|
Packit Service |
db8eaa |
libdir2="/usr/lib"
|
|
Packit Service |
db8eaa |
if [ -z "$bit32" ]; then
|
|
Packit Service |
db8eaa |
test -d /usr/lib64 && libdir="/usr/lib64"
|
|
Packit Service |
db8eaa |
test -f /lib64/libasound.so.2 && libdir="/lib64"
|
|
Packit Service |
db8eaa |
test -d /usr/lib64 && libdir2="/usr/lib64"
|
|
Packit Service |
db8eaa |
else
|
|
Packit Service |
db8eaa |
test -f /lib/libasound.so.2 && libdir="/lib"
|
|
Packit Service |
db8eaa |
fi
|
|
Packit Service |
db8eaa |
args="--disable-aload --prefix=$prefix --libdir=$libdir"
|
|
Packit Service |
db8eaa |
args="$args --with-plugindir=$libdir2/alsa-lib"
|
|
Packit Service |
db8eaa |
args="$args --with-pkgconfdir=$libdir2/pkgconfig"
|
|
Packit Service |
db8eaa |
fi
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
if [ "$modules" = "yes" ]; then
|
|
Packit Service |
db8eaa |
args="$args --enable-mixer-modules"
|
|
Packit Service |
db8eaa |
args="$args --enable-mixer-pymods"
|
|
Packit Service |
db8eaa |
fi
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
if [ "$alisp" = "yes" ]; then
|
|
Packit Service |
db8eaa |
args="$args --enable-alisp"
|
|
Packit Service |
db8eaa |
fi
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
if [ "$python2" = "yes" ]; then
|
|
Packit Service |
db8eaa |
args="$args --enable-python2"
|
|
Packit Service |
db8eaa |
fi
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
touch ltconfig
|
|
Packit Service |
db8eaa |
libtoolize --force --copy --automake
|
|
Packit Service |
db8eaa |
aclocal $ACLOCAL_FLAGS
|
|
Packit Service |
db8eaa |
autoheader
|
|
Packit Service |
db8eaa |
automake --foreign --copy --add-missing
|
|
Packit Service |
db8eaa |
touch depcomp # seems to be missing for old automake
|
|
Packit Service |
db8eaa |
autoconf
|
|
Packit Service |
db8eaa |
export CFLAGS="-O2 -Wall -W -Wunused-const-variable=0 -pipe -g $lto"
|
|
Packit Service |
db8eaa |
if [ -n "$lto" ]; then
|
|
Packit Service |
db8eaa |
export AR="gcc-ar"
|
|
Packit Service |
db8eaa |
export RANLIB="gcc-ranlib"
|
|
Packit Service |
db8eaa |
fi
|
|
Packit Service |
db8eaa |
echo "CFLAGS=$CFLAGS"
|
|
Packit Service |
db8eaa |
echo "./configure $args"
|
|
Packit Service |
db8eaa |
./configure $args || exit 1
|
|
Packit Service |
db8eaa |
unset CFLAGS
|
|
Packit Service |
db8eaa |
if [ -z "$GITCOMPILE_NO_MAKE" ]; then
|
|
Packit Service |
db8eaa |
make
|
|
Packit Service |
db8eaa |
fi
|