Changeset 4202
- Timestamp:
- Jul 9, 2012 9:02:13 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/android/configure-android
r4195 r4202 5 5 6 6 if test "$*" = "--help" -o "$*" = "-h"; then 7 echo "$F [ OPTIONS]"7 echo "$F [--use-ndk-cflags] [OPTIONS]" 8 8 echo "" 9 9 echo "where:" 10 echo " --simulator Optional parameter to specify that the compilation" 11 echo " target is a simulator." 10 echo " --use-ndk-cflags" 11 echo " Optional parameter to use the same compilation flags" 12 echo " as the one used by ndk-build" 12 13 echo " OPTIONS Other options that will be passed directly to" 13 14 echo " ./aconfigure script. Run ./aconfigure --help" … … 16 17 fi 17 18 18 if test "$1" = "--simulator"; then 19 if test "x${ANDROID_NDK}" = "x"; then 20 echo "$F error: ANDROID_NDK must be specified" 21 exit 0 22 fi 23 24 #if test "$1" = "--simulator"; then 25 if test "1" = "0"; then 19 26 shift 20 27 TARGET_HOST="i686-android-linux" … … 23 30 TARGET_HOST="arm-linux-androideabi" 24 31 TC_DIR=${TARGET_HOST} 32 fi 33 34 if test "$1" = "--use-ndk-cflags"; then 35 shift 36 for i in `${ANDROID_NDK}/ndk-build --dry-run --directory=${ANDROID_NDK}/samples/hello-jni`; do 37 if test "$i" = "-c"; then break; fi 38 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 39 NDK_CFLAGS="${NDK_CFLAGS} $i" 40 fi 41 if test "x`echo $i | grep 'gcc'`" != "x"; then 42 NDK_CC=$i 43 fi 44 done 45 export CFLAGS+="${NDK_CFLAGS}" 25 46 fi 26 47 … … 32 53 esac 33 54 34 API_VERSION="14" 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 35 59 36 60 ANDROID_TC="${ANDROID_NDK}/toolchains/${TC_DIR}-4.4.3/prebuilt/${BUILD_MACHINE}" 61 if test ! -d ${ANDROID_TC}; then 62 echo "$F error: unable to find directory ${ANDROID_TC} in Android NDK" 63 exit 1 64 fi 37 65 38 export ANDROID_SYSROOT="${ANDROID_NDK}/platforms/android-${API_VERSION}/arch-arm" 66 export ANDROID_SYSROOT="${ANDROID_NDK}/platforms/android-${API_LEVEL}/arch-arm" 67 if test ! -d ${ANDROID_SYSROOT}; then 68 echo "$F error: unable to find sysroot dir ${ANDROID_SYSROOT} in Android NDK" 69 exit 1 70 fi 71 39 72 export CC="${ANDROID_TC}/bin/${TARGET_HOST}-gcc" 40 73 export CXX="${ANDROID_TC}/bin/${TARGET_HOST}-g++" 74 41 75 export LDFLAGS+=" -nostdlib -L${ANDROID_SYSROOT}/usr/lib/" 42 76 export LIBS+=" -lc -lgcc" … … 45 79 export CXXFLAGS+=" -shared --sysroot=${ANDROID_SYSROOT}" 46 80 81 # Print settings 82 if test "1" = "1"; then 83 echo "$F: calling ./configure with env vars:" 84 echo " CC = ${CC}" 85 echo " CXX = ${CXX}" 86 echo " CFLAGS = ${CFLAGS}" 87 echo " CXXFLAGS = ${CXXFLAGS}" 88 echo " LDFLAGS = ${LDFLAGS}" 89 echo " LIBS = ${LIBS}" 90 fi 91 47 92 ./configure --host=${TARGET_HOST} --disable-video $*
Note: See TracChangeset
for help on using the changeset viewer.