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

Koenraad Lelong fpascal at brouwerij.homelinux.net
Wed Feb 8 13:58:47 CET 2012


On 08-02-12 12:53, Henry Vermaak wrote:
> 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

On my 64-bit OpenSuse I installed it from the rpm, so it went into 
/usr/lib64/fpc/...

> 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

My fpc.cfg was similar, all pointing to /usr/lib64/fpc/...
And that will be a problem. When I installed ppcrossarm (2.6.0 version), 
I used PREFIX=/usr, so all went into /usr/lib/fpc/...
Is there  way to select those paths depending on the version ? Like
#if $fpcversion=2.7.1
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget
...
#else
-Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget
...
#end

>
> 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
> So you can use different versions by just changing the -V parameter.

That's new to me, interesting.

So how should I make the crosscompiler ? -V seems not to work with the 
make-command.
If I "make clean build install" svn-trunk I will overwrite 2.6.0. So I 
should "make clean build", then rename/link /usr/bin/ppcx64 to something 
e.g. ppcx64-2.6.0, then "make install" and rename/link ppcx64 to 
ppcx64-2.7.1.
Then to make the crosscompiler how do I specify to use ppcx64-2.7.1 ?

I'll try some things. I use a virtual machine so it would be no big pain 
if things go wrong.

Thanks for the info,

Koenraad.



More information about the fpc-pascal mailing list