Cross compilation

For my next iphone application, I intend to use some open source library.
The big question is : How to get them work for iPhone ???

First of all, I installed 'darwinport' to get some usefull command line tool (wget for instance)

I choose to have all my open-source library in the same folder
/Users/olivier/Documents/IphoneDevProjects/3rdParty
with the following subfolder :
  • build-os : inflatted packages to build libraries running on the device
  • build-sim: inflatted packages to build simulator libraries
  • iphone-os : preffix where libraries, headers, ... are installed by 'make install' for the device
  • iphone-sim : preffix where libraries, headers, .. are installed by 'make install' for the simulator
  • iphone : repository for library created by 'lipo' command (to use in XCode)
  • pkg : where I stored all the packages
  • script : usefull script

Here is how I get them to compile :
  • ZBar bar code reader (sourceforge)
    • need ImageMagick
    • need jpeg library
  • libssh2 (sourceforge)
    • need libgpg-error
    • need libgcrypt
    • need gnupgp
  • tesseract
    • need libtiff
      • need jpeg library
  • libcurl
    • need gnutls
      • libgcrypt
      • gnupgp
      • libtasn1
    • need libssh2
  • ODE (http://www.ode.org/)

For theses library to work on the simulator, check this page :  compile library for iphone simulator.

When I tried to cross-compile those lib on my own, I search on the web to get some help.
Here are the following site which help me founding my way :
http://latenitesoft.blogspot.com/2008/10/iphone-programming-tips-building-unix.html