[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

@ -2,37 +2,43 @@
create_toolchain () {
export SYSROOT=$NDK/platforms/android-$1/arch-$2/
MAKE=$NDK/build/tools/make-standalone-toolchain.sh
PLATFORM=--platform=android-$1
DIR=--install-dir=toolchains/$2
# Abort if already created
# abort if already created
if [ -d "$PWD/toolchains/$2" ]
then
return
fi
# save the working directory and move to the NDK directory
WORKING_DIRECTORY=$PWD
cd $NDK
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
# prepare the command according to chosen options
PLATFORM=--platform=android-$1
DIR=--install-dir=$WORKING_DIRECTORY/toolchains/$2
MAKE=$NDK/build/tools/make-standalone-toolchain.sh
$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
mv $PWD/toolchains/$2/sysroot/usr/include/linux/soundcard.h $PWD/toolchains/$2/sysroot/usr/include/sys
# create the standalone toolchain
$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