返回顶部

收藏

编译libcurl for iOS SDK 5.1

更多

在Mac OX Lion 下用Xcode4.3.3编译libcurl源码 for iOS 5.1

bash脚本文件

#!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

SDK原文链接

标签:iOS,Xcode

收藏

0人收藏

支持

1

反对

0

发表评论