Skip to content

Instantly share code, notes, and snippets.

@shuhei
Created November 1, 2012 05:37
Show Gist options
  • Save shuhei/3992035 to your computer and use it in GitHub Desktop.
Save shuhei/3992035 to your computer and use it in GitHub Desktop.
Build libcurl for iOS 6.0. Modified Bob's script on Stackoverflow for iOS 6.0.
#!/bin/sh
export SDK=6.0
buildit()
{
target=$1
platform=$2
export CC=/Applications/Xcode.app/Contents/Developer/Platforms/${platform}.platform/Developer/usr/bin/gcc
export CFLAGS="-arch ${target} -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}${SDK}.sdk"
export CPP="/Applications/Xcode.app/Contents/Developer/Platforms/${platform}.platform/Developer/usr/bin/llvm-cpp-4.2"
export AR=/Applications/Xcode.app/Contents/Developer/Platforms/${platform}.platform/Developer/usr/bin/ar
export RANLIB=/Applications/Xcode.app/Contents/Developer/Platforms/${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
}
buildit armv7 iPhoneOS
buildit armv7s iPhoneOS
buildit i386 iPhoneSimulator
lipo -create libcurl.armv7.a libcurl.armv7s.a libcurl.i386.a -output libcurl.a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment