- #!bin/sh
- SDK=5.1
- DEVROOT="/Applications/Xcode.app/Contents/Developer/Platforms"
- if [ ! \\( -d "$DEVROOT" \\) ] ; then
- echo "The iPhone SDK could not be found. Folder \\"$DEVROOT\\" does not exist."
- exit 1
- fi
- if [ ! \\( -x "./configure" \\) ] ; then
- echo "This script must be run in the folder containing the \\"configure\\" script."
- exit 1
- fi
- buildit()
- {
- target=$1
- platform=$2
- export CC="${DEVROOT}/${platform}.platform/Developer/usr/bin/gcc"
- export CFLAGS="-arch ${target} -isysroot ${DEVROOT}/${platform}.platform/Developer/SDKs/${platform}${SDK}.sdk"
- export CPP="${DEVROOT}/${platform}.platform/Developer/usr/bin/llvm-cpp-4.2"
- export AR="${DEVROOT}/${platform}.platform/Developer/usr/bin/ar"
- export RANLIB="${DEVROOT}/${platform}.platform/Developer/usr/bin/ranlib"
- ./configure --disable-shared --without-ssl --without-libssh2 --without-ca-bundle --without-ldap --disable-ldap \\
- --host=${target}-apple-darwin10
- make clean
- make
- $AR rv libcurl.${target}.a lib/*.o
- $RANLIB libcurl.${target}.a
- }
- buildit armv6 iPhoneOS
- buildit armv7 iPhoneOS
- buildit i386 iPhoneSimulator
- lipo -create libcurl.armv7.a libcurl.armv6.a libcurl.i386.a -output libcurl.a
- #该片段来自于http://www.codesnippet.cn/detail/020920135551.html
来源: http://www.codesnippet.cn/detail/020920135551.html