PDA

View Full Version : Universal binary tutorial and legacy?


LWStrike
2006.04.05, 09:19 PM
I know somone allready asked but i searched 'Universal tutorial' and got nothing (i clicked on all 7 results). Is there a tutorial which shows you how to make a universal binary? Is there also a way for me to build a ppc binary for those systems that dont support universal binaries? I am on an intel but i am sure rosetta would be able to emulate the PPC bins on my machine accuratly.
-Edit-
I compiled a command line file and it was a 'Unix executable file (intel)'. What is with that? would this file run on linux (or at least BSD) without modification?

OneSadCookie
2006.04.05, 09:43 PM
every version of Mac OS X for both PowerPC and Intel supports universal binaries. that's what "universal" means ;)

no, Mac OS X binaries won't run on other operating systems.

From Xcode, you build a universal binary by choosing the 10.4u SDK in your project preferences, and adding both PowerPC and Intel to the architectures setting for your target.

From the command-line, you do it by building your application twice, once passing:

-isysroot /Developer/SDKs/MacOSX10.3.9.sdk -arch ppc

to the compiler and linker, and once passing

-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386

that gives you separate PowerPC and Intel binaries, which you stick together with lipo.