[cairo] Compile Mac OS X universal binary of cairo

Ryan Schmidt cairo-2007a at ryandesign.com
Tue Feb 6 03:10:51 PST 2007


Can I cross-compile cairo? I'm running into problems.

I would like to compile a Mac OS X universal binary (a binary  
containing both Intel and PowerPC code) of Graphviz. To do this, I  
first need to compile universal binaries of some other software,  
including cairo.

The usual simple way to make a universal binary is to do this:


CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch  
ppc" \
LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 - 
arch ppc" \
./configure --disable-dependency-tracking
make
make install


Using this formula, I believe I have been successful making universal  
binaries of expat, fontconfig, freetype, gettext, libpng, libtool,  
pkg-config, swig and zlib so far, but not of cairo 1.3.12, because I  
get this error:


checking whether byte ordering is bigendian... no
checking whether float word ordering is bigendian... unknown
configure: error:

Unknown float word ordering. You need to manually preset
ax_cv_c_float_words_bigendian=no (or yes) according to your system.


I can't preset ax_cv_c_float_words_bigendian to yes or no because it  
needs to be yes for the -arch ppc part and no for the -arch i386 part.

I'm also surprised by the result "checking whether byte ordering is  
bigendian... no" because that will also only apply to the -arch ppc  
part. (I'm compiling this on a PowerPC Mac at present.) That test  
should probably have also printed "unknown.," if indeed these tests  
are needed.


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.


The even-more-complicated way would be to compile and make on two  
separate machines, one Intel, one PowerPC, then bring the compiled  
results back to one machine to run lipo. But this presumes I have  
access to both an Intel and a PowerPC Mac, and I would rather not  
have to have that.




More information about the cairo mailing list