Changeset 5620 for pjproject/trunk/configure-android
- Timestamp:
- Jul 5, 2017 4:01:33 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/configure-android
r5499 r5620 27 27 echo " Each grepped flag that satisfies the criteria will" 28 28 echo " be ignored. Default:" 29 echo " IGNORE_CFLAGS=\"\-M\|\-f*stack\|\-f*alias\ ""29 echo " IGNORE_CFLAGS=\"\-M\|\-f*stack\|\-f*alias\|\-\<g\>\"" 30 30 echo " Only used when --use-ndk-cflags is specified." 31 31 echo "" … … 59 59 shift 60 60 ADD_CFLAGS="1" 61 ADD_NDK_TOOLCHAIN="0" 62 ADD_NDK_TARGET="0" 61 63 if test "x${IGNORE_CFLAGS}" = "x"; then 62 IGNORE_CFLAGS="\-M\|\-f*stack\|\-f*alias "64 IGNORE_CFLAGS="\-M\|\-f*stack\|\-f*alias\|\-\<g\>" 63 65 fi 64 66 … … 74 76 exit 1 75 77 fi 78 79 echo "=====" 80 echo "NDK_OUT : ${NDK_OUT}" 81 echo "=====" 76 82 77 83 for i in $NDK_OUT; do … … 85 91 NDK_CXXFLAGS="${NDK_CXXFLAGS} $i" 86 92 fi 87 88 93 # Parse NDK CFLAGS 89 94 if test "x${NDK_CC}" != "x" -a "x`echo $i|grep 'dummy'`" = "x" -a "${ADD_CFLAGS}" = "1"; then 90 95 if test "$i" = "-c"; then ADD_CFLAGS="0"; else 91 96 if test "x`echo $i|grep ${IGNORE_CFLAGS}`" = "x"; then 97 if test "${ADD_NDK_TOOLCHAIN}" = "0" -a "x`echo $i|grep '\-gcc-toolchain'`" != "x"; then 98 ADD_NDK_TOOLCHAIN="1" 99 elif test "${ADD_NDK_TARGET}" = "0" -a "x`echo $i|grep '\-target'`" != "x"; then 100 ADD_NDK_TARGET="1" 101 elif test "${ADD_NDK_TOOLCHAIN}" = "1"; then 102 NDK_TOOLCHAIN="$i" 103 ADD_NDK_TOOLCHAIN="2" 104 elif test "${ADD_NDK_TARGET}" = "1"; then 105 NDK_TARGET="$i" 106 ADD_NDK_TARGET="2" 107 fi 92 108 NDK_CFLAGS="${NDK_CFLAGS} $i" 93 109 fi 94 110 fi 95 111 fi 96 97 # Find gcc toolchain 98 if test "x${NDK_CC}" = "x" -a "x`echo $i | grep 'gcc'`" != "x"; then 99 NDK_CC=$i 112 # Find gcc or clang toolchain 113 if test "x${NDK_CC}" = "x"; then 114 if test "x`echo $i | grep 'gcc'`" != "x" -o "x`echo $i | grep 'clang'`" != "x"; then 115 NDK_CC=$i 116 fi 100 117 fi 101 118 # Find g++ toolchain … … 104 121 fi 105 122 done 123 124 echo "NDK_CC : ${NDK_CC}" 106 125 107 126 # Get target host from NDK toolchain dir name … … 117 136 fi 118 137 138 # Set the binutils 139 if test "x${NDK_TOOLCHAIN}" = "x"; then 140 export AR=`echo ${NDK_CXX}|sed 's/-g++/-ar/'`; 141 export RANLIB=`echo ${NDK_CXX}|sed 's/-g++/-ranlib/'`; 142 export LDFLAGS="${LDFLAGS} --sysroot=${ANDROID_SYSROOT}" 143 else 144 #export AR="${NDK_TOOLCHAIN}/bin/${NDK_TARGET}-ar" 145 #export RANLIB="${NDK_TOOLCHAIN}/bin/${NDK_TARGET}-ranlib" 146 TARGET_HOST="arm-linux-androideabi" 147 export LDFLAGS="${LDFLAGS} --sysroot=${ANDROID_SYSROOT} -target ${NDK_TARGET} -gcc-toolchain ${NDK_TOOLCHAIN}" 148 fi 149 119 150 export TARGET_ABI="${TARGET_ABI}" 120 151 export CC="${NDK_CC}" 121 152 export CXX="${NDK_CXX}" 122 export AR=`echo ${NDK_CXX}|sed 's/-g++/-ar/'`; 123 export RANLIB=`echo ${NDK_CXX}|sed 's/-g++/-ranlib/'`; 124 125 export LDFLAGS="${LDFLAGS} --sysroot=${ANDROID_SYSROOT}" 153 126 154 export LIBS="${LIBS} -lc -lgcc -ldl" 127 155 export CFLAGS="${NDK_CFLAGS} ${CFLAGS}" … … 173 201 # Note: STL for pjsua2 sample app is specified in pjsip-apps/src/swig/java/android/jni/Application.mk 174 202 175 # gnustl 176 STDCPP_TC_VER=`ls -d ${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/[0-9]* | sort -gr | head -1` 177 STDCPP_CFLAGS="-I${STDCPP_TC_VER}/include -I${STDCPP_TC_VER}/libs/${TARGET_ABI}/include" 178 STDCPP_LIBS="-lgnustl_static" 179 STDCPP_LDFLAGS="-L${STDCPP_TC_VER}/libs/${TARGET_ABI}/" 203 if test "x${NDK_TOOLCHAIN}" = "x"; then 204 # gnustl 205 STDCPP_TC_VER=`ls -d ${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/[0-9]* | sort -gr | head -1` 206 STDCPP_CFLAGS="-I${STDCPP_TC_VER}/include -I${STDCPP_TC_VER}/libs/${TARGET_ABI}/include" 207 STDCPP_LIBS="-lgnustl_static" 208 STDCPP_LDFLAGS="-L${STDCPP_TC_VER}/libs/${TARGET_ABI}/" 209 else 210 # llvm 211 STDCPP_TC="${ANDROID_NDK_ROOT}/sources/cxx-stl/llvm-libc++" 212 STDCPP_CFLAGS="-I${STDCPP_TC}/include" 213 STDCPP_LIBS="-lc++_static -lc++abi" 214 STDCPP_LDFLAGS="-L${STDCPP_TC}/libs/${TARGET_ABI}/" 215 fi 180 216 181 217 # stlport
Note: See TracChangeset
for help on using the changeset viewer.