Ignore:
Timestamp:
May 13, 2010 12:04:51 AM (14 years ago)
Author:
bennylp
Message:

Re #1050: fixed failure in configure script if iPhone binutils/compiler are not in the PATH. They are called with their full paths now.

File:
1 edited

Legend:

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

    r3168 r3169  
    22 
    33if test "$*" = "--help" -o "$*" = "-h"; then 
    4   echo "configure-iphone [SDK=name_path] [OPTIONS]" 
     4  echo "configure-iphone [IPHONESDK=name_path] [OPTIONS]" 
    55  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." 
     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." 
    1112  echo "" 
    1213  exit 0 
     
    2728 
    2829# Choose SDK version to use 
    29 if test "x$SDK" = "x"; then 
    30   # If SDK is not set, use the latest one 
     30if test "$IPHONESDK" = ""; then 
     31  # If IPHONESDK is not set, use the latest one 
    3132  for f in `ls $DEVPATH/SDKs/`; do echo $f | sed 's/\(.sdk\)//'; done | sort | tail -1 > tmpsdkname 
    32   SDK=`cat tmpsdkname`.sdk 
     33  IPHONESDK=`cat tmpsdkname`.sdk 
    3334  rm -f tmpsdkname 
    34   echo "$F info: using ${SDK}" 
    35   SDKPATH=${DEVPATH}/SDKs/${SDK} 
    36 elif test -d ${SDK}; then 
    37   # .. else if SDK is set and it points to a valid path, just use it 
    38   SDKPATH=${SDK} 
     35  SDKPATH=${DEVPATH}/SDKs/${IPHONESDK} 
     36elif test -d ${IPHONESDK}; then 
     37  # .. else if IPHONESDK is set and it points to a valid path, just use it 
     38  SDKPATH=${IPHONESDK} 
    3939else 
    4040  # .. else assume the SDK name is used. 
    41   SDKPATH=${DEVPATH}/SDKs/${SDK} 
     41  SDKPATH=${DEVPATH}/SDKs/${IPHONESDK} 
    4242fi 
    4343 
     
    4848fi 
    4949 
    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" 
     50# Default CFLAGS if it's not specified 
     51if test "$CFLAGS" = ""; then 
     52  CFLAGS="-O2 -Wno-unused-label" 
     53fi 
     54 
     55# Default LDFLAGS if it's not specified 
     56if test "$LDFLAGS" = ""; then 
     57  LDFLAGS="-O2" 
     58fi 
     59 
     60# Settings to feed to configure script. Binaries should have the 
     61# full path as it's not normally in user's PATH 
     62export CC="${DEVPATH}/usr/bin/arm-apple-darwin9-gcc" 
     63export CXX="${DEVPATH}/usr/bin/arm-apple-darwin9-g++" 
     64export CFLAGS="${CFLAGS} -arch armv6 -isysroot ${SDKPATH}" 
     65export LDFLAGS="${LDFLAGS} -arch armv6 -isysroot ${SDKPATH} -framework AudioToolbox -framework Foundation" 
    5366export AR="${DEVPATH}/usr/bin/libtool -static -o" 
    5467export RANLIB="echo ranlib" 
    5568# 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}" 
     69# header files in standard /usr/include instead of in isysroot 
     70export CPP="${CC} -E -isysroot ${SDKPATH}" 
    5871 
    59 # And finally invoke configure script itself 
     72# And finally invoke the configure script itself 
    6073./aconfigure --host=arm-apple-darwin9 --disable-floating-point $* 
    6174 
     75if test "$?" = "0"; then 
     76  echo "Done configuring for `basename $SDKPATH`" 
     77  echo "" 
     78fi 
     79 
Note: See TracChangeset for help on using the changeset viewer.