views:

293

answers:

4

I'm doing a little app that I want to distribute in different platforms, at least the 3 major ones.

Is it possible to use only Windows has the host OS to compile the binaries for Linux, Mac OS X and other supported platforms without resorting to virtual machines?

Or should I ask around in some community to help me compile on, well OS X, actually, since I can virtualize a Linux machine quite easy?

A: 

I would virtualize Linux, as even if you can cross-compile, it means you're not testing the binaries on their native platforms. OS X is a trickier problem.

Bernard
A: 

It is not possible to compile from one platform to another. We have a Mac and use FPC quite often. If you need some help with compiling on a mac, drop me a message.

birger
I sure wish I could drop you a message, but looks like you really don't answer on [email protected]
Gustavo Carreno
Sorry, I forgot to reply. I e-mailed you.
birger
This is incorrect, I crosscompiled an entire Lazarus from win32 to Mac and back. Some combinations are not easy, let alone end-user ready, but it can be done mostly, except from (non-x86)->x86 due to extended use for REAL constants in the x86 codegenerator. Note that includes windows/x86_64 (aka Windows x64, 64-bit etc), since extended was marked deprecated in Windows/x86_64 apis.
Marco van de Voort
+4  A: 

It is possible to compile from one plateform to another, it is called cross-compilation. You will find extensive informations at http://www.stack.nl/~marcov/buildfaq.pdf
The buildfaq above contains sample cross-compilation :

  • from Windows to Linux,
  • from FreeBSD to AMD64 Linux

The FPC download page contains :

  • the i386-win32 to x86_64-win64 cross-compiler
  • the i386-win32 to arm-wince cross-compiler

The FPC mailing lists are at http://www.freepascal.org/maillist.var
You will find more informations about FPC at http://www.freepascal.org/moreinfo.var

Inoussa OUEDRAOGO
+1  A: 

(I'm the author of the buildfaq document above)

There are some limitations. You can't target x86 from powerpc, because powerpc misses an "extended" type. But in generally it works.

I have generated a complete Lazarus for OS X on Windows.

Thanks MarcoV, I appreciate that. I'm not going to support powerpc, I think it's a bit outdated even if there are quite alot of them still around...
Gustavo Carreno