The good news: Boost 1.44.0 builds for iPhone a lot more easily than previous versions.
The bad news: making a framework is still not easy.
But first, why?
First, let's answer the obvious question: Why would you want to bother building a framework at all?
Quite simply: to make your life easier.
Using the native Boost build, you (may) need to link against a number of different Boost libraries in your application. And then you need to do a clever dance to ensure you link against either the i386 (simulator) or armv6/armv7 (iPhone devices) versions, depending on your build configuration.
That is tedious and annoying, and not the way it should be. Other Apple "libraries" are provided as a "framework" which you just need to mention once in Xcode, and then the build system works out how to link to the correct version and how to find the right headers.
So, if we can turn Boost into a framework life would be so much easier.
And that's what I have done.
But first, why?
First, let's answer the obvious question: Why would you want to bother building a framework at all?
Quite simply: to make your life easier.
Using the native Boost build, you (may) need to link against a number of different Boost libraries in your application. And then you need to do a clever dance to ensure you link against either the i386 (simulator) or armv6/armv7 (iPhone devices) versions, depending on your build configuration.
That is tedious and annoying, and not the way it should be. Other Apple "libraries" are provided as a "framework" which you just need to mention once in Xcode, and then the build system works out how to link to the correct version and how to find the right headers.
So, if we can turn Boost into a framework life would be so much easier.
And that's what I have done.
Pete: Doing all the hard work to save literally... some... people all the hassle.
Executive summary
Now, you can do it too.
Just run the script you'll find in Gitorious here: http://gitorious.org/boostoniphone/boostoniphone
Download yourself boost_1_44_0.tbz into the same directory, run the script. Make a cuppa. Make another cuppa. And then admire your new shiney Boost framework.
Use it like any other framework. Draggy droppy. Happy happy.
What changed?
For the hardcore faithful who care about htese things, here's what's changed since my last script version:
- Boost now builds for iOS far more easily (I think this changed for the better in 1.43.0). Now, you just need to write some gibberish in a user-config.jam and run a boostrap script. That is a darned site easier than it used to be.
- To make it build for the simulator, you still need to invent some missing header files.
- But the biggest hassle in this version was creating the final universal library file. Since the ARM builds themselves are now fat archives (including an armv6 and armv7 version of each .o file) I needed to work out how to make a functional uber-lib file. Because Apple's binutils are not useful GNU ones, their ar is braindead. The only way to make a correctly functioning library (that I could find) was to un-lipo the fat ARM binaries, un-ar each archive, link all the original .os into an uber library, than lipo up each of those. Does that sound painful? Yes. It hurt.