2013-05-08 14:10:07 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-03-03 11:02:44 +01:00
|
|
|
if [ -z "$2" ]; then
|
|
|
|
ARCH=arm
|
|
|
|
else
|
|
|
|
ARCH="$2"
|
|
|
|
fi
|
|
|
|
|
|
|
|
CC_VER="4.9"
|
|
|
|
case $ARCH in
|
|
|
|
arm)
|
|
|
|
DEST_CPU="$ARCH"
|
|
|
|
SUFFIX="$ARCH-linux-androideabi"
|
|
|
|
TOOLCHAIN_NAME="$SUFFIX"
|
|
|
|
;;
|
|
|
|
x86)
|
|
|
|
DEST_CPU="ia32"
|
|
|
|
SUFFIX="i686-linux-android"
|
|
|
|
TOOLCHAIN_NAME="$ARCH"
|
|
|
|
;;
|
|
|
|
x86_64)
|
|
|
|
DEST_CPU="ia32"
|
|
|
|
SUFFIX="$ARCH-linux-android"
|
|
|
|
TOOLCHAIN_NAME="$ARCH"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unsupported architecture provided: $ARCH"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2013-05-08 14:10:07 +02:00
|
|
|
export TOOLCHAIN=$PWD/android-toolchain
|
|
|
|
mkdir -p $TOOLCHAIN
|
|
|
|
$1/build/tools/make-standalone-toolchain.sh \
|
2016-03-03 11:02:44 +01:00
|
|
|
--toolchain=$TOOLCHAIN_NAME-$CC_VER \
|
|
|
|
--arch=$ARCH \
|
2013-05-08 14:10:07 +02:00
|
|
|
--install-dir=$TOOLCHAIN \
|
2015-08-23 05:40:41 +02:00
|
|
|
--platform=android-21
|
2013-05-08 14:10:07 +02:00
|
|
|
export PATH=$TOOLCHAIN/bin:$PATH
|
2016-03-03 11:02:44 +01:00
|
|
|
export AR=$TOOLCHAIN/bin/$SUFFIX-ar
|
|
|
|
export CC=$TOOLCHAIN/bin/$SUFFIX-gcc
|
|
|
|
export CXX=$TOOLCHAIN/bin/$SUFFIX-g++
|
|
|
|
export LINK=$TOOLCHAIN/bin/$SUFFIX-g++
|
2013-05-08 14:10:07 +02:00
|
|
|
|
|
|
|
./configure \
|
2016-03-03 11:02:44 +01:00
|
|
|
--dest-cpu=$DEST_CPU \
|
|
|
|
--dest-os=android \
|
|
|
|
--without-snapshot \
|
|
|
|
--openssl-no-asm
|