[Android] Updated scripts to use libc++ when building extlibs

This commit is contained in:
Jonathan De Wachter 2014-03-11 16:03:04 +01:00
parent 595df2a1a9
commit 050dd6f5dc
4 changed files with 38 additions and 33 deletions

View File

@ -7,6 +7,6 @@ CC=arm-linux-androideabi-gcc
CXX=arm-linux-androideabi-g++ CXX=arm-linux-androideabi-g++
CFLAGS="-I$DESTDIR/usr/include -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16" CFLAGS="-I$DESTDIR/usr/include -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16"
CPPFLAGS="-I$DESTDIR/usr/include -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16" CPPFLAGS="-I$DESTDIR/usr/include -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16"
LDFLAGS="-L$DESTDIR/usr/lib -march=armv7-a -Wl,--fix-cortex-a8 -lstlport_shared" LDFLAGS="-L$DESTDIR/usr/lib -march=armv7-a -Wl,--fix-cortex-a8"
./compile_libs.sh arm-v7a $PATH $CC $CXX "$CFLAGS" "$CPPFLAGS" "$LDFLAGS" ./compile_libs.sh arm-v7a $PATH $CC $CXX "$CFLAGS" "$CPPFLAGS" "$LDFLAGS"

View File

@ -15,37 +15,37 @@ export LDFLAGS=$7
if [ "$1" = "arm" ] if [ "$1" = "arm" ]
then then
ARCH=arm-linux ARCH=arm-linux
ANDROID_ABI=armeabi ANDROID_ABI=armeabi
elif [ "$1" = "arm-v7a" ] elif [ "$1" = "arm-v7a" ]
then then
ARCH=arm-linux ARCH=arm-linux
ANDROID_ABI=armeabi-v7a ANDROID_ABI=armeabi-v7a
elif [ "$1" = "x86" ] elif [ "$1" = "x86" ]
then then
ARCH=i686-linux ARCH=i686-linux
ANDROID_ABI=x86 ANDROID_ABI=x86
elif [ "$1" = "mips" ] elif [ "$1" = "mips" ]
then then
ARCH=mips-linux ARCH=mips-linux
ANDROID_ABI=mips ANDROID_ABI=mips
fi fi
HOST="--host=$ARCH" HOST="--host=$ARCH"
PREFIX="--prefix=$DESTDIR/$1/usr need_version=no" PREFIX="--prefix=$DESTDIR/$1/usr need_version=no"
# Compile OGG # Compile OGG
cd $LOCALDIR/build/libogg-* && sed -i 's/-version-info/-avoid-version/g' src/Makefile.in src/Makefile.am && ./configure $HOST $PREFIX && make && make install 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* rm $DESTDIR/$1/usr/lib/libogg*.so*
# Compile FLAC # 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 && make && make install 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* rm $DESTDIR/$1/usr/lib/libFLAC*.so*
# Compile VORBIS # Compile VORBIS
cd $LOCALDIR/build/libvorbis-* && sed -i 's/-version-info/-avoid-version/g' lib/Makefile.in lib/Makefile.am && ./configure $HOST $PREFIX && make && make install 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* rm $DESTDIR/$1/usr/lib/libvorbis*.so*
# Compile libsndfile (important: --disable-sqlite) # Compile libsndfile (important: --disable-sqlite)

View File

@ -2,37 +2,43 @@
create_toolchain () { create_toolchain () {
export SYSROOT=$NDK/platforms/android-$1/arch-$2/ # abort if already created
MAKE=$NDK/build/tools/make-standalone-toolchain.sh
PLATFORM=--platform=android-$1
DIR=--install-dir=toolchains/$2
# Abort if already created
if [ -d "$PWD/toolchains/$2" ] if [ -d "$PWD/toolchains/$2" ]
then then
return return
fi fi
# save the working directory and move to the NDK directory
WORKING_DIRECTORY=$PWD
cd $NDK
if [ "$2" = "arm" ] # prepare the command according to chosen options
then PLATFORM=--platform=android-$1
TOOLCHAIN=--toolchain=arm-linux-androideabi-4.8 DIR=--install-dir=$WORKING_DIRECTORY/toolchains/$2
elif [ "$2" = "x86" ] MAKE=$NDK/build/tools/make-standalone-toolchain.sh
then
TOOLCHAIN=--toolchain=x86-4.8
elif [ "$2" = "mips" ]
then
TOOLCHAIN=--toolchain=mipsel-linux-android-4.8
else
echo "Abort."
exit 1
fi
$MAKE $PLATFORM $TOOLCHAIN $DIR --stl=stlport if [ "$2" = "arm" ]
then
TOOLCHAIN=--toolchain=arm-linux-androideabi-4.8
elif [ "$2" = "x86" ]
then
TOOLCHAIN=--toolchain=x86-4.8
elif [ "$2" = "mips" ]
then
TOOLCHAIN=--toolchain=mipsel-linux-android-4.8
else
echo "Abort."
exit 1
fi
# move linux/soundcard.h to sys/soundcard.h # create the standalone toolchain
mv $PWD/toolchains/$2/sysroot/usr/include/linux/soundcard.h $PWD/toolchains/$2/sysroot/usr/include/sys $MAKE $PLATFORM $TOOLCHAIN $DIR --stl=libc++
# go back to our working directory
cd $WORKING_DIRECTORY
# move linux/soundcard.h to sys/soundcard.h
mv $PWD/toolchains/$2/sysroot/usr/include/linux/soundcard.h $PWD/toolchains/$2/sysroot/usr/include/sys
} }
create_toolchain 9 arm create_toolchain 9 arm

View File

@ -17,7 +17,6 @@ JPEG=jpeg-$JPEG_VERSION
FREETYPE_VERSION=2.4.0 FREETYPE_VERSION=2.4.0
FREETYPE=freetype-$FREETYPE_VERSION FREETYPE=freetype-$FREETYPE_VERSION
mkdir build mkdir build
wget -nc -P src http://downloads.xiph.org/releases/flac/$FLAC.tar.gz wget -nc -P src http://downloads.xiph.org/releases/flac/$FLAC.tar.gz