[Lazarus] Building GUI program for RPi1 on RPi2?

Mehmet Erol Sanliturk m.e.sanliturk at gmail.com
Sun Jan 17 07:25:21 CET 2016


On Sat, Jan 16, 2016 at 2:35 PM, Bo Berglund <bo.berglund at gmail.com> wrote:

> On Sat, 16 Jan 2016 12:17:59 -0800, Mehmet Erol Sanliturk
> <m.e.sanliturk at gmail.com> wrote:
>
> >> So I have installed the seed fpc compiler 2.6.4 on the Pi1B now and am
> >> checking out the sources for Lazarus 1.4.4 now.
> >>
> >> Will build lazarus 1.4.4 using the seed compiler and then build the
> >> program itself. It is just one form with an edit area to write text.
> >> Hopefully this will work without fpc 3.0.0
> >>
> >> (Provided I can build Lazarus 1.4.4 of course, since I don't know how
> >> to build a GUI application using just fpc.)
> >
> >In your compilation directory , in fpc.cfg , include all necessary LCL
> unit
> >and related include directories .
> >If you compile  a  *.lpr with fpc , it will produce a GUI  program .
> >
> >
>
> Thanks for your suggestion.
> Meanwhile I have tried to build Lazarus 1.4.4 using the seed compiler
> 2.6.4 but it always quits with a link error.
> I also tried to repeat the method I used on the RPi2 to compile fpc
> 3.0.0 but the same thing happens after about 7 minutes.
>
> So I would like to compile my program without lazarus as you suggest
> can be done.
>
> But you say that I should edit the fpc.conf file in the compilation
> directory, I assume you mean my project directory, right?
>
> The problem is that there is no such file in my project dir on the
> RPi2 and I also do not know what to put into the file if I create one
> from scratch...
>
> Could you give an example on how such a file would look?
> This is probably my last chance of getting this done.....
>
> (I have never compiled anything manually from the command line)
>
>
> --
> Bo Berglund
> Developer in Sweden
>
>
> --
> _______________________________________________
>






The following is a sample fpc.cfg to compile a GUI program with fpc ( used
in Windows ) :





-------------------------------------------------------------------




#
# Config file generated by fpcmkcfg on 12/5/2009 - 0:37:50
# Example fpc.cfg for Free Pascal Compiler
#

# ----------------------
# Defines (preprocessor)
# ----------------------

#
# nested #IFNDEF, #IFDEF, #ENDIF, #ELSE, #DEFINE, #UNDEF are allowed
#
# -d is the same as #DEFINE
# -u is the same as #UNDEF
#

#
# Some examples (for switches see below, and the -? helppages)
#
# Try compiling with the -dRELEASE or -dDEBUG on the commandline
#

 -dNORMAL
 -uDEBUG
 -uRELEASE

 -dDELPHI
; -dVER130
; -dVER2_2

# For a release compile with optimizes and strip debuginfo
#IFDEF RELEASE
  -O2
  -Xs
  #WRITE Compiling Release Version
#ENDIF

# For a debug version compile with debuginfo and all codegeneration checks
on
#IFDEF DEBUG
  -glh
  -Crtoi
  #WRITE Compiling Debug Version
#ENDIF

# ----------------
# Parsing switches
# ----------------

# Pascal language mode
#      -Mfpc      free pascal dialect (default)
#      -Mobjfpc   switch some Delphi 2 extensions on
#      -Mdelphi   tries to be Delphi compatible
#      -Mtp       tries to be TP/BP 7.0 compatible
#      -Mgpc      tries to be gpc compatible
#      -Mmacpas   tries to be compatible to the macintosh pascal dialects
#
# Turn on Object Pascal extensions by default
#-Mobjfpc

# Assembler reader mode
#      -Rdefault  use default assembler
#      -Ratt      read AT&T style assembler
#      -Rintel    read Intel style assembler
#
# All assembler blocks are AT&T styled by default
#-Ratt

