Universal binary?
Hi,
is it possible to make a universal binary if I only have a PPC? (ibook) Or do I need to have an intel mac to make a universal binary?
is it possible to make a universal binary if I only have a PPC? (ibook) Or do I need to have an intel mac to make a universal binary?
It's perfectly possible. It works exactly the same way as doing it on an Intel Machine. You will need Mac OS X 10.4 and Xcode 2.1 (or 2.2 if you want to be able to run your universal binary on Mac OS X 10.3.9 or earlier).
To turn your app into a universal binary all you have to do is change your target settings for "release".
In the build tab do the following:
Click on the Architectures and then hit the edit mode. Check both checkboxes (PowerPC and Intel)
Add a new setting called MACOSX_DEPLOYMENT_ppc with a value of 10.3 or whatever the minimum system version you need to support for PowerPC
Do the same for MACOSX_DEPLOYMENT_i386 but this value must be 10.4 or higher since Mac OS X only exists for Intel starting from 10.4
That's it, clean your project and build.
If you use thirdparty libraries that are not yet made universal you'll get errors. Either don't use them, or find out if there is a universal binary version of them. Or if the source is available, build them yourself as UB.
In the build tab do the following:
Click on the Architectures and then hit the edit mode. Check both checkboxes (PowerPC and Intel)
Add a new setting called MACOSX_DEPLOYMENT_ppc with a value of 10.3 or whatever the minimum system version you need to support for PowerPC
Do the same for MACOSX_DEPLOYMENT_i386 but this value must be 10.4 or higher since Mac OS X only exists for Intel starting from 10.4
That's it, clean your project and build.
If you use thirdparty libraries that are not yet made universal you'll get errors. Either don't use them, or find out if there is a universal binary version of them. Or if the source is available, build them yourself as UB.
"When you dream, there are no rules..."
lipo -create file1 file2
Sir, e^iπ + 1 = 0, hence God exists; reply!
unknown Wrote:lipo -create file1 file2 -output file3Fixed that for you.
That's the method I use: I build a PPC and Intel version, copy one of them, then run Lipo, dragging the binaries into the terminal window to copy the paths. (I set the PPC's SDK to the Panther SDK as well, so it's Panther compatible)
akb825 Wrote:I build a PPC and Intel version, copy one of them, then run Lipo, dragging the binaries into the terminal window to copy the paths. (I set the PPC's SDK to the Panther SDK as well, so it's Panther compatible)I do this as well for 10.2 compatibility, but you can save yourself some time and work if you setup an aggregate target that builds both parts and includes a "Run Script" phase to run lipo automagically.
If you have Xcode 2.2 or later, there's no reason to use lipo to create a UB that runs on 10.2; just follow Taxxodium's instructions.
Hi again.
Ok, thanks for the replies now I'm trying to get it to work but I don't use x-code >_>
I'm using a gui to do it for me so I just want to click a button and make universal binaries. It helps a lot to know it's possible though to make intel binaries eventhough I'm on a PPC
thanks again!
I know i should learn how to use x-code one day. . .
Ok, thanks for the replies now I'm trying to get it to work but I don't use x-code >_>
I'm using a gui to do it for me so I just want to click a button and make universal binaries. It helps a lot to know it's possible though to make intel binaries eventhough I'm on a PPC
thanks again!
I know i should learn how to use x-code one day. . .
You can use the -arch argument to gcc to compile as ppc (-arch ppc) or Intel (-arch i386). For the Intel one, you're going to have to link the 10.4u SDK, so you will need to add this flag:
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
After you create your 2 binaries, you can combine them with the lipo command.
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
After you create your 2 binaries, you can combine them with the lipo command.
OneSadCookie Wrote:If you have Xcode 2.2 or later, there's no reason to use lipo to create a UB that runs on 10.2; just follow Taxxodium's instructions.If you need a PPC-only build in addition to a UB build then lipo works out nicely. Granted that's not often the case, but it's exactly what I need for certain things (though I guess you could argue that splitting the UB is easier than combining it). Regardless, I find separate targets are sometimes easier to manage than multiple-defined compiler flags - but that's just me, use whatever ya like/works best for you and/or each project...
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Creating universal binary(ppc/i386) with XCode 3.1.2 | AdrianM | 1 | 3,292 |
Apr 13, 2009 09:11 AM Last Post: DoG |
|
| Universal Binary on PPC : a few questions | frozax | 6 | 3,419 |
Mar 7, 2008 04:02 PM Last Post: frozax |
|
| Universal Binary | skyhawk | 3 | 2,709 |
Feb 4, 2008 11:52 PM Last Post: sohta |
|
| Universal Binary Problems | DesertPenguin | 1 | 1,972 |
Aug 3, 2006 07:37 PM Last Post: OneSadCookie |
|
| #import <ppc_intrinsics.h> for Universal Binary ? | DanLab | 22 | 8,766 |
Apr 16, 2006 10:28 AM Last Post: DoG |
|

