Forum > Suggestions

Secondary Installation for *nix

(1/3) > >>

Warfley:
One thing I noticed thats a bit of an issue when doing an installation on Linux or other unix systems, is that there seems to be no easy way to perform a secondary installation, as the install.sh script ALWAYS installs a global fpc.cfg.

I did fix this in an MR to the fpc build repo:https://gitlab.com/freepascal.org/fpc/build/-/merge_requests/1
But because it seems like no one looks at this repo, I wanted to post here to make note of it. Basically the fix boils down to two changes. First the FPC is symlinked, but when searching for the fpc.cfg it checks relative to the compiler path. So when the compiler is installed in $PREFIX/lib/fpc/$VERSION and symlinked to $PREFIX/bin, it will not search in $PREFIX/etc but in $PREFIX/lib/fpc/etc
The second problem is that the install script always installs the fpc.cfg to /etc overwriting any other FPC config, usually the one of the native fpc installation (from the package manager) and thereby more often than not breaking something. Instead it should be installed to $PREFIX/etc where, together with the change above, it will be found by the fpc.

So with that change now the install script can be used to do a secondary installation of fpc without breaking the primary installation, and without having to manually install a fpc.cfg

MarkMLl:

--- Quote from: Warfley on December 03, 2024, 01:00:40 pm ---One thing I noticed thats a bit of an issue when doing an installation on Linux or other unix systems, is that there seems to be no easy way to perform a secondary installation, as the install.sh script ALWAYS installs a global fpc.cfg.

--- End quote ---

Except for unices where it doesn't create one at all :-/


--- Quote ---I did fix this in an MR to the fpc build repo: https://gitlab.com/freepascal.org/fpc/build/-/merge_requests/1
But because it seems like no one looks at this repo, ...

--- End quote ---

That might explain why I've taken stick from the likes of various people for being sufficiently bold to install FPC using the distributed fpcbuild bundles. I think I'd better take a look what's in there...

Thanks for the hint and overall work.

MarkMLl

Thaddy:

--- Quote from: MarkMLl on December 03, 2024, 01:13:38 pm ---Except for unices where it doesn't create one at all :-/

--- End quote ---
The makefile installs a fpc.cfg in /etc
Always, afaik.

The trick is that ou must version that one twice, so that you can configure multiple installs to use the versioned fpc-x.x.x.cfg's

You can subsequently use the info in https://www.freepascal.org/docs-html/user/usersu10.html#x24-310003.1.5

MarkMLl:

--- Quote from: Thaddy on December 03, 2024, 02:13:46 pm ---
--- Quote from: MarkMLl on December 03, 2024, 01:13:38 pm ---Except for unices where it doesn't create one at all :-/

--- End quote ---
The makefile installs a fpc.cfg in /etc
Always, afaik.

--- End quote ---

QED :-/

MarkMLl

Thaddy:
Yes.
but see:
https://www.freepascal.org/docs-html/user/usersu10.html#x24-310003.1.5

where it is explained how to separate multiple configs by putting an ./etc on top of the installation dirs.
e.g.
/usr/bin/fpc331/etc
/usr/bin/fpc323/etc

Navigation

[0] Message Index

[#] Next page

Go to full version