Game Development Community

How Do I Compile a T2D Mac Binary from a Windows PC?

by Bryan Edds · in Torque Game Builder · 03/09/2005 (10:59 pm) · 36 replies

Hey guys, sorry for the newb question, but I've just never looked into it before. I'm doubting it's even possible... I've heard of cross-compilers, but I'm not familiar with them either. Would I use GCC? Does that work with T2D?

Thanks for any help!
Page «Previous 1 2
#1
03/09/2005 (11:20 pm)
Unfortunately, Apple doesn't release libs that allow for cross-compilation, so as of right now, "you can't get thar from heer".
#2
03/10/2005 (4:35 am)
For this very same reason, i've been seriously considering picking up one of those Mac Minis. It'd be great to be able to package my own mac releases. 500 bucks isn't a huge investment where a whole new system is concerned, either. Anyone have any opinions on them? I'd love to talk to someone who has used one.
#3
03/10/2005 (8:47 am)
I've never looked at gcc cross-compilation for the Mac, but I believe that Stephen is correct about the libraries. While it is within the realm of possibility that you could gather the Darwin source and download a million of the OSX SDK's and figure it out by trial and error. Still not the best solution.

I have a dual G5 and a Mini at home. Debug TGE can be doggy, but the release has been smooth from my experience. I have more problems with Lightwave between the G5 and Mini than I do TGE. T2D runs very well in both debug and release versions.
#4
03/10/2005 (9:03 am)
Got my Mac Mini ordered :) I'll post my impressions once I get it in a few weeks.
#5
03/10/2005 (9:18 am)
I'm also very interested in the Mac Mini and cross-compiling.
#6
03/10/2005 (10:03 am)
Yeah, corey, let us know. For any game i make, one of my self imposed requirements is that there is a build for at least linux,w32, and osx. I want to get a mini for this reason (and a few others, like my love of unix based OSes).

Is the wait still like 4 weeks? If i order one, i want it YESTERDAY! :)
#7
03/10/2005 (10:18 am)
My order is reporting 1-2 weeks shipping time, and of course I went with the two day shipping, hehe. I think the wait time is definately reduced from what it was a month ago- though the 1-2 week projected time may or may not be accurate. I'll keep you posted :)

PS:
From what I understand, OSX is unix based, does this mean I can package up linux releases? Thats probably a dumb question, but I know very little about *nix (but i'm learning slowly!).
#8
03/10/2005 (10:24 am)
I know that gcc, x11, etc are all available for osx. Think of osx as bsd with a gorgeous window manager... Im not 100% sure you could build x86 linux releases on it, but im sure you could release ppc linux versions.

then again the osx build may work under yellowdog and the like, i dont know enough about the ppc arch

Anyways, ive only been interested in osx in the past 6 or so months, the time might be coming up to get a mac mini (if these student loan payments will ever quit)

Though, the sdk is available for all 3 platforms, so if you dont make any changes to the engine itself, my guess is you could use that binary, though im unsure if thats "kosher" around here. Licence issues always give me a headache, i just wanna make/play rad games (without stepping on anyones toes)
#9
03/10/2005 (10:31 am)
@Corey and Ryan: No, you cannot transfer torque binaries cross platform like that (*nix to Mac, or the other way round)--even though Mac OS's are loosely based on FreeBSD, the primary driving factor is the use of big vs little endian (a way of representing numbers at the byte/multi-byte level)--Mac OS does it "backwards" from windoze and most *nix flavors.

The way cross platform compiling works right now across *nix/windows is because both windows and *nix provide the system libs required for their specific platform in a format that the other platform can use for compilation. Therefore, when you have those lib packages installed (mingw ironically is used in both cases IIRC), you can set your target platform to WIN32 or LINUX and the makefiles handle the configuration and which libs to use. You don't actually take a binary compiled for linux and simply copy it to a windows box and double-click--they are different binaries.

Additionally, networking is done drastically differently in many ways--IIRC, Mac doesn't even have a concept of "sockets", but calls them (and implements them) with a different technique.

For what it's worth, the endian issue is also the primary reason why you cannot use .cs.dso files cross platform between Windows/*nix and Mac either.

EDIT: Theoretically, you could compile *nix targetted binaries on Mac, if you had the *nix libs installed. What is missing is the Mac libs--they haven't been made public, so you can't compile using Mac libs on a *nix or windows box.
#10
03/10/2005 (10:58 am)
Cool then, thanks for the clarifications on that, Stephen! Not that I know the first thing about *nix libraries or how I would need them set up, but i'm sure the wiser among us will figure out what's what :).
#11
03/10/2005 (11:12 am)
OSX's networking is based on BSD sockets, but it previously wasn't. Becoming one of the unices helped it's networking stability greatly.
#12
03/10/2005 (11:15 am)
@David: you are correct, I glossed over the details (mostly because I don't understand them well myself), but I do know that BSD sockets are pretty different from windows/other *nix sockets!
#13
03/10/2005 (11:44 am)
You would need a crosscompiling GCC from windows to MacOS X, running on windows. You would need a copy of all the libs that ship with MacOS X, not just Darwin, unless you limited yourself to shipping Darwin binaries, which would run on MacOS X, but no nothing of the Cocoa, Carbon and friends frameworks.
To get such copies, you'd have to own a license to MacOS X, and be able to install it to get the libraries, which is a chicken and egg problem : if you have a Mac to install MacOS X on, why would you compile from windows :)
Then, either by a network share, or copying over the files to your windows box, and pointing your crosscompiling environment at them, you'd be able to build Mach-0 binaries.
Basically, you need the right libraries for your target environment reachable by the crosscompiler toolchain, which takes care of building the right code, in the right format, and linking it with the right libs, etc.
You don't need special versions of the lib, the differences in platform are taken care of by the crosscompiler

Oh, Metrowerks might still make a version of Codewarrior for Windows that allows cross development to MacOS X, they use to do it in the MacOS Classic days : I could compile windows app on MacOS, and compile Mac apps on windows :)
#14
03/10/2005 (11:59 am)
I believe that you still can, but that's a $799 pricetag fro the Windows and Mac combo pack...and I had difficulty finding confirmation that the Windows version could target the Mac...but I know that the Mac (only) pack can target Windows...
#15
03/10/2005 (12:03 pm)
I picked up an iMac off of Ebay for around 200 bucks a few months ago for porting. It's not the fastest thing in the world, but it does the job well, and the price was right :-)
#16
03/10/2005 (1:08 pm)
Holy moley! What a useful thread!

