Changeset 3170 for pjproject/branches/projects/iphone
- Timestamp:
- May 13, 2010 4:35:16 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/iphone/configure-iphone
r3169 r3170 1 1 #!/bin/bash 2 2 3 F="configure-iphone" 4 3 5 if test "$*" = "--help" -o "$*" = "-h"; then 4 echo " configure-iphone [IPHONESDK=name_path][OPTIONS]"6 echo "$F [OPTIONS]" 5 7 echo "" 6 echo "IPHONESDK=name_path Choose which SDK to use. Value can be SDK name" 7 echo " (e.g. iPhoneOS2.2.1.sdk) or the full path of" 8 echo " the SDK" 9 echo "OPTIONS Other options that will be passed directly to" 10 echo " ./aconfigure script. Run ./aconfigure --help" 11 echo " for 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." 12 20 echo "" 13 21 exit 0 14 22 fi 15 23 16 F="configure-iphone"17 18 24 # Set the main iPhone developer directory, if not set 19 25 if test "x${DEVPATH}" = "x"; then 20 26 DEVPATH=/Developer/Platforms/iPhoneOS.platform/Developer 27 echo "$F: DEVPATH is not specified, using ${DEVPATH}" 21 28 fi 22 29 … … 48 55 fi 49 56 57 echo "$F: IPHONESDK is not specified, choosing ${IPHONESDK}" 58 50 59 # Default CFLAGS if it's not specified 51 60 if test "$CFLAGS" = ""; then … … 58 67 fi 59 68 60 # Settings to feed to configure script. Binaries should have the69 # Determine which gcc for this SDK. Binaries should have the 61 70 # full path as it's not normally in user's PATH 62 export CC="${DEVPATH}/usr/bin/arm-apple-darwin9-gcc" 63 export CXX="${DEVPATH}/usr/bin/arm-apple-darwin9-g++" 71 72 if test "${CC}" = ""; then 73 for archpath in `ls -d ${SDKPATH}/usr/lib/gcc/arm-apple-darwin*`; do 74 archname=`basename ${archpath}` 75 for gccver in `ls ${archpath}`; do 76 gccpath="${DEVPATH}/usr/bin/${archname}-gcc-${gccver}" 77 if test -e ${gccpath}; then 78 export CC="${gccpath}" 79 break 80 fi 81 done 82 if test ! "${CC}" = ""; then 83 echo "$F: CC is not specified, choosing ${CC}" 84 break 85 fi 86 done 87 fi 88 89 if test "${CC}" = ""; then 90 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." 91 exit 1 92 fi 93 94 # Set CXX if not set 95 if test "${CXX}" = ""; then 96 export CXX=`echo ${CC} | sed 's/gcc/g++/'` 97 echo "$F: CXX is not specified, using ${CXX}" 98 fi 99 100 # Other settings to feed to configure script. 64 101 export CFLAGS="${CFLAGS} -arch armv6 -isysroot ${SDKPATH}" 65 102 export LDFLAGS="${LDFLAGS} -arch armv6 -isysroot ${SDKPATH} -framework AudioToolbox -framework Foundation" … … 69 106 # header files in standard /usr/include instead of in isysroot 70 107 export CPP="${CC} -E -isysroot ${SDKPATH}" 108 109 # Print settings 110 if test "1" = "1"; then 111 echo "$F: calling ./aconfigure with these settings:" 112 echo " CC = ${CC}" 113 echo " CXX = ${CXX}" 114 echo " SDKPATH = ${SDKPATH}" 115 echo " CFLAGS = ${CFLAGS}" 116 echo " AR = ${AR}" 117 fi 71 118 72 119 # And finally invoke the configure script itself
Note: See TracChangeset
for help on using the changeset viewer.