Forum > Linux

getting fpc cross-compiling on Fedora Linux.

(1/5) > >>

lazer:
Hi,

I'm using Fedora 35 and have installed Lazarus ( and hence fpc ) from distro.  Native building seems fine.

Now I need to compile for a win64 win32 targets.  Years ago I did this and it all worked out of the box, I was impressed. Now it's become a "challenge".

fpc files are installed in:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---/usr/lib64/fpc/3.2.2/units/x86_64-linux/rtlthe source is in :

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---/usr/share/fpcsrc/packages
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---ls -d  /usr/share/fpcsrc/packages/rtl*/usr/share/fpcsrc/packages/rtl-console  /usr/share/fpcsrc/packages/rtl-generics  /usr/share/fpcsrc/packages/rtl-unicode/usr/share/fpcsrc/packages/rtl-extra    /usr/share/fpcsrc/packages/rtl-objpas This seems pretty standard but there is also :

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---/usr/share/fpcsrc/rtl
https://wiki.freepascal.org/Cross_compiling_for_Windows_under_Linux

It looks like I need to build the cross compiler since this is not provided in the distro pkg.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---export FPCVER="3.2.2"cd /usr/share/fpcsrc/"$FPCVER"/make clean all OS_TARGET=win64 CPU_TARGET=x86_64make clean all OS_TARGET=win32 CPU_TARGET=i386 There is a deviation here since $FPCVER seems to be "package" in this installation. In anycase I set that value and cd to that directory.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---make clean all OS_TARGET=win64 CPU_TARGET=x86_64...


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---make[1]: Leaving directory '/usr/share/fpcsrc/packages/fpmkunit'./fpmake clean --localunitdir=.. --os=win64 --cpu=x86_64 -o -Twin64 -o -XPx86_64-win64- -o -Xr -o -dx86_64 --compiler=/usr/bin/ppcx64 -bu -scp./fpmake compile --localunitdir=.. --os=win64 --cpu=x86_64 -o -Twin64 -o -XPx86_64-win64- -o -Xr -o -dx86_64 --compiler=/usr/bin/ppcx64 -bu -scpThe installer encountered the following error:Could not find unit directory for dependency package "rtl" required for package "bzip2"make: *** [Makefile:1721: all] Error 1  
I'm suspecting that the slightly non-standard tree is the cause. Maybe I need to symlink the rtl dir , can anyone advise ?

TIA.

dbannon:

Hmm, the instructions you are following were written assuming a FPC installed as described. Sadly, distro packages like to move things around. You could try some symlinks in the appropriate place I guess but as I don't use Fedora, no guarantees.

I suspect you might need to follow whats happening a bit more closely, there is no magic in the recipe provided, it just uses the supplied Makefile with a suitable parameter.  You must however end up with things such as RTL in a place defined in the fpc.cfg file. In theory, anywhere you like but a lot easier if you follow conventions.

The fpc.cfg typically has a $VER in the various paths but I see no intrinsic reason why it could not be "package" but if you could replicate the original structure, again, life would be easier.

Davo

 

Leledumbo:
I suggest uninstalling distro packages and use distro agnostic tar archive instead. The situation is similar with Debian derivatives, no idea why the package maintainer does that (changing the directory hierarchy around).

dbannon:
in fact Leledumbo, the wiki howto used the SourceForge FPC, but a deb not an RPM package. Like you, I prefer a Tar install of FPC but wrote the howto based on the SourceForge package because more new user prefer that model. Its easily adapted to the Tar model and that would be better as it would be far more uniform between distros ...

On the other hand, its definitely not easily adapted easily to either the Debian produced deb, nor, I suspect the distro preferred RPM.

Laser, in short, Leledumbo is sort of right, get the official FPC fpc and life will be easier still !

Davo

lazer:
Thanks for all the replies.

I prefer to use distro pkgs where possible since the that is the point of a distro. If I install fpc by hand I then have to do Lazarus by hand to fiddle with distro config so that it knows I'm supposed to be in charge of that and ignores any deps.

I have a small number pkgs which I run this way but I aim to keep it as small as is really necessary.

I suspect there is trivial tweak here like defining something in fpc.cfg or making a sym link.

Navigation

[0] Message Index

[#] Next page

Go to full version