Not a day goes by where I'm not reminded of the greatness of the GG community.

I guess I may look into the mac minis one day too. They seem pretty cool :)
#17
03/11/2005 (7:44 am)
@stephen, thanks for clearing that up for me. Im a fan of unix based OSes (debian gnu/linux currently) but what osx inherited from bsd was a bit of a mystery for me, as my expirence with osx is very limited (supporting a mac lab which was mosty pre-osx macs). I also didnt know that the dso files would be incompatable between platforms, though it makes sense, now that i think about it. Never really gave it a thought (and do all of my deving under linux, so this would only really become an issue if i released something and wated cross platform binaries).

When i get the cash, a mac mini to check out osx's platform, because like those commercials used to say "the more you know..."
#18
03/11/2005 (12:33 pm)
Corey: That's what I did! I love my Mac mini. As far as I am concerned, it was targeted exactly to my market segment -- People who are "Mac curious" but didn't want to cough up $2000+ for a brand new system. I've successfully ported one of my TGE games over to the Mac, and probably in the next day or so I'm going to give T2D a try too. :)

Just be prepared for a big Xcode 1.5 download! And potentially going nuts trying to figure out Xcode's weird user interface. :)

And yes, don't forget to delete your .dso files and let Torque regenerate them. I spent about a day chasing down a crash bug in the script engine only to realize I hadn't removed the .dsos from the PC!
#19
03/11/2005 (2:48 pm)
@David: It would be great if you did a write-up of the things involved in making that step from Windows to Mac. :) I plan to do this down the road, so I'm very curous about the details. Great to hear that it isn't that painful.

BTW, did you get a Mac Mini with more than 256megs of ram or is that enough?

Edit: typo fix.
#20
03/11/2005 (2:55 pm)
Oh, heh, a writeup? My brain is all hazy on that, but I will try to remember to make notes when I do the T2D conversion to Mac. (Which, really, should just amount of sending the code over to the Mini, booting up Xcode and then building the project. But, alas, things are almost never that simple. ;)

Yeah, mine is the $499 version with 1.2 GHz G4 and 256M. It gets chunky at times, especially with Torque builds, but it is actually surprisingly responsive considering the low RAM. Running Torque itself had no problems whatsoever with the built-in Radeon 9200.
Page «Previous 1 2