Changeset 4604


Ignore:
Timestamp:
Sep 30, 2013 5:12:29 AM (11 years ago)
Author:
ming
Message:

Re #1516: Add feature to ignore certain compilation flags from the --use-ndk-cflags option.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/configure-android

    r4599 r4604  
    2323  echo "                   architecture is armeabi. Only used when" 
    2424  echo "                   --use-ndk-cflags is specified." 
     25  echo "  IGNORE_CFLAGS    Optionally specify compilation flags to be ignored." 
     26  echo "                   Each grepped flag that satisfies the criteria will" 
     27  echo "                   be ignored. Default:" 
     28  echo "                   IGNORE_CFLAGS=\"\-M\|\-f*stack\|\-f*alias\"" 
     29  echo "                   Only used when --use-ndk-cflags is specified." 
    2530  echo "" 
    2631  exit 0 
     
    5661  shift 
    5762  ADD_CFLAGS="1" 
     63  if test "x${IGNORE_CFLAGS}" = "x"; then 
     64    IGNORE_CFLAGS="\-M\|\-f*stack\|\-f*alias" 
     65  fi 
    5866  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 
    5967    if test "x${NDK_CXX}" != "x" -a "$i" = "-o"; then break; fi 
     
    6876 
    6977    # Parse NDK CFLAGS 
    70     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 
     78    if test "x${NDK_CC}" != "x" -a "x`echo $i|grep 'hello-jni'`" = "x" -a "${ADD_CFLAGS}" = "1"; then 
    7179      if test "$i" = "-c"; then ADD_CFLAGS="0"; else 
    72         NDK_CFLAGS="${NDK_CFLAGS} $i" 
     80        if test "x`echo $i|grep ${IGNORE_CFLAGS}`" = "x"; then 
     81          NDK_CFLAGS="${NDK_CFLAGS} $i" 
     82        fi 
    7383      fi 
    7484    fi 
     
    8999  export LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}/usr/lib/" 
    90100  export LIBS="${LIBS} -lc -lgcc" 
    91   export CFLAGS="${CFLAGS} ${NDK_CFLAGS}" 
     101  export CFLAGS="${NDK_CFLAGS} ${CFLAGS}" 
    92102  export CPPFLAGS="${CFLAGS}" 
    93103  export CXXFLAGS="${NDK_CXXFLAGS}" 
Note: See TracChangeset for help on using the changeset viewer.