On Fri 08 Feb 2008 19:12:24 NZDT +1300, A Thomas wrote:
Long version: I use Linux at home (duh), and the school I go to uses
Mac OS X (some Intel, some PPC), and I want to be able to use this
program at the school, but it would be a pain to compile it on the
school computers (mainly because I would have to puzzle out Xcode),
also if I need a new feature or bug fix in a new version, I would
have
to go through this all again. So if I could compile this program
for
Mac, from Linux, that would save a lot of time.
What did your googling come up with? I put in "gcc macosx
crosscompile
linux" and the top link to ubuntuforums is right on topic, but not
all
that helpful - people who heard "gcc" and "cross-copile" in the same
sentence answering that gcc can do it, but otherwise not much clue to
the how (pretty much my experience with ubuntuforums in general - all
question, not much answer).
You're dealing with a complex issue and need to look at it one step
at a
time. What gcc calls cross-compile is generating code for one
processsor
on another one. Yes gcc can do that. You'll have to recompile gcc for
that as AFAIK no Linux distributor ships a gcc which is compiled for
more than the architecture it's running on. Keep in mind that gcc
compiles for processors only - it's what it calls hosts or
architectures, it does not really compile for operating systems. For
Apples you're looking at PPC and x86.
If you want to make the code actually run on another OS, you'll
have to
get a linker which can all of a) create executable code for that
OS, b) link against the standard runtime environment of that OS, c)
link
against any other libraries that the OS or your application uses. At
least b) needs substantial information about "macosx" on your Linux
machine - you guessed it, it's not there. You get to put it there
first.
As pointed out by others, you'll need that xcode, it's unclear to me
whether it is available on Linux. Also, comments like "on mac osx
we use
a specially doctored gcc made by apple" don't suggest to me that
develop-on-Linux-run-on-Macosx is that far advanced.
So this is what you need to sort out. If you make it, let us all know
and write it up somewhere. My guess is that only someone proficient
in
developing on both Linux and Macosx independently will be able to put
something like this together, esp as all the parts might not yet be
available.
Volker