Build a Universal Binary (BlitzMax)

Archives Forums/MacOS X Discussion/Build a Universal Binary (BlitzMax)

Captain Wicker (crazy hillbilly)(Posted 2013) [#1]
IS there a way to compile a universal binary (works on both ppc and intel) in blitz?


Brucey(Posted 2013) [#2]
You need to compile both PPC and X86 binaries, then merge them together using the lipo command-line tool.

You can either :
1) have 2 Macs - 1 ppc, 1 x86, compile up everything separately. Copy one binary to the other machine, and run the lipo tool against it.

2) use a custom build tool to do everything on one (supported) machine in the same installation of BlitzMax.


Captain Wicker (crazy hillbilly)(Posted 2013) [#3]
You need to compile both PPC and X86 binaries

I have Snow Leopard + Rosetta installed as secondary OS's.
use a custom build tool to do everything on one

How can I do that?


xlsior(Posted 2013) [#4]
IIRC Brucey made a custom version of bmk that could automagically do it?


Captain Wicker (crazy hillbilly)(Posted 2013) [#5]
Do you mean this: http://www.blitzmax.com/Community/posts.php?topic=85108 ?


xlsior(Posted 2013) [#6]


Yes, that's the one. From the first posting: "Universal Builds on Intel Mac"

It also lets you create windows .exe's on a Mac or Linux computer.
(Unfortunately, you can't make Mac executables on a PC, due to the xcode requirement.)


Captain Wicker (crazy hillbilly)(Posted 2013) [#7]
When I install the bmk, it says
unrecognized extension:bmx

I replaced the default bmk with brucey's bmk.


ima747(Posted 2013) [#8]
you also need MaxIDE CE (Community Edition) which has support for the extended functions of brucey's BMK including cross platform/architecture targeting where supported.

OR

You have to use it by hand from the command line.

Side bar: PPC is officially dead as a supported mac architecture. Not saying that to discourage using it (it still works fine) but from a commercial standpoint it isn't a critical target. You would likely have a higher return by targeting Linux than PPC mac.

Last edited 2013


Captain Wicker (crazy hillbilly)(Posted 2013) [#9]
MaxIDE CE (Community Edition)

I compiled this for OSX some time ago. It still doesn't work with the bmk. :(

The source files will compile now that I have copied the .bmk files to the /bin/ directory. Do I need to copy any libs from the PPC max package to make this compile for powerpc? Also, I am interested in compiling for Windows on my Mac, too. This would save a LOT of time having to reboot when I want to compile for MS Windows. :)

Last edited 2013


ima747(Posted 2013) [#10]
If I recall correctly you need a binary from the PPC build as well, should be in the instructions for BMK+. You can cross compile for windows but it involves a lot of hunting down the right tools. Look under the BMK threads for further details, it's quite extensive and I haven't done it from scratch in a long time.


Brucey(Posted 2013) [#11]
You need to rename the bcc program from the PPC BlitzMax to bcc_ppc (so that two bcc apps can sit in the same bin folder together).

You can test things by going into the terminal to your BlitzMax/bin dir and type things like :
./bmk -v

… for a version number.

./bmk makemods -i

… to build mods for universal (this will build a set of PPC and x86 modules).

As a minimum for bmk_ng to run, you need the files core.bmk and make.bmk in the bin dir too.

If you can, build bmk from source with the settings of mutithread, non-gui and non-debug.

Remember to back-up the original before replacing it.


Captain Wicker (crazy hillbilly)(Posted 2013) [#12]
I finally got this working. Can I build a windows binary on my mac now and be rid of Windows finally?


Brucey(Posted 2013) [#13]
You can build Windows binaries via mingw32 on Linux/OS X. You can even run them in Wine.

But whether you should get rid of Windows, I won't comment. Certainly you should probably have something around for testing, if you intend to ship Windows apps.
I have XP running in Parallels.


Captain Wicker (crazy hillbilly)(Posted 2013) [#14]
I could probably install Win8 in Parallels Desktop 7 just for that purpose.