Actually Aidan, you might want to reconsider your question.
If I understand correctly, what you want to do is get a program you know
that runs on Linux to run on MacOSX. ;-)
What you might want to consider is whether the FreeBSD (what Mac's
Darwin is based on) ports tree has the program you want in it already.
Use the command line on the Mac to grab down the ports tree and then see
if you can run make on it. (You'll need to install compilation software
on the MAC but then you'll need to do that anyway with your original idea).
Hey presto - new app installed correctly with no fluffing about with
cross-compiling!
If you want further help, email me off list.
Brat.
Aidan Gauland wrote:
I've found NOTHING helpful on the Internet, so I think I'm going have
to give this one up. An idea that never even got off the ground. It
exploded in the hangar. Apple can be as stupid as Microsoft in some
ways.
-Aidan
Delio Brignoli wrote:
Hi,
Even though what you are trying to do is theoretically possible by
wasting countless hours chasing up a version of gcc's source with
apple patches and then making it work, breaking some licenses by
installing their SDK libs on a different platform and then rewriting
a number of utilities used by the build process I do not recommend
you try.
Sadly, Apple does not support compiling for OSX on any platform other
than... (drum roll) OSX.
Also Apple does not allow you to run their OS in a virtual machine.
So I believe you will not be able to compile an executable targeted
to OSX from your linux machine :(
Xcode is downloadable as an *huge* (a little more than 1GB) disk
image from Apple. It is made up of an IDE, gcc, Apple's substitute
for "make", SDK libraries for various versions of their OS and a
thousands other development related utilities.
Xcode will be easy to use if all you need to do is build: open
project file, hit build&run icon.
HTH (at least to avoid hours of fruitless attempts)
--
Delio
On 9/02/2008, at 4:06 PM, Aidan Gauland wrote:
If I was just trying to compile some command line program (like
lynx), this would be a dawdle (probably). But this program's build
environment for Mac OS X uses Xcode, AND it makes a .app directory,
for the Finder (if you don't know what the .... I'm talking
about.....sorry, I just looked, and couldn't find anything
explanatory on the net....it's just some weird way of organising
files and folders in a directory named "foo.app", so it shows up to
the Finder as a single file. Lets not start an OS API flame war now
though.) So that complicates this problem a bit, and is what I need
help with.
-Aidan
Volker Kuhlmann wrote:
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
--
Brett Davidson
Systems Engineer
--
Net24 Limited
Web: www.net24.co.nz
Phone: 0800 5000 24 | DDI: +64 3 962 9518
--
// web hosting / email hosting / data backup
// our reputation for reliability precedes us
This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please
delete it and notify the sender.