From a2752f8522549ee97d29a5d6fa25daea7467ccdc Mon Sep 17 00:00:00 2001 From: Sauw Ming Date: Tue, 3 Jul 2012 08:08:25 +0000 Subject: [PATCH] Re #1516: add configure-android file git-svn-id: https://svn.pjsip.org/repos/pjproject/branches/projects/android@4195 74dad513-b988-da41-8d7b-12977e46ad98 --- configure-android | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 configure-android diff --git a/configure-android b/configure-android new file mode 100755 index 000000000..e016c0f54 --- /dev/null +++ b/configure-android @@ -0,0 +1,47 @@ +#!/bin/sh +# + +F="configure-android" + +if test "$*" = "--help" -o "$*" = "-h"; then + echo "$F [OPTIONS]" + echo "" + echo "where:" + echo " --simulator Optional parameter to specify that the compilation" + echo " target is a simulator." + echo " OPTIONS Other options that will be passed directly to" + echo " ./aconfigure script. Run ./aconfigure --help" + echo " for more info." + exit 0 +fi + +if test "$1" = "--simulator"; then + shift + TARGET_HOST="i686-android-linux" + TC_DIR="x86" +else + TARGET_HOST="arm-linux-androideabi" + TC_DIR=${TARGET_HOST} +fi + +HOST_OS=$(uname -s) +case $HOST_OS in + Darwin) BUILD_MACHINE="darwin-x86";; + Linux) BUILD_MACHINE="linux-x86";; + CYGWIN*|*_NT-*) BUILD_MACHINE="windows";; +esac + +API_VERSION="14" + +ANDROID_TC="${ANDROID_NDK}/toolchains/${TC_DIR}-4.4.3/prebuilt/${BUILD_MACHINE}" + +export ANDROID_SYSROOT="${ANDROID_NDK}/platforms/android-${API_VERSION}/arch-arm" +export CC="${ANDROID_TC}/bin/${TARGET_HOST}-gcc" +export CXX="${ANDROID_TC}/bin/${TARGET_HOST}-g++" +export LDFLAGS+=" -nostdlib -L${ANDROID_SYSROOT}/usr/lib/" +export LIBS+=" -lc -lgcc" +export CFLAGS+=" -I${ANDROID_SYSROOT}/usr/include" +export CPPFLAGS="${CFLAGS}" +export CXXFLAGS+=" -shared --sysroot=${ANDROID_SYSROOT}" + +./configure --host=${TARGET_HOST} --disable-video $*