[lazarus] How-to 0.5

Sergio A. Kessler sak at perio.unlp.edu.ar
Sun May 16 18:14:20 EDT 1999


changes from previous release:

- corrected actions for compiling a new compiler
  (noted in the hard way by Cliff :)
- make it clear to use a release version of the
  compiler to compile a new one.


Lazarus-developer-HowTo-0.5


Thanks (for comments, suggestions, corrections):

* Michael Anthon
* Marco van de Voort
* Michael -ubiquitous- Van Canneyt


Linux instructions:

Well, this is how I configured my system, this approach is intended for 
developers and those that want to stay up to date with the code in the 
FPC's CVS.

You will need the cvs program installed, type "cvs --help" to see if it's
installed, if not try to install it from a .rpm, .deb or .pkg (up to you :)

Also, if you have the mc (Midnight commander), a clone of the Norton 
Commander, it will make very easy the tasks of copying and moving files,
type "mc" and see if you have it installed (it come with most distros).

This text assume that you are running the bash shell, if you don't know
what the hell is this, don't worry  :)


One time actions (First day only):
----------------

Make a directory called /opt (if you don't have it, of course).
The /opt is always used by self contained apps that doesn't come in
packages, so it's easy to administer it in a isolated directory.

Enter to the /opt directory and create one inside called "fpc", enter to
the fpc directory.

Connect to the internet (up to you :) (if you are using RedHat, try 
LinuxConf or Gnome-PPP).

Now (inside /opt/fpc ) you have to type the following on the command line:

$ export CVSROOT=':pserver:cvs at tflily.fys.kuleuven.ac.be:/usr/local/CVS'

$ cvs login

You will be prompted for a password:

(Logging in to cvs at tflily.fys.kuleuven.ac.be)
CVS password:

The password is 'cvs' (don't type the quotes).

This step needs to be performed only once.
Your CVS client will remember the password.

Now you need to checkout (download) the modules:

cvs -z3 checkout <module1> <module2>

example:

$ cvs -z3 checkout base compiler rtl fcl docs gtk lazarus

The list of available modules (courtesy of MVC) are:

base         api           fcl           docs          lazarus
gtk          rtl           compiler      gdbpas        ide   
utils

This will download the current cvs source code (the bleeding edge) to 
your computer and create a directory structure.
ok, this will be a big download, BUT you have to do this only _one_ time,
the first time.
The -z3 parameter means compression for saving bandwidht.
if you are not interested in docs, for example, do not checkout it.

you will end up with this tree:

/opt
   /fpc
       /CVS        (internal cvs use, do not touch)
       /base
       /compiler
       /gtk
       /lazarus
       /rtl
       ...

Now make a directory /opt/fpc/units/linux in where we'll put the 
compiled units.

But the first time we need a binary compiler, because we have all the 
source but we don't have a compiler, so download a _release_ (not
snapshot) for linux from:
ftp://tflily.fys.kuleuven.ac.be/pub/fpc/dist/Linux/libs.tar.gz
and put the compiler binary in /opt/fpc and forget the units.

Now edit your ~/.bash_profile to include /opt/fpc in your path and
declare environment variable FPCDIR=/opt/fpc and export it.
Logout and login again so this take effect.


Repeated actions (every day or so):
----------------

1) Copy the content of /opt/fpc/base to /opt/fpc, but *don't* delete
   the base directory.

2) Is a good idea to recompile the compiler every time you update your
   sources. For this do:

       $ rm -f /opt/fpc/units/linux/*
       $ cd /opt/fpc/compiler
       $ make cycle                                           [1]
       $ cd ../rtl/linux
       $ mv -f *.o /opt/fpc/units/linux/
       $ mv -f *.ppu /opt/fpc/units/linux/
       $ cd /opt/fpc
       $ mv -f ppc386 ppc386.release
       $ cp compiler/ppc386 .

3) The next time you want to update your source code from the fpc
   repository, just sit inside the /opt/fpc directory and do:

cvs -z3 update -dP <module1> <module2> ... <moduleN>

   this will download _only_ what is changed in the central repository
   and your sources get updated (the -dP means create any new directory
   that appears in the repository and prune any empty directory).

4) Go to 1)

____________________________________________________________________


Reasons for use CVS:

- *MUCH* more bandwidth friendly than download .zip or .gz every day.
- Easy, very, very easy to use once you checkout the modules.
- You will stay in the bleeding edge state of the source.


What I do is update the cvs in the work (we have a dedicated line to 
the Internet), but because I can't investigate further in the work, 
I gzipped all the tree and take it to my house.
For compress the whole tree, I do:

tar -czvf fpc.tar.gz /opt/fpc

____________________________________________________________________


[1] "make cycle" (in /opt/fpc/compiler directory) compiles the
    rtl-compiler until the two last compiled compilers are the same.
    This is normally three times, one recompile is necessary for all
    changes to take effect in the binary, and an extra one to make 
    the comparision possible.
    This is the standard procedure for building snapshots.
    Be sure to use a release version of the compiler to do this.
____________________________________________________________________


Here are a few scripts that could help you in this process,
place the files in /opt/fpc and don't forget to make it executables.

script cvs_init:

#!/bin/bash
CVSROOT=':pserver:cvs at tflily.fys.kuleuven.ac.be:/usr/local/CVS'
cvs login
cvs -z3 -d ${CVSROOT} checkout base api fcl docs gtk lazarus rtl compiler 
gdbpas ide utils


script cvs_update:

#!/bin/bash
cvs -z3 update -dP base api fcl docs lazarus gtk rtl compiler gdbpas ide 
utils
____________________________________________________________________


FAQs
----

1.Q - I need a /etc/ppc386.cfg if I use cvs like the above schema ?

1.A - No. You don't need this file at all, the makefiles do all the work.

---

2.Q - How I compile lazarus ?

2.A - Do something like this:

         $ cd /opt/fpc/fcl
         $ make
         $ cd ../gtk
         $ make
         $ cd ../lazarus
         $ make

---


Sergio
(updating cvs rigth now, yes, I'm in the office :)






More information about the Lazarus mailing list