Blitzmax and universal binaries HOWTO

Archives Forums/MacOS X Discussion/Blitzmax and universal binaries HOWTO

pls(Posted 2006) [#1]
Hi folks!

I just released Su Doku Live (see http://www.deadpixelgames.com for details) as a universal binary. I got a brand new Mac book pro, downloaded blitzmax 1.18, recompiled all modules and maxide, recompiled the game, and ended up with a "Intel version of Su Doku Live".

Now I had to apps, one for powerpc and another one for intel, what would I need to do to get the universal binary? Use the lipo tool (comes with xcode):

lipo -create <new_universal> <plat_specific_bin_1> <plat_specific_bin_2>

....or in other words...

lipo -create -output Su\ Doku\ Live.app/Contents/MacOS/Su\ Doku\ Live /Volumes/SuDokuLive/Su\ Doku\ Live.app/Contents/MacOS/Su\ Doku\ Live SuDokuLive/Su\ Doku\ Live.app/Contents/MacOS/Su\ Doku\ Live

... with the end result being a universal binary!

So what is missing in bmax (1.18, hopefully will be on 1.20, but I don't know and am just hoping): cross compiling for both platforms (you can generate intel code on powerpc and vice versa) and a final call to the lipo tool. Note that in practice you will still need two macs if you want to test your binaries, but not it is not (or will not be, once brl gets it done) a requirement to build them once blitzmax supports cross-compiling.

In the meantime if you have access to both an intel and ppc machine you can get them to the market.

PLS


Robert Cummings(Posted 2006) [#2]
One of my worries is that I can't make a universal binary on a normal mac, and I can't make a mac binary on a powerpc mac?

Therefore which mac do I buy in order to make both power pc and intel binaries - do I still need a power PC mac?


gman(Posted 2006) [#3]
thx for the info pls.

i too would like confirmation that you can (through rosetta or otherwise) be able to build PPC mac compatible binaries with _just_ an intel mac. can anyone confirm this?

thx.


Brucey(Posted 2006) [#4]
For now, it looks like you'll need one of each... ;-)

At least until Mark gets it making them automagically for you on the Intel Mac.


gman(Posted 2006) [#5]
thx Brucey. that definately affects my decision in which type to buy. intel would be real handy as i could basically make a build machine that could build for all 3 OS, but if i cant build PPC mac compatible, then i need to go for the PPC mac mini.


gman(Posted 2006) [#6]
rereading my post im not sure if i explained myself clearly :( my question is: can anyone confirm if an intel mac using xcode 2.x can compile a .a lib file that will work on PPC?


Brucey(Posted 2006) [#7]
if xcode 2.x can compile a universal binary then it *must* be compiling both intel and ppc code.. therefore I imagine that yes, you should be able to build a ppc specific .a on an intel mac.

Don't ask me how tho.. I'm still on ppc here... :-)


pls(Posted 2006) [#8]
- Xcode can compile universal binaries on BOTH platforms. So a Xcode project can generate universal binaries from both PPC and Intel Macs.

- Blitzmax does not make use (yet) of the cross-compiler capabilities, so on Intel it generates Intel code, on PPC it generates PPC code.

- If you have both binaries compiled, by blitzmax, you can make use of the lipo tool to create a universal binary (you can use lipo on either ppc or Intel macs).

- You still need some sort of access to both a ppc and intel mac for testing purposes. On intel macs you can test the PPC version of a universal binary using "get info" and checking "run under Rosetta". But there is no equivalent to this on PowerPC macs (so if you must have a single mac, a Intel based one is better). As far as I can tell blitzmax powerpc binaries run well on intel under rosetta, only slower obviously (I cannot tell the difference on Su Doku Live, that's how good Rosetta is).


Banshee(Posted 2006) [#9]
I am having difficulty getting the lipo tool to work, I have two versions on my desktop, one I have renamed too "Permission Fixer 3 PPC" the other is now "Permission Fixer 3 Intel".

I'd like to then create one called "Permission Fixer 3"

So I type and get (via drag and drop into terminal)


I double checked renaming wasn't it by returning to the original build filenames and using a subfolder for each file and had much the same error:



Any suggestions please?


Nigel Brown(Posted 2006) [#10]
try this:

http://www.blitzbasic.com/Community/posts.php?topic=65180