discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cross Compiling for OS X?


From: David Chisnall
Subject: Re: Cross Compiling for OS X?
Date: Sat, 3 May 2008 11:16:21 +0100

On 3 May 2008, at 10:26, hns@computer.org wrote:

c) Real cross-compiling
This means that you have a gcc version on your Linux machine that
emits executables that run on OSX. Unfortunately, OSX uses MACH-O
binaries and building a cross-compiling gcc is very tricky.

I've not tried building Apple GCC on non-Apple platforms, but even if you do this then you need more to get a real cross-compiling environment. You also need copies of every header file that your program includes. You can't substitute GNUstep's Foundation.h for Apple's, since they have different instance variable layouts so any of your subclasses of Apple classes will be wrong. This header also includes other headers which define things like the sizes and layouts of of C types and so on, These can be acquired from the Darwin sources, but you'll still need the framework headers which are not publicly redistributable. In short, cross compiling is hard, which is why hardly anyone does it.

Improving GNUstep Make to build native OS X applications (it already works nicely for frameworks) would be a better approach, but I'm not sure how much effort this would be. Building OS X apps from a makefile isn't very hard, although fat binaries are slightly harder, so it might be worth investigating.

David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]