* * *

Author Topic: Understanding cross compiling of Lazarus  (Read 750 times)

vfclists

  • Hero Member
  • *****
  • Posts: 821
    • HowTos Considered Harmful?
Understanding cross compiling of Lazarus
« on: July 17, 2016, 01:34:29 am »
I am back into the compilation business again and I want to be sure that I have got the steps right. My  questions assume that whatever I cross compile all the necessary utilties and files which are necessary for compilation to work on the target platform are already in place or available for adding to the package.

From what I understand although the compiler used for Lazarus can be switched and Lazarus recompiled with a Clean All and Build, FPC requires that it is built with the same version as its packages.

So consider the hypothetical case of building a 32 bit Windows Lazarus using a 64 bit Linux system. I generally checkout FPC based on the SVN Revision eg 33333 in this case.

The steps as I understand it are as follows.

I start of with a bootstrap FPC which is capable of building FPC Rev 33333

1. I checkout the source code of FPC rev 33333

2. I can't run a 32 bit Windows FPC on Linux, so I compile a 32bit Linux version of rev 33333 and also generate a cross compiler for Win32. As far as I understand I can even build a 64 bit Linux version and still create a cross compiler for Win32.

3. I use the cross compiler to build a Win32 version of Lazarus (I assume it is possible to generate or copy the related toolchain and package it with that Lazarus)

4. I now create a Win32 version of FPC at the same rev 33333, and I am also able to package whatever other utilities are necessary to go with it.

5. I create a top level directory, put FPC in the directory, as well as Lazarus. Of course I could have installed FPC within the Lazarus sub directory, have fpc and lazarus at the base of the installation directory. I assume that I am able to configure the fpc.cfg appropriately. I now zip it up, transfer it to the Windows system and install, making whatever adjustments, eg fpc.cfg, --pcp etc..


Are the steps I have described here basically correct?
Windows - Lazarus 1.0.8/FPC 2.6.0
Linux - Lazarus 1.4.4 /FPC 2.6.4

Leledumbo

  • Hero Member
  • *****
  • Posts: 7504
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Understanding cross compiling of Lazarus
« Reply #1 on: July 17, 2016, 07:13:04 am »
2. I can't run a 32 bit Windows FPC on Linux, so I compile a 32bit Linux version of rev 33333 and also generate a cross compiler for Win32.
Not needed
As far as I understand I can even build a 64 bit Linux version and still create a cross compiler for Win32.
Yes
Are the steps I have described here basically correct?
Other than the above, I think so. Assuming you know how to do step 4 correctly (cross compiling a native compiler).

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus