[Lazarus] [Partially Solved] Cross Compile for arm-linux

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Dec 12 12:56:40 CET 2009


On Sat, 12 Dec 2009 11:40:41 +0100
Kjow <antispammoni at gmail.com> wrote:

> 2009/12/12 Mattias Gaertner <nc-gaertnma at netcologne.de>:
> >> ~/lazarus/$ sudo make clean all CPU_TARGET=arm OS_TARGET=linux
> >> PP=/usr/local/bin/ppcarm OPT="-FU/usr/lib/fpc/2.5.1/units/arm-linux/"
> >
> > This puts all ppu files to /usr/lib/fpc/2.5.1/units/arm-linux/.
> > Normally every project/package has it's own directory for its ppu
> > files. But now you have mixed them all up, which means all
> > documentation don't work for you. You can proceed if you know what you
> > are doing, or remove all files in this directory and restart.
> 
> Ummm... sincerely I don't know very well what I'm doing... there are
> very few examples in web, so I tried some things that I find in
> similar threads.

The linux arm support for FPC is quite new.


> However ok, I'm going to remove and re-unpack all sources, but what is
> the command I need to do to preserve "every project/package in its own
> directory for its ppu files"?

This is automatically done by the IDE.
Just start the IDE in a terminal, compile a package normally and see
what it does.

I wrote a few hints here:
http://wiki.lazarus.freepascal.org/Cross_compiling#Cross_compiling_the_LCL

 
> > You forgot to install the X11 libraries for arm.
> > LCL applications also needs the gtk2 libraries.
> 
> Umm... I can't find in synaptic/repository/other (maybe, do I need to
> compile by fpc?)... now I'm trying to grab these libs from my arm
> device.

No. gtk2 and X11 are written in C.
So if there are no cross compiled packages for arm, you may have to
cross compile them yourself. See the gtk website of how to do that.

 
> > The gtk2 must be written small (LCL_PLATFORM=gtk2).
> >
> > You should have done in the first place instead of the above with
> > the -FU option.
> > But since you have already compiled the lcl and put its ppu files
> > into a global directory you are out of luck.
> 
> So, in a new/clear installation, after I have FPC that cross compile
> for arm-linux and before to compile first time Lazarus from sources,
> what do I need to do?
> 
> What I understand:
> 
> 1) Compile Lazarus for the host.

Lazarus is the IDE, LCL and a bunch of components. 
You only need the LCL and a few components.


> 2) /lazarus$ make lcl LCL_PLATFORM=gtk2 PP=ppcarm CPU_TARGET=arm OS_TARGET=linux
> 3) /lazarus/packager/registration/$ make PP=ppcarm CPU_TARGET=arm
> OS_TARGET=linux

Yes.
You can do that via the IDE.


> 4) ?

Install the cross compiled libraries for arm. I never did that so I
can't give any hints here.


> PS I'm sorry if I don't understand, but I find just few examples in
> how to use these commands...

Cross compiling is an advanced topic.


Mattias




More information about the Lazarus mailing list