Changeset 3175 for pjproject/trunk/configure-iphone
- Timestamp:
- May 17, 2010 1:07:39 PM (14 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk
- Property svn:mergeinfo changed
/pjproject/branches/projects/iphone merged: 3129-3130,3137,3166,3168-3171
- Property svn:mergeinfo changed
-
pjproject/trunk/configure-iphone
r3168 r3175 1 1 #!/bin/bash 2 2 3 F="configure-iphone" 4 3 5 if test "$*" = "--help" -o "$*" = "-h"; then 4 echo " configure-iphone [SDK=name_path][OPTIONS]"6 echo "$F [OPTIONS]" 5 7 echo "" 6 echo "SDK=name_path Choose which SDK to use. Value can be SDK name (e.g." 7 echo " iPhoneOS2.2.1.sdk) or the full path of the SDK" 8 echo "OPTIONS Other options that will be passed directly to " 9 echo " ./aconfigure script. Run ./aconfigure --help for" 10 echo " more info." 8 echo "where:" 9 echo " OPTIONS Other options that will be passed directly to" 10 echo " ./aconfigure script. Run ./aconfigure --help" 11 echo " for more info." 12 echo "" 13 echo "Environment variables:" 14 echo " IPHONESDK Optionally specify which SDK to use. Value is the full " 15 echo " path of the SDK. By default, the latest SDK installed" 16 echo " will be used." 17 echo " CC Optionally specify the path of the ARM cross compiler" 18 echo " to use. By default, the compiler is deduced from the" 19 echo " SDK." 11 20 echo "" 12 21 exit 0 13 22 fi 14 23 15 F="configure-iphone"16 17 24 # Set the main iPhone developer directory, if not set 18 25 if test "x${DEVPATH}" = "x"; then 19 26 DEVPATH=/Developer/Platforms/iPhoneOS.platform/Developer 27 echo "$F: DEVPATH is not specified, using ${DEVPATH}" 20 28 fi 21 29 … … 27 35 28 36 # Choose SDK version to use 29 if test " x$SDK" = "x"; then30 # If SDK is not set, use the latest one37 if test "$IPHONESDK" = ""; then 38 # If IPHONESDK is not set, use the latest one 31 39 for f in `ls $DEVPATH/SDKs/`; do echo $f | sed 's/\(.sdk\)//'; done | sort | tail -1 > tmpsdkname 32 SDK=`cat tmpsdkname`.sdk40 IPHONESDK=`cat tmpsdkname`.sdk 33 41 rm -f tmpsdkname 34 echo "$F info: using ${SDK}"35 SDKPATH=${DEVPATH}/SDKs/${SDK}36 elif test -d ${ SDK}; then37 # .. else if SDK is set and it points to a valid path, just use it38 SDKPATH=${ SDK}42 SDKPATH=${DEVPATH}/SDKs/${IPHONESDK} 43 echo "$F: IPHONESDK is not specified, choosing ${IPHONESDK}" 44 elif test -d ${IPHONESDK}; then 45 # .. else if IPHONESDK is set and it points to a valid path, just use it 46 SDKPATH=${IPHONESDK} 39 47 else 40 48 # .. else assume the SDK name is used. 41 SDKPATH=${DEVPATH}/SDKs/${ SDK}49 SDKPATH=${DEVPATH}/SDKs/${IPHONESDK} 42 50 fi 43 51 … … 48 56 fi 49 57 50 # Settings to feed to configure script 51 export CFLAGS="-O2 -arch armv6 -isysroot ${SDKPATH}" 52 export LDFLAGS="-O2 -arch armv6 -isysroot ${SDKPATH} -framework AudioToolbox -framework Foundation" 58 # Default CFLAGS if it's not specified 59 if test "$CFLAGS" = ""; then 60 CFLAGS="-O2 -Wno-unused-label" 61 fi 62 63 # Default LDFLAGS if it's not specified 64 if test "$LDFLAGS" = ""; then 65 LDFLAGS="-O2" 66 fi 67 68 # Determine which gcc for this SDK. Binaries should have the 69 # full path as it's not normally in user's PATH 70 71 if test "${CC}" = ""; then 72 for archpath in `ls -d ${SDKPATH}/usr/lib/gcc/arm-apple-darwin*`; do 73 archname=`basename ${archpath}` 74 for gccver in `ls ${archpath}`; do 75 gccpath="${DEVPATH}/usr/bin/${archname}-gcc-${gccver}" 76 if test -e ${gccpath}; then 77 export CC="${gccpath}" 78 break 79 fi 80 done 81 if test ! "${CC}" = ""; then 82 echo "$F: CC is not specified, choosing ${CC}" 83 break 84 fi 85 done 86 fi 87 88 if test "${CC}" = ""; then 89 echo "$F error: unable to find gcc for ${IPHONESDK}. If you think you have the right gcc, set the full path in CC environment variable." 90 exit 1 91 fi 92 93 # Set CXX if not set 94 if test "${CXX}" = ""; then 95 export CXX=`echo ${CC} | sed 's/gcc/g++/'` 96 echo "$F: CXX is not specified, using ${CXX}" 97 fi 98 99 # Other settings to feed to configure script. 100 #ARCH="-arch armv6" 101 export CFLAGS="${CFLAGS} ${ARCH} -isysroot ${SDKPATH}" 102 export LDFLAGS="${LDFLAGS} ${ARCH} -isysroot ${SDKPATH} -framework AudioToolbox -framework Foundation" 53 103 export AR="${DEVPATH}/usr/bin/libtool -static -o" 54 104 export RANLIB="echo ranlib" 55 105 # Use gcc -E as preprocessor instead of cpp, since cpp will find the 56 # header files in standard /usr/include 57 export CPP="${ DEVPATH}/usr/bin/arm-apple-darwin9-gcc-E -isysroot ${SDKPATH}"106 # header files in standard /usr/include instead of in isysroot 107 export CPP="${CC} -E -isysroot ${SDKPATH}" 58 108 59 # And finally invoke configure script itself 109 # Print settings 110 if test "1" = "1"; then 111 echo "$F: calling ./aconfigure with env vars:" 112 echo " CC = ${CC}" 113 echo " CXX = ${CXX}" 114 echo " SDKPATH = ${SDKPATH}" 115 echo " CFLAGS = ${CFLAGS}" 116 echo " LDFLAGS = ${LDFLAGS}" 117 echo " AR = ${AR}" 118 echo " RANLIB = ${RANLIB}" 119 fi 120 121 # And finally invoke the configure script itself 60 122 ./aconfigure --host=arm-apple-darwin9 --disable-floating-point $* 61 123 124 if test "$?" = "0"; then 125 echo "Done configuring for `basename $SDKPATH`" 126 echo "" 127 fi 128
Note: See TracChangeset
for help on using the changeset viewer.