Ignore:
Timestamp:
Aug 7, 2012 9:06:10 AM (12 years ago)
Author:
ming
Message:

Re #1516: Add help info for configure-android, add support for selecting target architecture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/android/configure-android

    r4202 r4221  
    88  echo "" 
    99  echo "where:" 
    10   echo "  --use-ndk-cflags" 
    11   echo "              Optional parameter to use the same compilation flags" 
    12   echo "              as the one used by ndk-build" 
    13   echo "  OPTIONS     Other options that will be passed directly to" 
    14   echo "              ./aconfigure script. Run ./aconfigure --help" 
    15   echo "              for more info." 
     10  echo "  --use-ndk-cflags Optional parameter to use the same compilation flags" 
     11  echo "                   as the one used by ndk-build" 
     12  echo "  OPTIONS          Other options that will be passed directly to" 
     13  echo "                   ./aconfigure script. Run ./aconfigure --help" 
     14  echo "                   for more info." 
     15  echo "" 
     16  echo "Environment variables:" 
     17  echo "  ANDROID_NDK_ROOT Specify the directory of Android NDK to use." 
     18  echo "  APP_PLATFORM     Optionally specify the platform level used, e.g." 
     19  echo "                   android-8. By default, configure will use the maximum" 
     20  echo "                   platform level detected." 
     21  echo "  TARGET_ABI       Optionally specify a single target architecture, e.g." 
     22  echo "                   armeabi-v7a. By default, the target architecture is" 
     23  echo "                   armeabi." 
     24  echo "" 
    1625  exit 0 
    1726fi 
    1827 
    19 if test "x${ANDROID_NDK}" = "x"; then 
    20   echo "$F error: ANDROID_NDK must be specified" 
     28if test "x${ANDROID_NDK_ROOT}" = "x"; then 
     29  echo "$F error: ANDROID_NDK_ROOT must be specified" 
    2130  exit 0 
    2231fi 
     
    3241fi 
    3342 
     43if test "x$APP_PLATFORM" = "x"; then 
     44  APP_PLATFORM=`ls ${ANDROID_NDK_ROOT}/platforms/ | sed 's/android-//' | sort -gr | head -1` 
     45  APP_PLATFORM="android-${APP_PLATFORM}" 
     46  echo "$F: APP_PLATFORM not specified, using ${APP_PLATFORM}" 
     47fi 
     48 
     49if test "x$TARGET_ABI" = "x"; then 
     50  TARGET_ABI="armeabi" 
     51  echo "$F: TARGET_ABI not specified, using ${TARGET_ABI}" 
     52fi 
     53 
    3454if test "$1" = "--use-ndk-cflags"; then 
    3555  shift 
    36   for i in `${ANDROID_NDK}/ndk-build --dry-run --directory=${ANDROID_NDK}/samples/hello-jni`; do 
     56  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 
    3757    if test "$i" = "-c"; then break; fi 
    3858    if test "x${NDK_CC}" != "x" -a "$i" != "-MF" -a "x`echo $i|grep '\.o\.d'`" = "x" -a "x`echo $i|grep 'include'`" = "x"; then 
     
    5373esac 
    5474 
    55 if test "x$API_LEVEL" = "x"; then 
    56   API_LEVEL=`ls ${ANDROID_NDK}/platforms/ | sed 's/android-//' | sort -gr | head -1` 
    57   echo "$F: API_LEVEL not specified, using android-${API_LEVEL}" 
    58 fi 
    59  
    60 ANDROID_TC="${ANDROID_NDK}/toolchains/${TC_DIR}-4.4.3/prebuilt/${BUILD_MACHINE}" 
     75ANDROID_TC="${ANDROID_NDK_ROOT}/toolchains/${TC_DIR}-4.4.3/prebuilt/${BUILD_MACHINE}" 
    6176if test ! -d ${ANDROID_TC}; then 
    6277  echo "$F error: unable to find directory ${ANDROID_TC} in Android NDK" 
     
    6479fi 
    6580 
    66 export ANDROID_SYSROOT="${ANDROID_NDK}/platforms/android-${API_LEVEL}/arch-arm" 
     81export ANDROID_SYSROOT="${ANDROID_NDK_ROOT}/platforms/${APP_PLATFORM}/arch-arm" 
    6782if test ! -d ${ANDROID_SYSROOT}; then 
    6883  echo "$F error: unable to find sysroot dir ${ANDROID_SYSROOT} in Android NDK" 
Note: See TracChangeset for help on using the changeset viewer.