In order to compile some library for an iPhone, the following should be typed on the command line:

For the iPhone itself

./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 -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

For the Simulator

./configure --prefix=/usr/local/iphone --host=i686-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/iPhoneSimulator.platform/Developer/usr/bin/i686-apple-darwin9-gcc-4.0.1 CFLAGS="-arch i686 -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/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/usr/include/libxml2 -I/Library/iPhone/include -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk" CPP=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/cpp AR=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ar

Combine libraries into a single file

lipo --create libA.a libB.a --output combined.a

 
Copyright 2016 The Board of Trustees
of the University of Illinois.webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF