[cairo] Compile Mac OS X universal binary of cairo

Ryan Schmidt cairo-2007a at ryandesign.com
Wed Feb 7 01:50:06 PST 2007

On Feb 6, 2007, at 05:38, Baz wrote:

> On 06/02/07, Ryan Schmidt wrote:
>> There is another more-complicated way to make a universal binary:
>> configure once with -arch i386 and make, then configure again with -
>> arch ppc and make again, then combine the two sets of object files
>> with the lipo program. This presumes that cairo can be cross-compiled
>> at all. But I would like to avoid this more-complicated method if at
>> all possible.
> I asked Vlad about this on IRC a while back, since I'd started
> building on intel and cairo needs to be compatible with the (ppc only)
> 10.3.9 sdk, and I hit the same problem. He said that the moz build
> system used magic to do it.... eventually I got cross compiling (but
> not universal builds) much as you did above by following through the
> moz process.
> Mozilla's universal builds use lipo, because, afaik, you *need* to use
> lipo if you're building for a different sdk on the two platforms.
> http://developer.mozilla.org/en/docs/Mac_OS_X_Universal_Binaries
> In short, I don't think anyone is doing universal builds of cairo  
> without lipo.

Thanks for confirming that for me, and thanks everyone else for your  
responses. Since cairo just produces a single library file,  
configuring and making twice and putting the result together with  
lipo, then make-installing the whole lot, wasn't a big deal. I just  
wanted to make sure, with all those other software packages compiling  
universal binaries just fine with the simpler approach, that I wasn't  
missing some way to use the simpler approach with cairo.

My initial strategy was going to be to configure, make and make- 
install everything twice, once for each architecture, and lipo it all  
together using the unify script that the Mozilla builds use. However,  
around the time I needed to compile glib, things got silly, because  
when cross-compiling, glib needs a native copy of part of glib on the  
build machine, and that needs gettext, which needs expat, and none of  
that is on Mac OS X normally. Needing to compile it all once for the  
ppc build, then those tools again for ppc in a different place, so  
they can be used by the Intel build, was starting to get retarded.

I had wanted to do it that way to support Mac OS X 10.3.9 on PowerPC  
machines. But I'm not yet convinced that what I'm making now won't  
work on 10.3.9 anyway. It's not like any of this software is linking  
with any special 10.4-only libraries. I guess I'll see when I'm done  
whether it runs on 10.3.9 or not. :-/

More information about the cairo mailing list