2012-07-03 08:08:25 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
|
|
|
|
F="configure-android"
|
2019-02-11 03:43:51 +00:00
|
|
|
IS_USING_LLVM="0"
|
2012-07-03 08:08:25 +00:00
|
|
|
|
|
|
|
if test "$*" = "--help" -o "$*" = "-h"; then
|
2012-07-09 09:02:13 +00:00
|
|
|
echo "$F [--use-ndk-cflags] [OPTIONS]"
|
2012-07-03 08:08:25 +00:00
|
|
|
echo ""
|
|
|
|
echo "where:"
|
2012-08-07 09:06:10 +00:00
|
|
|
echo " --use-ndk-cflags Optional parameter to use the same compilation flags"
|
2014-04-30 02:37:00 +00:00
|
|
|
echo " as the one used by ndk-build. Android NDK r9 or later"
|
|
|
|
echo " is required when using this option."
|
2012-08-07 09:06:10 +00:00
|
|
|
echo " OPTIONS Other options that will be passed directly to"
|
|
|
|
echo " ./aconfigure script. Run ./aconfigure --help"
|
|
|
|
echo " for more info."
|
|
|
|
echo ""
|
|
|
|
echo "Environment variables:"
|
|
|
|
echo " ANDROID_NDK_ROOT Specify the directory of Android NDK to use."
|
|
|
|
echo " APP_PLATFORM Optionally specify the platform level used, e.g."
|
2013-09-09 05:53:58 +00:00
|
|
|
echo " android-9. By default, configure will use the"
|
|
|
|
echo " maximum platform level detected."
|
|
|
|
echo " TARGET_ABI Optionally specify a single target architecture,"
|
2019-06-21 04:30:42 +00:00
|
|
|
echo " e.g. armeabi-v7a, arm64-v8a, mips, x86. By default, "
|
|
|
|
echo " the target architecture is arm64-v8a."
|
2013-09-30 05:12:29 +00:00
|
|
|
echo " IGNORE_CFLAGS Optionally specify compilation flags to be ignored."
|
|
|
|
echo " Each grepped flag that satisfies the criteria will"
|
|
|
|
echo " be ignored. Default:"
|
2017-07-05 04:01:33 +00:00
|
|
|
echo " IGNORE_CFLAGS=\"\-M\|\-f*stack\|\-f*alias\|\-\<g\>\""
|
2013-09-30 05:12:29 +00:00
|
|
|
echo " Only used when --use-ndk-cflags is specified."
|
2012-08-07 09:06:10 +00:00
|
|
|
echo ""
|
2012-07-03 08:08:25 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2015-08-05 04:26:06 +00:00
|
|
|
if test "x${ANDROID_NDK_ROOT}" = "x" || test ! -e ${ANDROID_NDK_ROOT}; then
|
|
|
|
echo "$F error: ANDROID_NDK_ROOT env var is not specified or invalid"
|
2012-07-09 09:02:13 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-05-31 06:08:47 +00:00
|
|
|
# The BRE version somehow does not work well on MacOSX
|
|
|
|
#NDK_VER=`sed -n -e 's/.*Pkg.Revision *= *\([0-9]\+\).*/\1/p' ${ANDROID_NDK_ROOT}/source.properties`
|
|
|
|
NDK_VER=`sed -n -E 's/^Pkg.Revision *= *([0-9]+).*/\1/p' ${ANDROID_NDK_ROOT}/source.properties`
|
2019-02-11 03:43:51 +00:00
|
|
|
|
2012-08-07 09:06:10 +00:00
|
|
|
if test "x$APP_PLATFORM" = "x"; then
|
|
|
|
APP_PLATFORM=`ls ${ANDROID_NDK_ROOT}/platforms/ | sed 's/android-//' | sort -gr | head -1`
|
|
|
|
APP_PLATFORM="android-${APP_PLATFORM}"
|
|
|
|
echo "$F: APP_PLATFORM not specified, using ${APP_PLATFORM}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$TARGET_ABI" = "x"; then
|
2019-06-21 04:30:42 +00:00
|
|
|
TARGET_ABI="arm64-v8a"
|
2012-08-07 09:06:10 +00:00
|
|
|
echo "$F: TARGET_ABI not specified, using ${TARGET_ABI}"
|
|
|
|
fi
|
|
|
|
|
2015-07-06 07:33:40 +00:00
|
|
|
if test "$TARGET_ABI" = "x86_64" || test "$TARGET_ABI" = "mips64"; then
|
|
|
|
USR_LIB="/usr/lib64"
|
|
|
|
else
|
|
|
|
USR_LIB="/usr/lib"
|
2015-08-05 04:26:06 +00:00
|
|
|
fi
|
|
|
|
|
2015-07-06 07:33:40 +00:00
|
|
|
|
2019-02-11 03:43:51 +00:00
|
|
|
if test "$1" = "--use-ndk-cflags" || [ "${NDK_VER}" -ge "17" ]; then
|
|
|
|
if test "$1" = "--use-ndk-cflags"; then
|
|
|
|
shift # don't pass this param to main configure script
|
|
|
|
fi
|
|
|
|
|
|
|
|
ADD_CFLAGS="0"
|
|
|
|
ADD_CXXFLAGS="0"
|
2019-12-19 02:57:20 +00:00
|
|
|
ADD_LDFLAGS="0"
|
2017-07-05 04:01:33 +00:00
|
|
|
ADD_NDK_TOOLCHAIN="0"
|
|
|
|
ADD_NDK_TARGET="0"
|
2013-09-30 05:12:29 +00:00
|
|
|
if test "x${IGNORE_CFLAGS}" = "x"; then
|
2019-12-19 02:57:20 +00:00
|
|
|
IGNORE_CFLAGS="\-M\|\-f*stack\|\-f*alias\|\-\<g\>\|\-DNDEBUG\|\-O"
|
|
|
|
fi
|
|
|
|
if test "x${IGNORE_CPPFLAGS}" = "x"; then
|
|
|
|
IGNORE_CPPFLAGS="\-M\|\-f*stack\|\-f*alias\|\-\<g\>\|\-DNDEBUG\|\-O\|\-std\="
|
2013-09-30 05:12:29 +00:00
|
|
|
fi
|
2016-08-08 10:19:15 +00:00
|
|
|
|
|
|
|
if test -f ${ANDROID_NDK_ROOT}/build/ndk-build; then
|
|
|
|
NDK_BUILD=${ANDROID_NDK_ROOT}/build/ndk-build
|
|
|
|
else
|
|
|
|
NDK_BUILD=${ANDROID_NDK_ROOT}/ndk-build
|
|
|
|
fi
|
2015-08-05 04:26:06 +00:00
|
|
|
|
2016-08-08 10:19:15 +00:00
|
|
|
NDK_OUT=`${NDK_BUILD} -n -C pjsip-apps/src/samples/android_sample APP_PLATFORM=${APP_PLATFORM} APP_ABI=${TARGET_ABI}`
|
2015-08-05 04:26:06 +00:00
|
|
|
if test ! "${NDK_OUT}"; then
|
|
|
|
echo "$F error: failed to run ndk-build, check ANDROID_NDK_ROOT env var"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-12-19 02:57:20 +00:00
|
|
|
#echo "====="
|
|
|
|
#echo "NDK_OUT : ${NDK_OUT}"
|
|
|
|
#echo "====="
|
2017-07-05 04:01:33 +00:00
|
|
|
|
2015-08-05 04:26:06 +00:00
|
|
|
for i in $NDK_OUT; do
|
2013-09-09 05:53:58 +00:00
|
|
|
|
|
|
|
# Parse NDK CXXFLAGS
|
2019-02-11 03:43:51 +00:00
|
|
|
if test "${ADD_CXXFLAGS}" = "1"; then
|
|
|
|
if test "$i" = "-o"; then
|
|
|
|
ADD_CXXFLAGS="0"
|
|
|
|
continue
|
|
|
|
fi
|
2019-12-19 02:57:20 +00:00
|
|
|
if test "$i" = "-c"; then
|
|
|
|
continue
|
|
|
|
fi
|
2019-02-11 03:43:51 +00:00
|
|
|
if test "x`echo $i|grep 'dummy'`" != "x"; then
|
|
|
|
continue
|
|
|
|
fi
|
2019-12-19 11:31:55 +00:00
|
|
|
if test "x`echo $i|grep ${IGNORE_CPPFLAGS}`" != "x"; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
# Check if flag is already in CFLAGS
|
|
|
|
ISDUP="0"
|
|
|
|
for j in $NDK_CFLAGS; do
|
|
|
|
if test "$i" = "$j"; then
|
|
|
|
ISDUP="1"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if test "${ISDUP}" = "1"; then
|
|
|
|
continue
|
2013-09-09 05:53:58 +00:00
|
|
|
fi
|
2019-12-19 11:31:55 +00:00
|
|
|
NDK_CXXFLAGS="${NDK_CXXFLAGS} $i"
|
2019-02-11 03:43:51 +00:00
|
|
|
continue
|
2013-09-09 05:53:58 +00:00
|
|
|
fi
|
2019-02-11 03:43:51 +00:00
|
|
|
|
2013-09-09 05:53:58 +00:00
|
|
|
# Parse NDK CFLAGS
|
2019-02-11 03:43:51 +00:00
|
|
|
if test "${ADD_CFLAGS}" = "1"; then
|
|
|
|
if test "$i" = "-c"; then
|
|
|
|
ADD_CFLAGS="0"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if test "x`echo $i|grep 'dummy'`" != "x"; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if test "x`echo $i|grep ${IGNORE_CFLAGS}`" = "x"; then
|
2017-07-05 04:01:33 +00:00
|
|
|
if test "${ADD_NDK_TOOLCHAIN}" = "0" -a "x`echo $i|grep '\-gcc-toolchain'`" != "x"; then
|
|
|
|
ADD_NDK_TOOLCHAIN="1"
|
|
|
|
elif test "${ADD_NDK_TARGET}" = "0" -a "x`echo $i|grep '\-target'`" != "x"; then
|
|
|
|
ADD_NDK_TARGET="1"
|
|
|
|
elif test "${ADD_NDK_TOOLCHAIN}" = "1"; then
|
|
|
|
NDK_TOOLCHAIN="$i"
|
|
|
|
ADD_NDK_TOOLCHAIN="2"
|
|
|
|
elif test "${ADD_NDK_TARGET}" = "1"; then
|
|
|
|
NDK_TARGET="$i"
|
|
|
|
ADD_NDK_TARGET="2"
|
|
|
|
fi
|
2013-09-30 05:12:29 +00:00
|
|
|
NDK_CFLAGS="${NDK_CFLAGS} $i"
|
2013-09-09 05:53:58 +00:00
|
|
|
fi
|
2019-02-11 03:43:51 +00:00
|
|
|
continue
|
2012-07-09 09:02:13 +00:00
|
|
|
fi
|
2019-02-11 03:43:51 +00:00
|
|
|
|
2019-12-19 02:57:20 +00:00
|
|
|
# Parse NDK LDFLAGS
|
|
|
|
if test "${ADD_LDFLAGS}" = "1"; then
|
|
|
|
if test "$i" = "-o"; then
|
|
|
|
ADD_LDFLAGS="0"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if test "x`echo $i|grep 'dummy'`" != "x"; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if test "x`echo $i|grep '.so'`" != "x"; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
NDK_LDFLAGS="${NDK_LDFLAGS} $i"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2019-02-11 03:43:51 +00:00
|
|
|
# Find gcc or clang
|
2017-07-05 04:01:33 +00:00
|
|
|
if test "x${NDK_CC}" = "x"; then
|
|
|
|
if test "x`echo $i | grep 'gcc'`" != "x" -o "x`echo $i | grep 'clang'`" != "x"; then
|
|
|
|
NDK_CC=$i
|
2019-02-11 03:43:51 +00:00
|
|
|
ADD_CFLAGS="1"
|
|
|
|
if test "x`echo ${NDK_CC} | grep 'clang'`" != "x"; then
|
|
|
|
IS_USING_LLVM="1"
|
|
|
|
#echo "---using llvm"
|
|
|
|
fi
|
2019-12-19 02:57:20 +00:00
|
|
|
continue
|
2017-07-05 04:01:33 +00:00
|
|
|
fi
|
2012-07-09 09:02:13 +00:00
|
|
|
fi
|
2019-02-11 03:43:51 +00:00
|
|
|
|
|
|
|
# Find g++ or clang++
|
|
|
|
if test "x${NDK_CXX}" = "x"; then
|
|
|
|
if test "x`echo $i | grep 'g++'`" != "x"; then
|
|
|
|
NDK_CXX=$i
|
|
|
|
ADD_CXXFLAGS="1"
|
2019-12-19 02:57:20 +00:00
|
|
|
continue
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Find linking/LDFLAGS
|
|
|
|
if test "x${NDK_LDFLAGS}" = "x"; then
|
|
|
|
if test "x`echo $i | grep '\-\<shared\>'`" != "x"; then
|
|
|
|
ADD_LDFLAGS="1"
|
|
|
|
continue
|
2019-02-11 03:43:51 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Find ar tool
|
2019-12-19 02:57:20 +00:00
|
|
|
if test "x${NDK_AR}" = "x" -a "x${NDK_CC}" != "x" -a "x`echo $i|grep '\-\<ar\>'`" != "x"; then
|
|
|
|
# In some NDKs, e.g: r17c, gcc/clang and ar have different path
|
|
|
|
#if test "$(dirname \"${NDK_CC}\")" = "$(dirname \"${i}\")"; then
|
2019-02-11 03:43:51 +00:00
|
|
|
NDK_AR=$i
|
|
|
|
#echo "--- found AR=${NDK_AR}"
|
2019-12-19 02:57:20 +00:00
|
|
|
continue
|
|
|
|
#fi
|
2013-09-09 05:53:58 +00:00
|
|
|
fi
|
|
|
|
|
2019-02-11 03:43:51 +00:00
|
|
|
# Find ranlib tool
|
2019-12-19 02:57:20 +00:00
|
|
|
if test "x${NDK_RANLIB}" = "x" -a "x${NDK_CC}" != "x" -a "x`echo $i|grep '\-\<ranlib\>'`" != "x"; then
|
|
|
|
#if test "$(dirname \"${NDK_CC}\")" = "$(dirname \"${i}\")"; then
|
2019-02-11 03:43:51 +00:00
|
|
|
NDK_RANLIB=$i
|
|
|
|
#echo "--- found RANLIB=${NDK_RANLIB}"
|
2019-12-19 02:57:20 +00:00
|
|
|
#fi
|
2019-02-11 03:43:51 +00:00
|
|
|
fi
|
|
|
|
done
|
2017-07-05 04:01:33 +00:00
|
|
|
|
2015-08-05 04:26:06 +00:00
|
|
|
# Get target host from NDK toolchain dir name
|
|
|
|
TARGET_HOST=`echo ${NDK_CC} | sed -e 's/.*\/toolchains\/\([^\/]*\).*/\1/'`
|
|
|
|
|
|
|
|
# Remove version number suffix (otherwise config.sub will return error, perhaps it just doesn't like the format)
|
|
|
|
TARGET_HOST=`echo ${TARGET_HOST} | sed -e 's/\-[0-9\.]*$//'`
|
|
|
|
|
2019-02-11 03:43:51 +00:00
|
|
|
# Get target from '-target' param when TARGET_HOST is 'llvm'
|
|
|
|
if test "$TARGET_HOST" = "llvm"; then
|
|
|
|
TARGET_HOST=`echo ${NDK_CFLAGS} | sed -e 's/.*-target \([^- ]*\).*/\1/'`
|
|
|
|
fi
|
|
|
|
|
2015-08-05 04:26:06 +00:00
|
|
|
# Make sure target host string has 'linux-android' in it
|
|
|
|
if test "x`echo ${TARGET_HOST} | grep 'linux-android'`" = "x"; then
|
|
|
|
#TARGET_HOST=`echo ${TARGET_HOST} | sed -e 's/\(.*\)\-\([0-9\.]*\)/\1-linux-android-\2/'`
|
2015-12-11 03:55:01 +00:00
|
|
|
TARGET_HOST="${TARGET_HOST}-linux-android"
|
2015-08-05 04:26:06 +00:00
|
|
|
fi
|
|
|
|
|
2017-07-05 04:01:33 +00:00
|
|
|
# Set the binutils
|
|
|
|
if test "x${NDK_TOOLCHAIN}" = "x"; then
|
2019-02-11 03:43:51 +00:00
|
|
|
if test "x${NDK_AR}" = "x"; then
|
|
|
|
NDK_CC_DIR=$(dirname "${NDK_CC}")
|
|
|
|
NDK_AR=`find ${NDK_CC_DIR} -name "*ar" | grep -m 1 -v "gcc"`
|
|
|
|
fi
|
2019-12-19 02:57:20 +00:00
|
|
|
export LDFLAGS="${LDFLAGS}"
|
2017-07-05 04:01:33 +00:00
|
|
|
else
|
2017-09-29 02:30:23 +00:00
|
|
|
# find ar and ranlib
|
2019-02-11 03:43:51 +00:00
|
|
|
if test "x${NDK_AR}" = "x"; then
|
|
|
|
NDK_AR=`find ${NDK_TOOLCHAIN}/bin/ -name "*-ar" | grep -m 1 -v "gcc"`
|
|
|
|
fi
|
|
|
|
if test "x${NDK_RANLIB}" = "x"; then
|
|
|
|
NDK_RANLIB=`find ${NDK_TOOLCHAIN}/bin/ -name "*-ranlib" | grep -m 1 -v "gcc"`
|
|
|
|
fi
|
2019-12-19 02:57:20 +00:00
|
|
|
export LDFLAGS="${LDFLAGS} -target ${NDK_TARGET} -gcc-toolchain ${NDK_TOOLCHAIN}"
|
2019-02-11 03:43:51 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x${NDK_RANLIB}" = "x"; then
|
|
|
|
NDK_RANLIB="${NDK_AR} s"
|
|
|
|
fi
|
|
|
|
|
|
|
|
TC_AR=${NDK_AR}
|
|
|
|
TC_RANLIB=${NDK_RANLIB}
|
|
|
|
if test "x${TC_AR}" != "x" -a "x${TC_RANLIB}" != "x"; then
|
|
|
|
export AR="${TC_AR}"
|
|
|
|
export RANLIB="${TC_RANLIB}"
|
|
|
|
fi
|
2017-07-05 04:01:33 +00:00
|
|
|
|
2016-12-16 06:22:31 +00:00
|
|
|
export TARGET_ABI="${TARGET_ABI}"
|
2013-09-09 05:53:58 +00:00
|
|
|
export CC="${NDK_CC}"
|
|
|
|
export CXX="${NDK_CXX}"
|
|
|
|
|
2019-12-19 11:31:55 +00:00
|
|
|
export CPPFLAGS="${CPPFLAGS}"
|
|
|
|
export CFLAGS="${NDK_CFLAGS} ${CFLAGS} ${CPPFLAGS}"
|
|
|
|
export CXXFLAGS="${NDK_CXXFLAGS} ${CPPFLAGS}"
|
|
|
|
export LDFLAGS="${NDK_LDFLAGS} ${LDFLAGS}"
|
2019-12-19 02:57:20 +00:00
|
|
|
export LIBS="${LIBS}"
|
2012-07-09 09:02:13 +00:00
|
|
|
|
2013-09-09 05:53:58 +00:00
|
|
|
else
|
2012-07-09 09:02:13 +00:00
|
|
|
|
2015-08-05 04:26:06 +00:00
|
|
|
if test "$TARGET_ABI" != "armeabi"; then
|
|
|
|
echo "$F error: For targets other than 'armeabi', specify --use-ndk-cflags"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
TARGET_HOST="arm-linux-androideabi"
|
|
|
|
|
|
|
|
ANDROID_TC_VER=`ls -d ${ANDROID_NDK_ROOT}/toolchains/${TARGET_HOST}-* | sed 's/clang/0/' | sort -gr | head -1`
|
2013-09-23 08:58:23 +00:00
|
|
|
ANDROID_TC=`ls -d ${ANDROID_TC_VER}/prebuilt/* | grep -v gdbserver | head -1`
|
2013-09-09 05:53:58 +00:00
|
|
|
if test ! -d ${ANDROID_TC}; then
|
|
|
|
echo "$F error: unable to find directory ${ANDROID_TC} in Android NDK"
|
|
|
|
exit 1
|
|
|
|
fi
|
2012-07-03 08:08:25 +00:00
|
|
|
|
2013-09-09 05:53:58 +00:00
|
|
|
export ANDROID_SYSROOT="${ANDROID_NDK_ROOT}/platforms/${APP_PLATFORM}/arch-arm"
|
|
|
|
if test ! -d ${ANDROID_SYSROOT}; then
|
|
|
|
echo "$F error: unable to find sysroot dir ${ANDROID_SYSROOT} in Android NDK"
|
|
|
|
exit 1
|
|
|
|
fi
|
2012-07-09 09:02:13 +00:00
|
|
|
|
2016-08-25 01:36:33 +00:00
|
|
|
export TARGET_ABI="${TARGET_ABI}"
|
2013-09-09 05:53:58 +00:00
|
|
|
export CC="${ANDROID_TC}/bin/${TARGET_HOST}-gcc"
|
|
|
|
export CXX="${ANDROID_TC}/bin/${TARGET_HOST}-g++"
|
2013-11-13 05:47:56 +00:00
|
|
|
export AR="${ANDROID_TC}/bin/${TARGET_HOST}-ar"
|
|
|
|
export RANLIB="${ANDROID_TC}/bin/${TARGET_HOST}-ranlib"
|
2013-09-09 05:53:58 +00:00
|
|
|
|
2016-07-19 07:41:15 +00:00
|
|
|
export LDFLAGS="${LDFLAGS} --sysroot=${ANDROID_SYSROOT}"
|
2013-09-09 05:53:58 +00:00
|
|
|
export LIBS="${LIBS} -lc -lgcc"
|
2016-07-19 07:41:15 +00:00
|
|
|
export CFLAGS="${CFLAGS} --sysroot=${ANDROID_SYSROOT}"
|
2013-12-13 09:07:53 +00:00
|
|
|
export CPPFLAGS="${CFLAGS} -fexceptions -frtti"
|
|
|
|
export CXXFLAGS="${CXXFLAGS} -shared --sysroot=${ANDROID_SYSROOT} -fexceptions -frtti"
|
2013-09-09 05:53:58 +00:00
|
|
|
|
|
|
|
fi
|
2012-07-03 08:08:25 +00:00
|
|
|
|
2015-08-05 04:26:06 +00:00
|
|
|
if test "x${CC}" = "x" || test ! -e ${CC}; then
|
|
|
|
echo "$F error: compiler not found, please check environment settings (TARGET_ABI, etc)"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2013-12-18 11:42:04 +00:00
|
|
|
# C++ STL
|
|
|
|
# Note: STL for pjsua2 sample app is specified in pjsip-apps/src/swig/java/android/jni/Application.mk
|
|
|
|
|
2019-02-11 03:43:51 +00:00
|
|
|
if test "${IS_USING_LLVM}" = "1"; then
|
2017-07-05 04:01:33 +00:00
|
|
|
# llvm
|
|
|
|
STDCPP_TC="${ANDROID_NDK_ROOT}/sources/cxx-stl/llvm-libc++"
|
2019-12-19 02:57:20 +00:00
|
|
|
#STDCPP_CFLAGS="-I${STDCPP_TC}/include"
|
|
|
|
#STDCPP_LIBS="-lc++_static -lc++abi"
|
|
|
|
STDCPP_LIBS="${STDCPP_TC}/libs/${TARGET_ABI}/libc++_shared.so"
|
|
|
|
#STDCPP_LDFLAGS="-L${STDCPP_TC}/libs/${TARGET_ABI}/"
|
2019-02-11 03:43:51 +00:00
|
|
|
else
|
|
|
|
# gnustl
|
|
|
|
STDCPP_TC_VER=`ls -d ${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/[0-9]* | sort -gr | head -1`
|
|
|
|
STDCPP_CFLAGS="-I${STDCPP_TC_VER}/include -I${STDCPP_TC_VER}/libs/${TARGET_ABI}/include"
|
|
|
|
STDCPP_LIBS="-lgnustl_static"
|
|
|
|
STDCPP_LDFLAGS="-L${STDCPP_TC_VER}/libs/${TARGET_ABI}/"
|
2017-07-05 04:01:33 +00:00
|
|
|
fi
|
2013-12-18 11:42:04 +00:00
|
|
|
|
|
|
|
# stlport
|
|
|
|
#STDCPP_CFLAGS="-I${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/stlport"
|
2016-07-19 07:41:15 +00:00
|
|
|
#STDCPP_LIBS="-lstlport_static -ldl"
|
2014-04-30 02:37:00 +00:00
|
|
|
#STDCPP_LDFLAGS="-L${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/${TARGET_ABI}"
|
2013-12-18 11:42:04 +00:00
|
|
|
|
2019-12-19 11:31:55 +00:00
|
|
|
export CFLAGS="${CFLAGS}"
|
|
|
|
export LIBS="${LIBS} ${STDCPP_LIBS}"
|
2013-12-18 11:42:04 +00:00
|
|
|
export LDFLAGS="${LDFLAGS} ${STDCPP_LDFLAGS}"
|
2019-12-19 11:31:55 +00:00
|
|
|
export CPPFLAGS="${CPPFLAGS}"
|
|
|
|
export CXXFLAGS="${CXXFLAGS} ${STDCPP_CFLAGS}"
|
2013-12-18 11:42:04 +00:00
|
|
|
|
2012-07-09 09:02:13 +00:00
|
|
|
# Print settings
|
|
|
|
if test "1" = "1"; then
|
|
|
|
echo "$F: calling ./configure with env vars:"
|
2019-02-11 03:43:51 +00:00
|
|
|
echo " NDK_TOOLCHAIN = ${NDK_TOOLCHAIN}"
|
2012-07-09 09:02:13 +00:00
|
|
|
echo " CC = ${CC}"
|
|
|
|
echo " CXX = ${CXX}"
|
|
|
|
echo " CFLAGS = ${CFLAGS}"
|
|
|
|
echo " CXXFLAGS = ${CXXFLAGS}"
|
|
|
|
echo " LDFLAGS = ${LDFLAGS}"
|
|
|
|
echo " LIBS = ${LIBS}"
|
2013-11-13 05:47:56 +00:00
|
|
|
echo " AR = ${AR}"
|
|
|
|
echo " RANLIB = ${RANLIB}"
|
2015-08-05 04:26:06 +00:00
|
|
|
echo " TARGET_HOST = ${TARGET_HOST}"
|
2016-12-16 06:22:31 +00:00
|
|
|
echo " TARGET_ABI = ${TARGET_ABI}"
|
2012-07-09 09:02:13 +00:00
|
|
|
fi
|
|
|
|
|
2015-03-20 10:23:30 +00:00
|
|
|
./configure --host=${TARGET_HOST} $*
|