# Semantic checking
#      -S2        same as -Mobjfpc
#      -Sc        supports operators like C (*=,+=,/= and -=)
#      -Sa        include assertion code.
#      -Sd        same as -Mdelphi
#      -Se<x>     compiler stops after the <x> errors (default is 1)
#      -Sg        allow LABEL and GOTO
#      -Sh        Use ansistrings
#      -Si        support C++ styled INLINE
#      -SI<x>     set interface style to <x>
#         -SIcomCOM compatible interface (default)
#         -SIcorbaCORBA compatible interface
#      -Sm        support macros like C (global)
#      -So        same as -Mtp
#      -Sp        same as -Mgpc
#      -Ss        constructor name must be init (destructor must be done)
#      -St        allow static keyword in objects
#
# Allow goto, inline, C-operators, C-vars
-Sgic

# ---------------
# Code generation
# ---------------

# Uncomment the next line if you always want static/dynamic units by
default
# (can be overruled with -CD, -CS at the commandline)
#-CS
#-CD

# Set the default heapsize to 8Mb
#-Ch8000000

# Set default codegeneration checks (iocheck, overflow, range, stack)
#-Ci
#-Co
#-Cr
#-Ct

# Optimizer switches for i386 compiler
# -Os        generate smaller code
# -O1        level 1 optimizations (quick optimizations)
# -O2        level 2 optimizations (-O1 + slower optimizations)
# -O3        level 3 optimizations (same as -O2u)
# -Oa=N      set alignment to N
# -OoX       switch on optimalization X.
# -OoNOX     switch off optimalization X.
#               X is one of REGVAR UNCERTAIN STACKFRAME PEEPHOLE ASMCSE
LOOPUNROLL
# -OpCPU     set target processor.
#             CPU is one of 386, PENTIUM, PENTIUM2, PENTIUM3, PENTIUM4,
PENTIUMM

# -----------------------
# Set Filenames and Paths
# -----------------------

# Both slashes and backslashes are allowed in paths

# path to the messagefile, not necessary anymore but can be used to
override
# the default language
#-FrC:/lazarus/fpc/2.6.2/msg/errore.msg
#-FrC:/lazarus/fpc/2.6.2/msg/errorn.msg
#-FrC:/lazarus/fpc/2.6.2/msg/errores.msg
#-FrC:/lazarus/fpc/2.6.2/msg/errord.msg
#-FrC:/lazarus/fpc/2.6.2/msg/errorr.msg

# path to the gcclib

# searchpath for includefiles
#-Fi/pp/inc;/pp/rtl/inc

# searchpath for includefiles
# release them only if you know what you do
# because this could cause a rebuild of the runtime library
# if you tell them compiler/ide to build the project (FK)
#-FiC:/lazarus/fpc/2.6.2/source/rtl/inc;C:/lazarus/fpc/2.6.2/source/rtl/i386


# searchpath for objectfiles
#-FoC:/lazarus/fpc/2.6.2/source/rtl/inc;C:/lazarus/fpc/2.6.2/source/rtl/i386






# Instead of  Lazarus Windows directories , use your operating system
Lazarus directories .....
# For example :
#  -Fu/usr/lib64/lazarus/lcl/units/x86_64-linux/





#IFDEF FPCAPACHE_1_13
-FuC:/lazarus/fpc/2.6.2/units/$FPCTARGET/httpd-1.3/
#ELSE
#IFDEF FPCAPACHE_2_0
-FuC:/lazarus/fpc/2.6.2/units/$FPCTARGET/httpd-2.0
#ELSE
-FuC:/lazarus/fpc/2.6.2/units/$FPCTARGET/httpd-2.2
#ENDIF
#ENDIF

# searchpath for units and other system dependent things

