[fpc-devel] One fpc.cfg per fpc version

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Feb 18 01:56:40 CET 2014


On Mon, 17 Feb 2014 17:09:17 +0200
patspiper <patspiper at gmail.com> wrote:

> On 17/02/14 16:45, Mattias Gaertner wrote:
> > On Mon, 17 Feb 2014 15:10:03 +0100 (CET)
> > Michael Van Canneyt <michael at freepascal.org> wrote:
> >
> >> On Mon, 17 Feb 2014, Mattias Gaertner wrote:
> >> [...]
> >>> Is there already a doc about how to install multiple versions of fpc?
> >> No, because
> >> a) There are so many ways to do it
> >> b) There are so many platforms.
> >> I prefer to document the possibilities and let the user figure out for himself what works best.
> > That's definitely a good thing.
> >
> > The next step would be to create an example. I guess a common setup is
> > the latest release and trunk.
> >
> > Let's say I start such a page.
> >
> > Then I would explain the two common setups
> >
> > The clean approach:
> > 1.1. read Michael's docs
> > 1.2. install the latest released compiler
> > 1.3. download the trunk sources, compile it
> > 1.4. "make install INSTALL_PREFIX=~/fpc/2.7.1"
> > 1.5. setup a fpc.cfg (~/fpc/2.7.1/lib/etc/fpc.cfg), add
> > -FD~/fpc/2.7.1/bin and adapt the -Fu lines.
> >
> > Then you can select the 2.6.2 via /usr/bin/fpc or the 2.7.1 via
> > ~/fpc/2.7.1/lib/2.7.1/ppcx86.
> 
> Calling ppcxxx directly breaks easy cross compilation using build modes.

Let's see:

When the user selects a different target OS the compiler can be
kept (or see below).

When the user selects a different compiler (e.g. ppc386), the IDE
could find out the target CPU. So if the target CPU setting is
"default", the IDE could automatically use i386.

When the user selects a different CPU, the IDE could select the last
used compiler for this CPU.

So in many (most?) cases it is enough to change one option.

And last but not least: If you use build modes it does not matter much
how many options you have to setup. The point of build modes is that you
do that only once.

 
> Better provide for every fpc version the path to fpc and the path to the 
> corresponding ppc(s) so that Lazarus can call:
> <pathtofpc>fpc -Xp<pathtoppc>

That's two parameters.

Keep in mind that "fpc" is only a frontend to help selecting the right
compiler (i.e. saving some typing and searching). An IDE is a frontend
too.
If you pass -Xp then the only thing that fpc does is the mapping from
OS/CPU to ppcxxx.


> or even:
> <pathtofpc>fpc -Xp<pathtoppc> -FD<pathtotools>

See the the various mails of this thread: -FD is only needed if your
fpc.cfg is incomplete.

Mattias



More information about the fpc-devel mailing list