[Lazarus] Cross compiling a package woes..

Brad Campbell brad at wasp.net.au
Wed Oct 1 20:21:12 CEST 2008


Mattias Gärtner wrote:
> Zitat von Henry Vermaak <henry.vermaak at gmail.com>:
> 
>> 2008/10/1 Brad Campbell <brad at wasp.net.au>:
>>> G'day all,
>>>
>>> I'm using the latest FIXES_2.2 branch of FPC and lazarus svn from about 10
>>> minutes ago.
>>> I usually compile lazarus from SVN, then compile again with
>>> make idepkg
>>> to get my packages included. It's worked for me thus far, but now I want to
>>> cross compile I can't
>>> figure out how to go about it.
>>>
>>> I'm cross compiling from linux-i386 to darwin-i386 / darwin-powerpc and
>>> win32-i386.
>>> All these I have working, and I can even cross compile lazarus itself to
>>> run on these platforms.
>>> When I want to use lazbuild to build my application I get this...
>>>
>>> brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ ../../../lazarus/lazbuild
>>> --os=darwin --cpu=powerpc
>>> --ws=carbon BST.lpr
>>> TLazPackageGraph.CheckIfPackageNeedsCompilation  No state file for tv 0.0
>>> [TExternalToolList.Run] CmdLine="/opt/cross/bin/ppc386 -B  -MObjFPC -Sgi
>>> -O1 -Tdarwin -gl -vewnhi -l
>>> -Fu../packager/units/powerpc-darwin/ -Fu. -FUlib/powerpc-darwin/ tv.pas"
>> i don't know if lazbuild is clever enough to find the right compiler,
>> maybe you need to specify it with --compiler=/opt/cross/bin/ppcrossppc
>> (or whatever your powerpc compiler is called).
> 
> The CPU override was not used for projects. Fixed in 16831.

Ok, I did a svn up, make distclean ; make LCL_PLATFORM=gtk2 all .. and it's still not working.

It's still giving precisely the output above.. with CmdLine="/opt/cross/bin/ppc386".. I'm sure that 
should just be /opt/cross/bin/fpc and it will figure it out from the -P and -T parameters..

I've managed to get lazarus to cross-compile for powerpc, using make directly. I've managed to get 
it to compile the idepkg target (after having to add the ~/lazarus/TreeView path to my -Fu in 
~/.fpc.cfg).. but lazbuild still will not pick the right compiler for me.

It's griping it can't find the comctrls unit (which is fair, it's using ppc386 and looking for a 386 
binary in the powerpc directory).

Am I doing something obviously stupid?

brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ ../../../lazarus/lazbuild --cpu=powerpc --os=darwin 
--ws=carbon BST.lpr
TLazPackageGraph.CheckIfPackageNeedsCompilation  No state file for tv 0.0
[TExternalToolList.Run] CmdLine="/opt/cross/bin/ppc386 -B  -MObjFPC -Sgi -O1 -Tdarwin -Ppowerpc -gl 
-vewnhi -l -Fu../packager/units/powerpc-darwin/ -Fu. -FUlib/powerpc-darwin/ tv.pas" 
WorkDir="/home/brad/devel/fpc/lazarus/TreeView/"
TOutputFilter.Execute :TProcessUTF8
Hint: Start of reading config file /home/brad/.fpc.cfg
Hint: End of reading config file /home/brad/.fpc.cfg
Free Pascal Compiler version 2.2.3 [2008/10/01] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Darwin for i386
Compiling tv.pas
Compiling directorytreeview.pas
Fatal: Can't find unit ComCtrls used by DirectoryTreeview
TExternalToolList.Run Exception: /home/brad/devel/fpc/lazarus/TreeView/directorytreeview.pas(1,1) 
Fatal: Can't find unit ComCtrls used by DirectoryTreeview
ERROR: tool reported error
brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ find ../../../lazarus/lcl/units/ -name comctrls.ppu
../../../lazarus/lcl/units/i386-linux/comctrls.ppu
../../../lazarus/lcl/units/powerpc-darwin/comctrls.ppu
brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ grep lazarus ~/.fpc.cfg
-Fu/home/brad/devel/fpc/lazarus/lcl/units/$fpctarget
-Fu/home/brad/devel/fpc/lazarus/TreeView
brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ cd ../../../lazarus/
brad at bkmac:~/devel/fpc/lazarus$ svn up
At revision 16831.

Regards,
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.





More information about the Lazarus mailing list