Feb 20
libcurl for your iphone
1. get it
2. build it, the light way:
./configure –prefix=/usr/local/iphone –host=arm-apple-darwin –disable-shared –disable-crypto-auth –without-gnutls –without-ssl –without-zlib –without-libssh2 –disable-ipv6 –disable-manual –disable-telnet –disable-tftp –disable-ldap –disable-file –disable-ftp
3. fix it:
in lib/config.h:
uncomment #undef HAVE_GLIBC_STRERROR_R
uncomment #undef HAVE_POSIX_STRERROR_R
comment #define HAVE_STRERROR_R 1
4. make it:
make && sudo make install
5. enjoy it.








June 4th, 2008 at 10:22 am
Hi - I followed these instructions, but ended up with a library libcurl.a which was of the wrong architecture. When running ./configure, it reports that the host will be arm-apple-darwin, but when I run make, it appears to be using the ordinary old gcc. Any idea why? Thanks so much — Greg
June 4th, 2008 at 1:08 pm
On what environment are you trying to compile? These instructions were meant to be used with the early iphone toolchain, before the official API, which I never used.
In any case you could try setting the CC and CXX environment variables.
June 4th, 2008 at 10:09 pm
Hi - I am using Beta 6 of the official iPhone SDK. Here’s the ./configure switches that ultimately worked for me (using my Mac to cross-compile libcurl for the iPhone, from the command line)
/configure –prefix=/usr/local/iphone –host=arm-apple-darwin –disable-shared –disable-crypto-auth –without-gnutls –without-ssl –without-zlib –without-libssh2 –disable-ipv6 –disable-manual –disable-telnet –disable-tftp –disable-ldap –disable-file –disable-ftp CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1 CFLAGS=”-arch armv6 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=2.0 -gdwarf-2 -mthumb -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/include/libxml2 -I/Library/iPhone/include -I/Users/ghassett/HelloWorld/build/HelloWorld.build/Debug-iphoneos/HelloWorld.build/DerivedSources -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk” CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar
Thanks for your help and the push in the right direction