Jean,

I build universal binaries on OSX just fine.  I run Snow Leopard (10.6.x), but 
I generate code compatible with 10.5.  I build all of my 3rd party libraries 
manually, which is sometimes a pain as some packages are not friendly to 
universal builds.  In those cases, the configure script bombs when trying to 
run the preprocessor to figure out 32/64 bit building.  For those I build 
separately for 32 bit, then for 64 bit and then use lipo to merge.            

Here is my typical environment strings for building 3rd-party libraries, which 
seems to get around most issues:
CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch i386 -arch x86_64" CPP="gcc -E" 
CXXCPP="g++ -E" SDKROOT="/Developer/SDKs/MacOSX10.5.sdk" 
MACOSX_DEPLOYMENT_TARGET=10.5;

I go the Cocoa route for the windowing system as it supports both 32 and 64 
bit.  Same thing with imageIO.  That means you need to build your own png, gif, 
jpeg and tiff libraries since it won't use QuickTime (32-bit only).  Once your 
dependencies are ready, it is pretty straightforward to build OSX.  Simply set 
your CMAKE_OSX_ARCHITECTURES to "i386;x86_64" and build.  Works in a single 
pass.  I typically build with Makefile support, but the XCode generator works 
as well.

Hope that helps
Chuck Seberino

On Dec 8, 2010, at 7:14 AM, Jean-Sébastien Guay wrote:

> Hello all,
> 
> I have a few questions about the MacOS X build. I believe now the build all 
> happens through CMake right? Can I build binaries of OSG that would support 
> both 32 and 64 bit intel?
> 
> I guess for this to work, I need all third-party libraries OSG links with to 
> be also 32+64 bit? Is there a repository for 3rdparty libraries that would 
> support this? (i.e Does fink or some other place give you both?) For example 
> I guess I need freetype at least... The windowing should be done in the right 
> way for each build, i.e. Cocoa or Carbon depending on 32 or 64 bit? And 
> reading images is done through ImageIO, does this support both 32 and 64 bit?
> 
> In general, say I want to build a library I coded as 32+64 bit, what is the 
> process? Do I need to build twice with different gcc flags and then package 
> them into one library, or is it done in a single pass? Can I do it with 
> straight gcc or do I absolutely need to use XCode?
> 
> Sorry for the long list of questions, but we're starting to support Mac OS X 
> for a client and this is kind of new territory for us.
> 
> Thanks in advance,
> 
> J-S
> -- 
> ______________________________________________________
> Jean-Sebastien Guay    [email protected]
>                               http://www.cm-labs.com/
>                        http://whitestar02.webhop.org/
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to