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: Blake Nicholson
Subject: Re: Cross Compiling for OS X?
Date: Sat, 3 May 2008 21:25:24 -0400


On May 3, 2008, at 6:16 AM, David Chisnall wrote:

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, would you mind clarifying your last paragraph a bit? My reading of your first sentence is that you want to build native OS X applications via GNUstep Make, but then your second sentence seems to suggest you're already doing that. For what it's worth, I use GNUstep make to build native applications on OS X (the app is not a universal binary). I use the DBModeler application from GDL2 as a native app (I had to build nibs to replace the gorm files).

I may have completely misunderstood what you're saying, and apologize if that's the case.


Cheers,
Blake




reply via email to

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