[fpc-pascal] Cross compiling: "from linux to Darwin or Mac OS X"

Brad Campbell brad at wasp.net.au
Mon Mar 29 03:13:29 CEST 2010


Torsten Bonde Christiansen wrote:
> I do already own a legit Mac mini so I have not problem compiling my 
> code for Mac OS X. But the mini is not my primary machine and is 
> actually only meant for testing puposes, so I wanted to create a setup 
> on my primary PC (64-bit linux) that, using a script, can compiles and 
> cross compiles for all of our supported OS and CPU targets.

I cross compile from Linux to i386-Win32 / i386-Darwin / PowerPC-Darwin.

I've uploaded the tools I used to build the mac tool chain here :
http://www.fnarfbargle.com/cross-tools

The trick was to use the binaries from odcctools-20060413.tar.bz2, but to link i386-Darwin I needed 
ld from odcctools-9.2-ld.tgz

I've had this working for over a year now, so the steps I used to build it are a little hazy, but 
from memory I built and installed the 2006 version of ocdtools, then I built the 9.2 version and 
manually copied just ld across.

I build against a copy of the 10.4 SDK (I installed Tiger on an old PPC box, then installed X-Code 
and copied the SDK across to my Linux build machine.

crossbuild.txt is the script I currently use to update my toolchains, so it contains the commands I 
use to build all versions of the compiler. In the comments at the top are the commands I used to 
build ocdtools.

Hope this helps.

Regards,
Brad
-- 
Dolphins are so intelligent that within a few weeks they can
train Americans to stand at the edge of the pool and throw them
fish.



More information about the fpc-pascal mailing list