2013-09-23 20:08:16 +08:00
|
|
|
#!/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
|
2014-03-11 23:03:04 +08:00
|
|
|
ANDROID_ABI=armeabi
|
2013-09-23 20:08:16 +08:00
|
|
|
|
|
|
|
elif [ "$1" = "arm-v7a" ]
|
|
|
|
then
|
|
|
|
ARCH=arm-linux
|
2014-03-11 23:03:04 +08:00
|
|
|
ANDROID_ABI=armeabi-v7a
|
2013-09-23 20:08:16 +08:00
|
|
|
|
|
|
|
elif [ "$1" = "x86" ]
|
|
|
|
then
|
|
|
|
ARCH=i686-linux
|
2014-03-11 23:03:04 +08:00
|
|
|
ANDROID_ABI=x86
|
2013-09-23 20:08:16 +08:00
|
|
|
|
|
|
|
elif [ "$1" = "mips" ]
|
|
|
|
then
|
|
|
|
ARCH=mips-linux
|
2014-03-11 23:03:04 +08:00
|
|
|
ANDROID_ABI=mips
|
2013-09-23 20:08:16 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
HOST="--host=$ARCH"
|
|
|
|
PREFIX="--prefix=$DESTDIR/$1/usr need_version=no"
|
|
|
|
|
|
|
|
# Compile OGG
|
2014-03-11 23:03:04 +08:00
|
|
|
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
|
2013-09-23 20:08:16 +08:00
|
|
|
rm $DESTDIR/$1/usr/lib/libogg*.so*
|
|
|
|
|
|
|
|
# Compile FLAC
|
2014-03-11 23:03:04 +08:00
|
|
|
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
|
2013-09-23 20:08:16 +08:00
|
|
|
rm $DESTDIR/$1/usr/lib/libFLAC*.so*
|
|
|
|
|
|
|
|
# Compile VORBIS
|
2014-03-11 23:03:04 +08:00
|
|
|
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
|
2013-09-23 20:08:16 +08:00
|
|
|
rm $DESTDIR/$1/usr/lib/libvorbis*.so*
|
|
|
|
|
|
|
|
# Compile libsndfile (important: --disable-sqlite)
|
|
|
|
cd $LOCALDIR/build/libsndfile-* && sed -i 's/-version-info/-avoid-version/g' src/Makefile.in src/Makefile.am && ./configure $HOST $PREFIX --disable-sqlite && make && make install
|
|
|
|
|
|
|
|
# Compile JPEG
|
|
|
|
cd $LOCALDIR/build/jpeg-* && sed -i 's/-version-info/-avoid-version/g' Makefile.in Makefile.am && ./configure $HOST $PREFIX && make && make install
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Compile OpenAL-Soft
|
|
|
|
cd $LOCALDIR/build/openal-soft-android-master && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_CMAKE_TOOLCHAIN -DANDROID_ABI=$ANDROID_ABI -DANDROID_NATIVE_API_LEVEL=android-9 -DANDROID_USE_STLPORT=1 .. && make openal && mv libopenal.so $DESTDIR/$1/usr/lib
|
|
|
|
|
|
|
|
export PATH=$OPATH
|