[fpc-pascal] How to compile Lazarus program using only FPC?

waldo kitty wkitty42 at windstream.net
Thu Sep 24 17:01:41 CEST 2015


On 09/24/2015 09:48 AM, Bo Berglund wrote:
> I want to check my options regarding Lazarus and FPC.
>
> If I develop a program on Windows Lazarus, move it to Debian Lazarus
> (x86) and then finally want to compile on ARM on for example Raspberry
> Pi but outside of Lazarus, how is that done?

the lpr file contains the initial pascal code for the project...

> Does FPC recognize the Lazarus project file such that paths etc are
> observed?

do you mean those in the lpi xml file? not as far as i know... it is extraneous 
outside of lazarus...

> Or is thare a separate file for FPC I have to prepare in order to set
> the unit paths?

i specify them on the command line or add them to the "local to the project" 
fpc.cfg file...

i have a few projects that i copy from winwhatever and *nix lazarus to OS/2 for 
compiling in that environment so i'm familiar with the situation because lazarus 
is not available for OS/2... i copy the lpr and any other code files... then 
possibly adjust a local fpc.cfg unless the system-wide one works for this 
project, and finally compile...

fpc -B myproject.lpr


i actually have a script that i build with so as to get a log if/when i need it...

===== 4OS2 cmd script =====

@echo off
if exist *.o   del /q *.o
if exist *.ppu del /q *.ppu
set fpcopts=-vehinw -B -CF64 -Fulibs\neededlib -omyprojectp.exe
iff '%1' eq '' .or. %@lower['%1'] eq 'debug' then
   set fpcopts=%fpcopts -ghl -dDEBUG
else
   set fpcopts=%fpcopts -dRELEASE
endiff
rem echo compiling command line to log file... '^' is escape in 4OS2 for literal 
chars
echo fpc %fpcopts myproject.lpr ^|^& tee /a builditp.log | tee builditp.log
echo. | tee /a builditp.log
echo on
rem execute compiling command line
fpc %fpcopts myproject.lpr |& tee /a builditp.log
@unset fpcopts

===== /4OS2 cmd script =====

-- 
  NOTE: No off-list assistance is given without prior approval.
        *Please keep mailing list traffic on the list* unless
        private contact is specifically requested and granted.



More information about the fpc-pascal mailing list