Ignore:
Timestamp:
Dec 28, 2016 3:40:07 AM (8 years ago)
Author:
nanang
Message:

Re #1900: More merged from trunk (r5512 mistakenly contains merged changes in third-party dir only).

Location:
pjproject/branches/projects/uwp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/uwp

  • pjproject/branches/projects/uwp/configure-android

    r5145 r5513  
    6262    IGNORE_CFLAGS="\-M\|\-f*stack\|\-f*alias" 
    6363  fi 
    64  
    65   NDK_OUT=`${ANDROID_NDK_ROOT}/ndk-build -n -C ${ANDROID_NDK_ROOT}/samples/hello-jni NDK_TOOLCHAIN_VERSION=4.8 APP_PLATFORM=${APP_PLATFORM} APP_ABI=${TARGET_ABI}` 
     64   
     65  if test -f ${ANDROID_NDK_ROOT}/build/ndk-build; then     
     66    NDK_BUILD=${ANDROID_NDK_ROOT}/build/ndk-build 
     67  else  
     68    NDK_BUILD=${ANDROID_NDK_ROOT}/ndk-build 
     69  fi 
     70 
     71  NDK_OUT=`${NDK_BUILD} -n -C pjsip-apps/src/samples/android_sample APP_PLATFORM=${APP_PLATFORM} APP_ABI=${TARGET_ABI}` 
    6672  if test ! "${NDK_OUT}"; then 
    6773    echo "$F error: failed to run ndk-build, check ANDROID_NDK_ROOT env var" 
     
    7379 
    7480    # Parse NDK CXXFLAGS 
    75     if test "x${NDK_CXX}" != "x" -a "x`echo $i|grep 'hello-jni'`" = "x"; then 
     81    if test "x${NDK_CXX}" != "x" -a "x`echo $i|grep 'dummy'`" = "x"; then 
    7682      if test "x`echo $i|grep '\-\-sysroot='`" != "x"; then 
    7783        ANDROID_SYSROOT=`echo $i|sed 's/--sysroot=//'`; 
     
    8187 
    8288    # Parse NDK CFLAGS 
    83     if test "x${NDK_CC}" != "x" -a "x`echo $i|grep 'hello-jni'`" = "x" -a "${ADD_CFLAGS}" = "1"; then 
     89    if test "x${NDK_CC}" != "x" -a "x`echo $i|grep 'dummy'`" = "x" -a "${ADD_CFLAGS}" = "1"; then 
    8490      if test "$i" = "-c"; then ADD_CFLAGS="0"; else 
    8591        if test "x`echo $i|grep ${IGNORE_CFLAGS}`" = "x"; then 
     
    108114  if test "x`echo ${TARGET_HOST} | grep 'linux-android'`" = "x"; then 
    109115    #TARGET_HOST=`echo ${TARGET_HOST} | sed -e 's/\(.*\)\-\([0-9\.]*\)/\1-linux-android-\2/'` 
    110     TARGET_HOST+=-linux-android 
    111   fi 
    112  
     116    TARGET_HOST="${TARGET_HOST}-linux-android" 
     117  fi 
     118 
     119  export TARGET_ABI="${TARGET_ABI}" 
    113120  export CC="${NDK_CC}" 
    114121  export CXX="${NDK_CXX}" 
     
    116123  export RANLIB=`echo ${NDK_CXX}|sed 's/-g++/-ranlib/'`; 
    117124 
    118   export LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}${USR_LIB}" 
     125  export LDFLAGS="${LDFLAGS} --sysroot=${ANDROID_SYSROOT}" 
    119126  export LIBS="${LIBS} -lc -lgcc -ldl" 
    120127  export CFLAGS="${NDK_CFLAGS} ${CFLAGS}" 
     
    144151  fi 
    145152 
     153  export TARGET_ABI="${TARGET_ABI}" 
    146154  export CC="${ANDROID_TC}/bin/${TARGET_HOST}-gcc" 
    147155  export CXX="${ANDROID_TC}/bin/${TARGET_HOST}-g++" 
     
    149157  export RANLIB="${ANDROID_TC}/bin/${TARGET_HOST}-ranlib" 
    150158 
    151   export LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}${USR_LIB}" 
     159  export LDFLAGS="${LDFLAGS} --sysroot=${ANDROID_SYSROOT}" 
    152160  export LIBS="${LIBS} -lc -lgcc" 
    153   export CFLAGS="${CFLAGS} -I${ANDROID_SYSROOT}/usr/include" 
     161  export CFLAGS="${CFLAGS} --sysroot=${ANDROID_SYSROOT}" 
    154162  export CPPFLAGS="${CFLAGS} -fexceptions -frtti" 
    155163  export CXXFLAGS="${CXXFLAGS} -shared --sysroot=${ANDROID_SYSROOT} -fexceptions -frtti" 
     
    168176STDCPP_TC_VER=`ls -d ${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/[0-9]* | sort -gr | head -1` 
    169177STDCPP_CFLAGS="-I${STDCPP_TC_VER}/include -I${STDCPP_TC_VER}/libs/${TARGET_ABI}/include" 
    170 STDCPP_LIBS="${ANDROID_SYSROOT}${USR_LIB}/crtbegin_so.o -lgnustl_static" 
     178STDCPP_LIBS="-lgnustl_static" 
    171179STDCPP_LDFLAGS="-L${STDCPP_TC_VER}/libs/${TARGET_ABI}/" 
    172180 
    173181# stlport 
    174182#STDCPP_CFLAGS="-I${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/stlport" 
    175 #STDCPP_LIBS="${ANDROID_SYSROOT}${USR_LIB}/crtbegin_so.o -lstlport_static -ldl" 
     183#STDCPP_LIBS="-lstlport_static -ldl" 
    176184#STDCPP_LDFLAGS="-L${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/${TARGET_ABI}" 
    177185 
     
    192200  echo " RANLIB = ${RANLIB}" 
    193201  echo " TARGET_HOST = ${TARGET_HOST}" 
     202  echo " TARGET_ABI = ${TARGET_ABI}" 
    194203fi 
    195204 
Note: See TracChangeset for help on using the changeset viewer.