SFML/tools/android/compile_libs.sh

55 lines
1.4 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
DESTDIR=$PWD/tmp
LOCALDIR=$PWD
OPATH=$PATH
export PATH=$2
export CC=$3
export CXX=$4
export CFLAGS=$5
export CPPFLAGS=$6
export LDFLAGS=$7
if [ "$1" = "arm" ]
then
ARCH=arm-linux
ANDROID_ABI=armeabi
elif [ "$1" = "arm-v7a" ]
then
ARCH=arm-linux
ANDROID_ABI=armeabi-v7a
elif [ "$1" = "x86" ]
then
ARCH=i686-linux
ANDROID_ABI=x86
elif [ "$1" = "mips" ]
then
ARCH=mips-linux
ANDROID_ABI=mips
fi
HOST="--host=$ARCH"
PREFIX="--prefix=$DESTDIR/$1/usr need_version=no"
# Compile OGG
cd $LOCALDIR/build/libogg-* && sed -i 's/-version-info/-avoid-version/g' src/Makefile.in src/Makefile.am && ./configure $HOST $PREFIX --enable-shared=no && make && make install
rm $DESTDIR/$1/usr/lib/libogg*.so*
# Compile FLAC
cd $LOCALDIR/build/flac-* && sed -i 's/-version-info/-avoid-version/g' src/libFLAC/Makefile.in src/libFLAC/Makefile.am && ./configure $HOST $PREFIX --enable-shared=no && make && make install
rm $DESTDIR/$1/usr/lib/libFLAC*.so*
# Compile VORBIS
cd $LOCALDIR/build/libvorbis-* && sed -i 's/-version-info/-avoid-version/g' lib/Makefile.in lib/Makefile.am && ./configure $HOST $PREFIX --enable-shared=no && make && make install
rm $DESTDIR/$1/usr/lib/libvorbis*.so*
# Compile freetype
cd $LOCALDIR/build/freetype-* && sed -i 's/-version-info/-avoid-version/g' builds/unix/unix-cc.in && ./configure $HOST $PREFIX && make && make install
export PATH=$OPATH