Recent

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

spaceturner

  • 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.

Drewski

  • 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. http://www.opendarwin.org/projects/odcctools/

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
-Fu/cross/fpc/lib/fpc/$fpcversion/units/$fpctarget/
-Fu/cross/fpc/lib/fpc/$fpcversion/units/$fpctarget/rtl
-Fu/cross/fpc/lib/fpc/$fpcversion/units/$fpctarget/*
-k-systemroot $HOME/darwin/cross
#ENDIF

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.

Andyman

 

TinyPortal © 2005-2018