Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-04

Cross compiling

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alberto Narduzzi

Hi all again...

so, what do I need to install/configure, in order to be able to produce _also_ windows executables from my Linux box with Lazarus and fpc?

Thank you,

A.

Reply by email

Alberto Narduzzi
to Patrick Chevalley

Patrick,

I have quick-read the links, and I think the quickest and easiest way of doing it is to install fpc and Lazarus on a Windows box, and then recompile the same source code.
As I have a virtual Windows machine (under VirtualBox) on my Linux box, I think I can give it a try.
(also because I haven't understood pretty good if and how the two different compiling environments can co-exist on the same PC - I'm used to Code::Blocks IDE, which allows different platform compilers to be chosen from a combo box, as I program for the PSP as well, and just guessed something similar was possible under Lazarus' IDE).

Thanks for caring.

Cheers, A.

Reply by email

Brad Campbell
to Alberto Narduzzi
Alberto Narduzzi wrote 7 lines
Patrick, I have quick-read the links, and I think the quickest and easiest way of doing it is to install fpc and Lazarus on a Windows box, and then recompile the same source code. As I have a virtual Windows machine (under VirtualBox) on my Linux box, I think I can give it a try.

Meh.. the quickest and easiest way is the one where you can type "make all" on your linux box and produce all your different architecture binaries all in one stroke. I don't see ever how running a virtual machine just to compile code for a single architecture should ever be called easy.

Read the docs, do a bit of fiddling and *boom* you have a workable cross compile environment. Trust me, if I can do it, anyone can.

If you get the mingw-binutils installed you can try a couple of these :

I use this to build my windows compiler : (watch the line wrap)

cd ~/src/fpc
FPC=ppc386 make crossall crossinstall CPU_TARGET=i386 OS_TARGET=win32 CROSSBINDIR=/opt/cross/bin BINUTILSPREFIX=i386-mingw- INSTALL_PREFIX=/opt/cross OPT="-gl -XX -CX"

.. and this to build the LCL for win32.

cd ~/src/lazarus
export LAZARUS_CONFIG_DIR=/home/brad/.lazarus
make OS_TARGET=win32 CPU_TARGET=i386 LCL_PLATFORM=win32 OPT="-gl -CX " all

I kinda cheat with lazarus in that I build it default (for GTK2) then I build the OSX/Win32 builds, then I build it *again* for linux including the idepkg option.

My compiler, toolchain and binutils lives in /opt/cross. Modify to suit.

I don't build my applications with lazbuild, I use a custom makefile as I find it easier, but whatever works.

All my applications are compiled for linux-i386, win32-i386, darwin-i386 & darwin-powerpc using a single source tree and a single make file on one linux machine. It's much easier to maintain and I don't have to fight with windows or its related baggage.

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.

Reply by email

Duncan Parsons
to Brad Campbell

On 03 April 2010 09:41, Brad Campbell wrote:

Alberto Narduzzi wrote 10 lines
> Patrick, > > I have quick-read the links, and I think the quickest and easiest way > of doing it is to install fpc and Lazarus on a Windows box, and then > recompile the same source code. > As I have a virtual Windows machine (under VirtualBox) on my Linux > box, I think I can give it a try. Meh.. the quickest and easiest way is the one where you can type "make

all" on your linux box and produce all your different architecture binaries all in one stroke. I don't see ever how running a virtual machine just to compile code for a single architecture should ever be called easy.

Read the docs, do a bit of fiddling and *boom* you have a workable

cross compile environment. Trust me, if I can do it, anyone can.

Show quoted text 7 lines
If you get the mingw-binutils installed you can try a couple of these : I use this to build my windows compiler : (watch the line wrap) cd ~/src/fpc FPC=ppc386 make crossall crossinstall CPU_TARGET=i386 OS_TARGET=win32

CROSSBINDIR=/opt/cross/bin

Show quoted text 7 lines
BINUTILSPREFIX=i386-mingw- INSTALL_PREFIX=/opt/cross OPT="-gl -XX -CX" .. and this to build the LCL for win32. cd ~/src/lazarus export LAZARUS_CONFIG_DIR=/home/brad/.lazarus make OS_TARGET=win32 CPU_TARGET=i386 LCL_PLATFORM=win32 OPT="-gl -CX "

all

I kinda cheat with lazarus in that I build it default (for GTK2) then I

build the OSX/Win32 builds, then I build it *again* for linux

>including the idepkg option. My compiler, toolchain and binutils lives in /opt/cross. Modify to

suit.

I don't build my applications with lazbuild, I use a custom makefile as

I find it easier, but whatever works.

All my applications are compiled for linux-i386, win32-i386,

darwin-i386 & darwin-powerpc using a single source tree and a single make file >on one linux machine. It's much easier to maintain and I don't have to fight with windows or its related baggage.

Brad

I've always liked this idea, but working primarily in windows limits the options, and I find this somewhat annoying! My targets would be win32/64 and OSX-Carbon (+Cocoa when sufficiently mature).

It looks like I might be able to do this from OSX, but win is my primary platform. I understand the reasoning, and I guess it's just one of those things..

One day I'll sort it out!

Reply by email