Memoirs of Fls'Zen

Saturday, August 05, 2006

Building Universal Binaries from the Shell

Ok, so I screwed up the system installation of libxml2. I overwrote it with an i386-only distribution. This effectively broke any application that runs under Rosetta and uses libxml2.

I was able to successfully repair this situation by using the following configure command:
./configure --disable-dependency-tracking CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -I/usr/local/include".

Apple's technote 2137 (http://developer.apple.com/technotes/tn2005/tn2137.html) details how you can build UBs like this. It completely fails to mention that some Makefiles/configures will move the syslibroot into LDFLAGS for you from CFLAGS. If you specify LDFLAGS like the technote says for libxml2, you won't be able to build it. Once I took out the LDFLAGS value, it compiled fine.

Update: On 10.5, it seems that you should use "-iwithsysroot" instead of "-isysroot".

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home