[fpc-pascal] How to ? Using two compiler versions.

Henry Vermaak henry.vermaak at gmail.com
Wed Feb 8 12:53:52 CET 2012


On 08/02/12 11:24, Koenraad Lelong wrote:
> Hi,
>
> I'm searching for some document how to set up a system to use two
> versions of fpc.
> I'm trying to make a working arm-embedded compiler. With 2.6.0 I seem
> unable to do that, so I want to try it with the svn-version of fpc. But
> when I just install that, I lose the 2.6.0 version. What have I to do to
> be able to use the two versions in parallel ?

How do you install it?  I use 2.6.0 and trunk, so it's definitely 
possible.  I install to /usr/local on linux (but I have a similar setup 
on Windows), then I end up with the different versions like this:

/usr/local/lib/fpc/2.6.0
/usr/local/lib/fpc/2.7.1

Make sure you set up fpc.cfg to look at the right directories, e.g.

-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget
-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/*
-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/rtl

Then you can just call the compiler directly, like:

/usr/local/lib/fpc/2.7.1/ppcrossarm

You can also set up symlinks/copies with a version suffix:

hcv at technical09:~$ ls -l /usr/local/bin/ppcrossarm*
lrwxrwxrwx 1 root root 35 Feb  8 11:48 /usr/local/bin/ppcrossarm-2.7.1 
-> /usr/local/lib/fpc/2.7.1/ppcrossarm

Then use it like this:

hcv at technical09:~$ fpc -Parm -V2.7.1
Free Pascal Compiler version 2.7.1 [2011/09/27] for arm
Copyright (c) 1993-2011 by Florian Klaempfl and others
/usr/local/lib/fpc/2.7.1/ppcrossarm [options] <inputfile> [options]
...
...

So you can use different versions by just changing the -V parameter.

Henry



More information about the fpc-pascal mailing list