On 2021-11-23 13:17, Sergey Organov via fpc-devel wrote:
Tomas Hajny via fpc-devel
<fpc-devel-pd4fty7x32k2wbthl531ywd2fqjk+...@public.gmane.org> writes:
On 2021-11-22 16:46, Sergey Organov via fpc-devel wrote:
Jonas Maebe via fpc-devel
<fpc-devel-pd4fty7x32k2wbthl531ywd2fqjk+...@public.gmane.org> writes:
.
.
The compiler will still read only 2 configuration files at most, the
default for given instance of the compiler, and user's one.
The user would still need to remember that the first one depends on the
installation path (which may not be even known to the compiler on some
platforms as far as I remember!). The user may not even care/remember
where the compiler is installed under normal conditions.
I.e., compiler installed in /usr should *not* read
/usr/local/etc/fpc.cfg, only /etc/fpc.cfg. Compiler installed
elsewhere,
say, in /abc/def/custom, should read /abc/def/custom/etc/fpc.cfg.
The idea of backing to read /etc/fpc.cfg if /abc/def/custom/etc/fpc.cfg
is not found for backward compatibility that I've suggested above now
doesn't look useful to me, as I can't figure a use-case where it would
help.
What is indeed confusing is sharing "system" configuration file between
native and cross- compiler.
Why confusing? There is no "system" configuration file which would
differ between native compilers and cross-compilers (note that
cross-compilers may be installed at system-wide level, e.g. to
/usr/bin/, equally to the native compiler!). There may indeed be a
system-wide configuration file. Then there may be a user specific
configuration file (~/.fpc.cfg on *nix machines) and a project specific
configuration file (./fpc.cfg). Plus there may be a special
configuration file for specific purpose which may be passed to the
compiler using the '@' parameter. All of them allow specifying options
valid for all cases / all compilations, as well as options used only
under particular conditions (e.g. when compiling for a particular
target, or a particular CPU). In addition, there are helpers which allow
specifying certain configuration only once, but with certain parts
changing value depending on the compilation target ($FPCTARGET). You can
easily specify -XR valid for a particular target in your system-wide
configuration file.
I'd suggest that at least -XR (if not the
installation directory itself) change the search path for configuration
file.
.
.
You should better read how the FPC option -XR is specified. What is the
relation between 'Prepend <x> to all linker search paths' (see FPC help)
and location of the configuration file?
Tomas
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel