Forum > FPC development

cross platform build pkg?

(1/3) > >>

lazer:
Hi,

one of the significant interests of fpc/lazarus is ability to code once , build everywhere: ie cross-complilation for different platforms.  However, this does not seem to be available in prebuilt packages.

Digging out the appropriate sources files, configuring and shoe-horning into existing distro is quite complex and undesirable from the point of view of having to maintain an out of tree package.

An alternative pkg with the cross-compilers built , would be a nice option.

Since this would not have more dependency issues than a std build, it would likely get adopted by distros too.

Cross-platform development seems to be a great feature of fpc/laz but probably does not get fully explained due to the difficulty of setting it up.


Any chance of that being possible?

thx

JuhaManninen:

--- Quote from: lazer on October 05, 2017, 03:54:30 pm ---one of the significant interests of fpc/lazarus is ability to code once , build everywhere: ie cross-compilation for different platforms. 
--- End quote ---
The slogan is actually "Write Once, Compile Anywhere".
No, it is not the same as cross-compilation. For example I compile programs + Lazarus IDE on different OS but I don't use cross-compilation.
On a desktop system it is often easier to install the native version of compiler (+ Lazarus) and use it.
Sometimes cross-compilation is important, for example with embedded targets. There happens to be now another thread for the same question:
 http://forum.lazarus.freepascal.org/index.php/topic,38504
At least 2 solutions, CodeTyphon and Fpcupdeluxe were given.

avra:

--- Quote from: lazer on October 05, 2017, 03:54:30 pm ---Any chance of that being possible?
--- End quote ---
It is already possible. I use fpcupdeluxe to download several Lazarus/FPC combos (trunk/stable) on the same pc, and everything needed to cross compile from one of them (Win32) to Win64/Lin32/Lin64 at a click of a button.

Leledumbo:
fpcupdeluxe is the best way to go, since providing precompiled package will probably be a waste of resource. FPC supports over 20 combinations of host->target pair, so we need at least some pairs that people really use. Some people that really cross compile, target exotic platforms such as embedded (that requires precise configuration options when building the toolchain), amiga compatible OS, etc. Some distros like archlinux provide them in its user repository, but that's easier since the host is specific, hence only target platform needs to be the concern. You see, it's not that simple to solve and let people learn how to build one (manually or using helper like fpcupdeluxe) is the better choice.

balazsszekely:
I never understood the hype around cross-compiling. Like it or not, releasing a program slightly complex then a "Hello world" application requires OS specific tweaks, sometimes even debugging to find widgetset specific bugs. Whenever is possible installing Lazarus/FPC is a must in my opinion.  Ok, there are specific cases when this is not possible as @Juha mentioned above and cross-compiling come in handy. As a conclusion cross-compiling is useful but overrated feature or am I mistaken?

Ps: Nowadays installing different distros it's quite trivial because of Virtual Machines.

Navigation

[0] Message Index

[#] Next page

Go to full version