Mac Forums

Mac Forums (
-   OS X - Development and Darwin (
-   -   Creating Universal Binaries with XCode Tools (

mac57 06-15-2006 04:25 PM

Creating Universal Binaries with XCode Tools
The XCode tools install the gcc compiler, which seems to be the C/C++ compiler that is used on the Mac. Is there a way to make this compiler and associated tool chain produce universal binaries? I know from past Linux experience that gcc has a gazillion options. Before I start digging into them, I was wondering whether anyone could point me at a simple reference that would explain how to use these tools to create universal binaries.

In this case, I am just building ncurses-based applications, but I would like them to be compatible with both PPC and Intel Macs. Thanks.

Logan 06-20-2006 11:34 AM

This one talks about Aspyr doing the move over (for like Sims 2 and Doom 3 etc)

This one tells the steps you need to do to prepare for universal binaries

on the bottom of the last link it tells you "For more information".. and has 3 links or so.

Hope that it is useful for you.

Logan 06-20-2006 11:39 AM

Scanning over it seems the major factor is that bytes and variable handling are of different sizes depending on architexture.

Boolean is 1 byte on x86 machines, 4 bytes on PPC

A long double is 16 bytes on both architectures, but only 80 bits are significant in long double data types on Intel-based Macintosh computers.

there's just a ton of really simple yet potentially tedius tweaks, and from what I scanned over it appears that when your code is universal binary ready, you'll know just simply after compiling on a universal binary-compatible machine by going to get info and looking at the application's type.

Be sure you're using the latest compiler too. :P

mac57 06-20-2006 06:35 PM

Sounds like gcc 4.0 builds universal binaries by default. I will have to check into this I guess. Thanks for the pointers!

All times are GMT -4. The time now is 01:51 AM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.