Recent

Author Topic: Installing Lazarus on Linux to compile in linux, win32 and macOS  (Read 25110 times)

plakkies

  • New Member
  • *
  • Posts: 16
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #15 on: October 11, 2012, 03:47:38 pm »
Ok so the problem seems to be that I dont have the relevant i386-win32 then for FPC. Once I have that I can make sure the path is correct for that.

So the question is where do I get this i386-win32, is it the same one as Lazarus or do I build it somehow?

Thanks again for all the help.

btw when I finally get this working does anyone know where I can put this kubuntu snapshot so that others can benefit?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #16 on: October 11, 2012, 05:00:28 pm »
Quote
So the question is where do I get this i386-win32, is it the same one as Lazarus or do I build it somehow?
No, you should've built it, you did follow the wiki, right? That doing make OS_TARGET=win32 blablabla in a directory containing FPC sources...

plakkies

  • New Member
  • *
  • Posts: 16
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #17 on: October 22, 2012, 09:28:40 am »
I think I might be loosing it. How do I miss out a whole section. I missed the "Cross build FPC" section in my run through. I might be doing too many things at once.

OK so new problem. When I do this section it looks like it cant find the source. I downloaded the source from http://sourceforge.net/projects/freepascal/files/Source/2.6.0/ as per the instructions. Did I get it from the right place? I was a bit confused when looking for it. I also had to change the location in the setup file of the source to include the version as that how it unzipped.

Oh and its been hectic here had to take a trip to Swaziland on business. I need to convince management to get another programmer I think.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #18 on: October 22, 2012, 01:15:26 pm »
OK, hang in there, I'm tidying up my automatic cross build script so it can be used by everybody.

plakkies

  • New Member
  • *
  • Posts: 16
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #19 on: October 23, 2012, 03:35:39 pm »
Awesome, Thanks I'll be patient.    8-)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #20 on: October 23, 2012, 07:05:49 pm »
Not thoroughly tested, but seems working fine. The script must be placed in the same place as fpc source folder. e.g. if you put it in ~/Sources/build-fpc-cross-all.sh then there should also be ~/Sources/fpc containing the full fpc source (directories: compiler, rtl, packages, utils, etc.). Feel free to modify the script according to your needs (bash >4.0 skill required). The script also assumes everything from fpc.cfg (e.g. the cross assembler and linker depends on whatever settings set in fpc.cfg).

plakkies

  • New Member
  • *
  • Posts: 16
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #21 on: October 24, 2012, 12:15:46 pm »
Did I screw something up?

kubuntu@kubuntu-VirtualBox:~/sources/fpc/fpc-2.6.0$ sh ./build-fpc-cross-all.sh
./build-fpc-cross-all.sh: 11: ./build-fpc-cross-all.sh: Syntax error: "(" unexpected
kubuntu@kubuntu-VirtualBox:~/sources/fpc/fpc-2.6.0$


Am I in the right place?

kubuntu@kubuntu-VirtualBox:~/sources/fpc/fpc-2.6.0$ ls
build-fpc-cross-all.sh  compiler   ide        Makefile      packages  tests
build-stamp.i386-win32  fpc-2.6.0  installer  Makefile.fpc  rtl       utils
kubuntu@kubuntu-VirtualBox:~/sources/fpc/fpc-2.6.0$

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #22 on: October 24, 2012, 03:07:37 pm »
Quote
Did I screw something up?
Hmm... your bash version? Try breaking down the associative array initialization, change:
Code: [Select]
declare -A targets=(
  [i386-linux]="$nativeopt"
  [i386-win32]="$crossopt"
  [x86_64-win64]="$crossopt"
  [arm-linux]="CROSSOPT='$stdopt -dFPC_ARMEL'"
  [jvm-java]="$crossopt ALLOW_WARNINGS=1"
  [jvm-android]="$crossopt ALLOW_WARNINGS=1"
)
to:
Code: [Select]
declare -A targets
targets=(
  [i386-linux]="$nativeopt"
  [i386-win32]="$crossopt"
  [x86_64-win64]="$crossopt"
  [arm-linux]="CROSSOPT='$stdopt -dFPC_ARMEL'"
  [jvm-java]="$crossopt ALLOW_WARNINGS=1"
  [jvm-android]="$crossopt ALLOW_WARNINGS=1"
)
or:
Code: [Select]
declare -A targets
targets[i386-linux]="$nativeopt"
targets[i386-win32]="$crossopt"
targets[x86_64-win64]="$crossopt"
targets[arm-linux]="CROSSOPT='$stdopt -dFPC_ARMEL'"
targets[jvm-java]="$crossopt ALLOW_WARNINGS=1"
targets[jvm-android]="$crossopt ALLOW_WARNINGS=1"
Quote
Am I in the right place?
No, go 1 directory above.

plakkies

  • New Member
  • *
  • Posts: 16
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #23 on: October 24, 2012, 04:08:17 pm »
Regarding bash version
kubuntu@kubuntu-VirtualBox:~/sources/fpc/fpc-2.6.0$ bash -version
bash -version
GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
kubuntu@kubuntu-VirtualBox:~/sources/fpc/fpc-2.6.0$


