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

Tomas Hajny XHajT03 at hajny.biz
Mon Feb 17 17:26:14 CET 2014


On Mon, February 17, 2014 16:53, Michael Van Canneyt wrote:
> On Mon, 17 Feb 2014, patspiper wrote:
>> On 17/02/14 17:13, Michael Van Canneyt wrote:
>>> On Mon, 17 Feb 2014, patspiper 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.
>>>
>>> Not if the IDE is aware of this.
>>
>> Yes, but that would mean extra coding in the IDE just to duplicate fpc
>> functionality. It will probably add as well the burden of maintenance
>> whenever new targets are added to fpc.
>
> I agree that the best option would be to use the -V and -P options of fpc.
>
> But, for this, it would be best if fpc can list the available versions and
> architectures/cross-compilers.

Assuming that list of supported FPC installations should be configurable
by the user in Lazarus settings, listing of versions wouldn't be necessary
(it would be incomplete anyway in many cases). I see no use for -V in this
use case either (due to differences between global and local installations
and also installations in non-standard places). I believe that -Xp should
cover everything needed (at least as long as that parameter is supported
by the installed FPC version; if not, invoking fpc with a modified PATH
would be my suggested solution).

Tomas





More information about the fpc-devel mailing list