summaryrefslogtreecommitdiff
path: root/configure-android
diff options
context:
space:
mode:
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}"