summaryrefslogtreecommitdiff
path: root/configure-android
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2013-09-30 05:12:29 +0000
committerLiong Sauw Ming <ming@teluu.com>2013-09-30 05:12:29 +0000
commitd2044bee8a3ffc775ce54f4c26d32f5bdf0b8936 (patch)
tree4f74923ff8b089d3a3d535013f192b85f8a3b27b /configure-android
parent4212608149cf4f3cb9f1b9d8194a6fb4888527a1 (diff)
Re #1516: Add feature to ignore certain compilation flags from the --use-ndk-cflags option.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4604 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'configure-android')
-rwxr-xr-xconfigure-android16
1 files changed, 13 insertions, 3 deletions
diff --git a/configure-android b/configure-android
index 5ddfb333..386c01f8 100755
--- a/configure-android
+++ b/configure-android
@@ -22,6 +22,11 @@ if test "$*" = "--help" -o "$*" = "-h"; then
echo " e.g. armeabi-v7a, mips, x86. By default, the target"
echo " architecture is armeabi. Only used when"
echo " --use-ndk-cflags is specified."
+ echo " IGNORE_CFLAGS Optionally specify compilation flags to be ignored."
+ echo " Each grepped flag that satisfies the criteria will"
+ echo " be ignored. Default:"
+ echo " IGNORE_CFLAGS=\"\-M\|\-f*stack\|\-f*alias\""
+ echo " Only used when --use-ndk-cflags is specified."
echo ""
exit 0
fi
@@ -55,6 +60,9 @@ fi
if test "$1" = "--use-ndk-cflags"; then
shift
ADD_CFLAGS="1"
+ if test "x${IGNORE_CFLAGS}" = "x"; then
+ IGNORE_CFLAGS="\-M\|\-f*stack\|\-f*alias"
+ fi
for i in `${ANDROID_NDK_ROOT}/ndk-build -n -C ${ANDROID_NDK_ROOT}/samples/hello-jni NDK_LOG=1 APP_PLATFORM=${APP_PLATFORM} APP_ABI=${TARGET_ABI}`; do
if test "x${NDK_CXX}" != "x" -a "$i" = "-o"; then break; fi
@@ -67,9 +75,11 @@ if test "$1" = "--use-ndk-cflags"; then
fi
# Parse NDK CFLAGS
- if test "x${NDK_CC}" != "x" -a "x`echo $i|grep 'hello-jni'`" = "x" -a "x`echo $i|grep '\-M'`" = "x" -a "${ADD_CFLAGS}" = "1"; then
+ if test "x${NDK_CC}" != "x" -a "x`echo $i|grep 'hello-jni'`" = "x" -a "${ADD_CFLAGS}" = "1"; then
if test "$i" = "-c"; then ADD_CFLAGS="0"; else
- NDK_CFLAGS="${NDK_CFLAGS} $i"
+ if test "x`echo $i|grep ${IGNORE_CFLAGS}`" = "x"; then
+ NDK_CFLAGS="${NDK_CFLAGS} $i"
+ fi
fi
fi
@@ -88,7 +98,7 @@ if test "$1" = "--use-ndk-cflags"; then
export LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}/usr/lib/"
export LIBS="${LIBS} -lc -lgcc"
- export CFLAGS="${CFLAGS} ${NDK_CFLAGS}"
+ export CFLAGS="${NDK_CFLAGS} ${CFLAGS}"
export CPPFLAGS="${CFLAGS}"
export CXXFLAGS="${NDK_CXXFLAGS}"