Forum > Embedded - ARM

Paths manually specified.

<< < (2/2)

funlw65:
Thank you!

funlw65:
Regarding the configuration file, or it's required presence or not, this sums it well:
https://www.freepascal.org/docs-html/user/usersu10.html

Fred vS:

--- Quote from: funlw65 on March 13, 2021, 01:50:08 pm ---Regarding the configuration file, or it's required presence or not, this sums it well:
https://www.freepascal.org/docs-html/user/usersu10.html

--- End quote ---

Hello.

I think there are errors for Unix OS in the document and in the comment of /fpc/compiler/options.pas.

In the link you give, they say:


--- Quote ---Unless you specify the -n (see page 104) option, the compiler will look for a configuration file fpc.cfg in the following places:

    Under unix (such as linux)

    1.
        The current directory.
    2.
        Your home directory, it looks for .fpc.cfg.
    3.
        The directory specified in the environment variable PPC_CONFIG_PATH.
    4.
        in the etc directory above the compiler directory.
        For instance, if the compiler is in /usr/local/bin, it will look in /usr/local/etc.
        See below for some additional information about this point.
    5.
        The directory /etc.
--- End quote ---

But if you take a look at /fpc/compiler/options.pas, there is:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{****************************************************************************                              Callable Routines****************************************************************************} function check_configfile(fn:string; var foundfn:string):boolean;   function CfgFileExists(const fn:string):boolean;  begin    Comment(V_Tried,'Configfile search: '+fn);    CfgFileExists:=FileExists(fn);  end; var{$ifdef Unix}  hs,{$endif Unix}  configpath : string;begin  foundfn:=fn;  check_configfile:=true;  { retrieve configpath }  configpath:=FixPath(GetEnvironmentVariable('PPC_CONFIG_PATH'),false);{$ifdef Unix}  if configpath='' then   configpath:=ExpandFileName(FixPath(exepath+'../etc/',false));{$endif}  {    Order to read configuration file :    try reading fpc.cfg in :     1 - current dir     2 - configpath     3 - compiler path  }  if not FileExists(fn) then   begin{$ifdef Unix}     hs:=GetEnvironmentVariable('HOME');     if (hs<>'') and CfgFileExists(FixPath(hs,false)+'.'+fn) then      foundfn:=FixPath(hs,false)+'.'+fn     else{$endif}      if CfgFileExists(configpath+fn) then       foundfn:=configpath+fn     else{$ifdef WINDOWS}       if (GetEnvironmentVariable('USERPROFILE')<>'') and CfgFileExists(FixPath(GetEnvironmentVariable('USERPROFILE'),false)+fn) then         foundfn:=FixPath(GetEnvironmentVariable('USERPROFILE'),false)+fn     else       if (GetEnvironmentVariable('ALLUSERSPROFILE')<>'') and CfgFileExists(FixPath(GetEnvironmentVariable('ALLUSERSPROFILE'),false)+fn) then         foundfn:=FixPath(GetEnvironmentVariable('ALLUSERSPROFILE'),false)+fn     else{$endif WINDOWS}{$ifndef Unix}      if CfgFileExists(exepath+fn) then       foundfn:=exepath+fn     else{$else}      if CfgFileExists('/etc/'+fn) then       foundfn:='/etc/'+fn     else{$endif}      check_configfile:=false;   end;end;
The comment says:


--- Quote ---{
    Order to read configuration file :
    try reading fpc.cfg in :
     1 - current dir
     2 - configpath
     3 - compiler path
  }
--- End quote ---

But if you take a look at code, in fact it is:

 Order to read configuration file :
    try reading fpc.cfg in :
     1 - environement variable (/HOME)+'.'
     2 - configpath
     3 - /etc/

Fre;D

funlw65:
Thank you Fred, that is even clearer about the path priority of a config file... for now...

The best method is to take control for what I intend to do, to assure the desired outcome. In my book, -n option means no more confusion. For embedded, $HOME folder is enough. 

Fred vS:

--- Quote from: funlw65 on March 13, 2021, 03:24:35 pm ---For embedded, $HOME folder is enough.

--- End quote ---

Yes but, afaik, the fpc.cfg must be in $HOME folder and hidden (a dot before), for example: /home/me/.fpc.cfg

Navigation

[0] Message Index

[*] Previous page

Go to full version