-FuC:/lazarus/fpc/2.6.2/units/$FPCTARGET/
-FuC:/lazarus/fpc/2.6.2/units/$FPCTARGET/*
-FuC:/lazarus/fpc/2.6.2/units/$FPCTARGET/rtl

 -dLCL

 -dWin32
 -FuC:\LAZARUS\components\lazutils\lib\i386-win32\
 -FuC:\LAZARUS\lcl\units\i386-win32\win32\
 -FuC:\LAZARUS\lcl\units\i386-win32\

# searchpath for libraries

#-Fl/lib;/usr/lib

# searchpath for tools
-FDC:/lazarus/fpc/2.6.2/bin/$FPCTARGET

# binutils prefix for cross compiling
#IFDEF FPC_CROSSCOMPILING
  -XP$FPCTARGET-
#ENDIF










# -------------
# Linking
# -------------

# generate always debugging information for GDB (slows down the compiling
# process)
#      -gc        generate checks for pointers
#      -gd        use dbx
#      -gg        use gsym
#      -gh        use heap trace unit (for memory leak debugging)
#      -gl        use line_ info unit_ to_ show_ more info for_ backtraces
#      -gv        generates programs tracable with valgrind
#      -gw        generate dwarf debugging info
#
# Enable debuginfo and use the line info unit by default
#-gl

# always pass an option to the linker
#-k-s

# Always strip debuginfo from the executable

-Xs

# -------------
# Miscellaneous
# -------------

# Write always a nice FPC logo ;)

-l

# Verbosity
#      e : Show_ errors_ (default)       d : Show_ debug_ info
#      w : Show_ warnings_               u : Show_ unit_ info
#      n : Show_ notes                  t : Show_ tried/used files_
#      h : Show_ hints                  m : Show_ defined_ macros
#      i : Show_ general info           p : Show_ compiled_ procedures_
#      l : Show_ line_ numbers_            c : Show_ conditionals_
#      a : Show_ everything             0 : Show_ nothing ( except errors_
)
#      b : Show_ all procedures_          r : Rhide/GCC compatibility mode_
#          declarations if an error    x : Executable info (Win32 only)
#          occurs
#
# Display Info, Warnings, Notes and Hints

-viwnqb

# If you don't want so much verbosity use
#-vw

#IFDEF NORMAL

 -TWin32
 -Sg
 -Si
 -Se1048576
# -Mfpc
# -Mobjfpc
 -Mdelphi

 -Ooregvar
 -O1
 -Os
 -OpPENTIUM
 -Rintel
; -dNORMAL
; -dDELPHI
; -dVER130
# -gl

 -g-
 -p-
 -b-

 -uCONSOLE

; -uLIST_INCLUDED_FILES

#ENDIF

#IFDEF DEBUG
 -TWin32
 -Sg
 -Si
 -Sa
 -Se10000
# -Mobjfpc
 -Mdelphi
 -Cr
 -Ci
 -Co
 -CR
 -Os
 -OpPENTIUM
 -Rintel
 -gl
 -p-
 -b-
#ENDIF

#IFDEF RELEASE
 -TWin32
 -Sg
 -Si
# -Mobjfpc
 -Mdelphi
 -CX
 -Ooregvar
 -O2
 -Os
 -OpPENTIUM
 -Rintel
 -XX
 -Xs
 -g-
 -p-
 -b-
#ENDIF












# Here , put your

# -Fi .....

# and

# -Fu .....
# -FU .....


# directories for your program  *.lpr .....


-------------------------------------------------------------------


Copy /etc/fpc.cfg to your compilation directory to start from it .



If you do not use  fpc from Lazarus installation , during compile , it may
attempt to compile Lazarus units . In that case , install Lazarus into your
home directory and , instead of using root installed Lazarus ( system-wide
) directories   , use your local Lazarus directories to allow compilation
of Lazarus units .

OR use fpc from Lazarus installation .



By using trial and error , you will be able to compile your *.lpr .


To write fpc command line compilation parameters , it  may be  sufficient
to use

fpc -help

or

Read

http://www.freepascal.org/docs-html/prog/prog.html
http://www.freepascal.org/docs-html/user/user.html




Mehmet Erol Sanliturk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160116/c6b71956/attachment-0003.html>


More information about the Lazarus mailing list