I'm trying to compile a Boost library into a universal binary file (i.e. a "fat" file that contains builds for both the i386 and x86_64 architectures).
Souring the internet and SO I assembled the following instructions.
Download boost (e.g. from http://www.boost.org/users/download/)
In the downloaded folder, type
./bootstrap.sh
(or, in my case./bootstrap.sh --with-libraries=thread
, since I only need the thread library)type
./b2 install cxxflags="-arch i386 -arch x86"
These steps installed the Boost thread library to /usr/local/lib/
(its standard location). The resulting static library is a universal binary. So far, so good.
$ lipo -i /usr/local/lib/libboost_thread.a
Architectures in the fat file: /usr/local/lib/libboost_thread.a are: i386 x86_64
The dynamic library, however, only seems to have been compiled for x86_64.
$ lipo -i /usr/local/lib/libboost_thread.dylib
Non-fat file: /usr/local/lib/libboost_thread.dylib is architecture: x86_64
I'd like the .dylib to be universal as well. Does anyone know how I can compile it for i386 as well as x86_64?