here are the results of the two changes.

kubuntu@kubuntu-VirtualBox:~/sources/fpc/fpc-2.6.0$ sh ./build-fpc-cross-allA.sh
./build-fpc-cross-allA.sh: 11: ./build-fpc-cross-allA.sh: declare: not found
./build-fpc-cross-allA.sh: 12: ./build-fpc-cross-allA.sh: Syntax error: "(" unexpected
kubuntu@kubuntu-VirtualBox:~/sources/fpc/fpc-2.6.0$ sh ./build-fpc-cross-allB.sh
./build-fpc-cross-allB.sh: 11: ./build-fpc-cross-allB.sh: declare: not found
./build-fpc-cross-allB.sh: 12: ./build-fpc-cross-allB.sh: targets[i386-linux]=OPT=$stdopt: not found
./build-fpc-cross-allB.sh: 13: ./build-fpc-cross-allB.sh: targets[i386-win32]=CROSSOPT=$stdopt: not found
./build-fpc-cross-allB.sh: 14: ./build-fpc-cross-allB.sh: targets[x86_64-win64]=CROSSOPT=$stdopt: not found
./build-fpc-cross-allB.sh: 15: ./build-fpc-cross-allB.sh: targets[arm-linux]=CROSSOPT='-g- -CX -XXs -O3 -dFPC_ARMEL': not found
./build-fpc-cross-allB.sh: 16: ./build-fpc-cross-allB.sh: targets[jvm-java]=CROSSOPT=$stdopt ALLOW_WARNINGS=1: not found
./build-fpc-cross-allB.sh: 17: ./build-fpc-cross-allB.sh: targets[jvm-android]=CROSSOPT=$stdopt ALLOW_WARNINGS=1: not found
./build-fpc-cross-allB.sh: 20: cd: can't cd to fpc
./build-fpc-cross-allB.sh: 22: ./build-fpc-cross-allB.sh: Bad substitution
kubuntu@kubuntu-VirtualBox:~/sources/fpc/fpc-2.6.0$

There is only one folder in ~/sources/fpc  Should I move everything from fpc-2.6.0 there and run from there instead?

Thanks again for all the help

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12599
  • FPC developer.
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #24 on: October 24, 2012, 09:13:03 pm »
So the end conclusion is that "sh" apparantly isn't "bash".

So try

bash ./thescript.sh

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #25 on: October 24, 2012, 10:04:43 pm »
Or just
Code: [Select]
chmod u+x ./build-fpc-cross-allA.sh once and subsequently
Code: [Select]
./build-fpc-cross-allA.sh
Edit: 25 Oct: oops typo: chmod u+x /build... => chmod u+x ./build, formatting
« Last Edit: October 25, 2012, 10:43:40 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

plakkies

  • New Member
  • *
  • Posts: 16
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #26 on: October 25, 2012, 09:55:52 am »
Just goes to show how much experience I have. I guess Im learning plenty which is good.

Bash/sh, same thing to me apparently. I was able to run the script. It showed way too much stuff to keep track of and took a while, I did not notice any errors. I now have the i386-win32 folder in the right place I think with the rtl files in the right directory.

But Im still stuck at this stage

The next step shows to go to the Lazarus directory(i dont know where this is) or to do a few things in the IDE. When I do those things in the IDE I get the following error.

The project uses target OS=win32 and CPU=i386.
The system.ppu for this target was not found in the FPC binary directories.
Make sure fpc is installed correctly for this target and the fpc.cfg contains the right directories.

I did some checking and double checking, to make sure nothing was misspelled. In the process and by mistake I see that Lazarus is using FPC version 2.4 instead of 2.6 which is where all the files are. I think the solution would be to get Lazarus to use FPV V2.6. Im not sure how to do this. I thought 2.6 was installed.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #27 on: October 25, 2012, 05:28:39 pm »
Quote
I did some checking and double checking, to make sure nothing was misspelled. In the process and by mistake I see that Lazarus is using FPC version 2.4 instead of 2.6 which is where all the files are. I think the solution would be to get Lazarus to use FPV V2.6. Im not sure how to do this. I thought 2.6 was installed.
Check your symlinks, make sure they point to the correct version of ppcXXX.

Dibo

  • Hero Member
  • *****
  • Posts: 1057
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #28 on: October 25, 2012, 05:53:34 pm »
Nobody mentioned about Code Typhon in this topic. I'm using it from a couple months and I'm just impressed with build-in cross-compiling support. Those boys did realy good work. Configuration is so easy. Too bad that Lazarus don't provide such version (I mean, installator with cross-compile support, big IDE from CT is not important for me). I tried configure normal lazarus to cross-compile couple of times referring to wiki page, but I always fail. Wiki content about cross-compile is illegible (too much sublinks to other articles). Since I meet Code Typhon, Lazarus is really cross-compile environment for me, previously I used virtualbox for each OS

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Installing Lazarus on Linux to compile in linux, win32 and macOS
« Reply #29 on: October 25, 2012, 07:33:58 pm »
Hold on, I think I make some mistakes regarding the quotes. Anybody with Bash skill could help to fix?

 

TinyPortal © 2005-2018