Author Topic: programming for mac on XP?  (Read 7447 times)


  • Guest
programming for mac on XP?
« on: December 15, 2005, 03:46:18 pm »
Hello! Can I make program on WinXP or Red Hat and then compile my applications for OSX at the same time whitout having an mac computer, so i then can send the package to the mac users!

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
RE: programming for mac on XP?
« Reply #1 on: December 15, 2005, 09:06:19 pm »
In theory it is possible. The practical problem is the lack of cross-binutils for i386-win32 -> powerpc-darwin.

It is possible and has been done for linux -> powerpc-darwin.


  • Jr. Member
  • **
  • Posts: 55
RE: programming for mac on XP?
« Reply #2 on: December 15, 2005, 10:19:58 pm »
A while back I did this. Here is a rough outline od what I had to do:

1) First you need the binutils for the platform you want to compile to. Download odcctools from this site (use the cvs version) and follow their instructions for installing.

2) you need to create a fake root dir like: $HOME/darwinroot
  copy at least the /System and /Frameworks and /usr directories (you may have to copy more than this) from your Apple or Darwin computer to $HOME/darwinroot

3) now that you have these files make a folder in $HOME/darwinroot called cross. where ever you installed the odcctools you need to make links for the cross tools to be more fpc friendly.  there are a bunch of files from odcc tools called powerpc-apple-darwin-* you need to make links (or rename them) so powerpc-apple-darwin-ld becomes powerpc-darwin-ld, do the same for *-ar and *-as.

4) now you are ready to crosscompile fpc. basically you need to have the fpc source and have a terminal open there.
type: $PATH=$PATH:$HOME/darwinroot/cross (or whereever you made the symlinks)
type (iirc) make all TARGET_OS=darwin TARGET_CPU=powerpc OPT="-Fl/$HOME/darwinroot/usr/lib"
if that succeded you can install it to whereever you want with: make install TARGET_OS=darwin TARGET_CPU=powerpc PREFIX=/cross/fpc

now copy the file ./compiler/ppccross somewhere you will be able to find it as it's the compiler you'll need to build powerpc programs

5) configure your /etc/fpc.cfg file.  
add a section like this:
#IFDEF powerpc
-k-systemroot $HOME/darwin/cross

whenever you want to crosscompile you have to have ppccross and the symlinks to powerpc-darwin-* in the PATH
and you should be able to just do ppccross someprogie.pas and it will create a darwin executable.

I may have mistated some things (or most everything) as it's been a while since I did this.



TinyPortal © 2005-2018