Sections

How can I build a universal binary which consists of a gcc3.3- built PPC and gcc4-built Intel version?

Entry number: 766 - How can I build a universal binary which consists of a gcc3.3- built PPC and gcc4-built Intel version?

Answer:

qmake does not support this, but it is possible following these steps:

1) Build Qt as PowerPC only using gcc 3.3 by adding -arch ppc as part of your CFLAGS and CXXFLAGS in QTDIR/mkspecs/macx-g++/qmake.conf..

2) Build an Intel only version using gcc 4 by adding -arch i386 as part of your CFLAGS and CXXFLAGS in QTDIR/mkspecs/macx-g++/qmake.conf..

3) Use the lipo command to stitch together the frameworks into universal frameworks.

Now you need to follow a similar technique for building your binary, however you can use your new universal frameworks instead.

1) Build a PowerPC version of your app with GCC 3.3

2) Build the intel version with gcc 4.

3) Use lipo to put the binaries together into one universal binary.

Using Xcode, you can ease the pain by defining these parameters for your target

GCC_VERSION_i386 4.0

GCC_VERSION_ppc 3.3

MACOSX_DEPLOYMENT_TARGET_i386 10.4

MACOSX_DEPLOYMENT_TARGET_ppc 10.2

SDKROOT_i386 /Developer/SDKs/MacOSX10.4u.sdk

For more information, see:
http://developer.apple.com/technotes/tn2005/tn2137.html

back

Patron of KDECustomers

Customers