1、下载curl-7.40.0.tar.gz(http://curl.haxx.se/download.html)
2、解压 # tar zxvf curl-7.40.0.tar.gz
3、新建脚本build.sh
#!/bin/sh
export CC="/Applications/Xcode.app/Contents/Developer/usr/bin/gcc"
export CFLAGS="-arch armv7 -pipe -Os -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk"
export LDFLAGS="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk"
./configure --disable-shared --enable-static --without-ssl --host="armv7-apple-darwin" 4、# ./build.sh
5、# make

本文介绍如何从源码编译适用于iOS设备的curl静态库。具体步骤包括下载curl源码、配置编译参数以适配iOS平台并进行交叉编译,最终生成可用于iOS项目的静态库。

2395

被折叠的 条评论
为什么被折叠?



