IDE does not find fpc.cfg
Original Reporter info from Mantis: Stephano
-
Reporter name:
Original Reporter info from Mantis: Stephano
- Reporter name:
Description:
The FPC user manual states the compiler will look for fpc.cfg in the following places:
• Under UNIX (such as LINUX)
- The current directory.
- Your home directory, it looks for .fpc.cfg.
- The directory specified in the environment variable PPC_CONFIG_PATH, and if it is not set, it will look 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)
- The directory /etc.
• Under all other OSes:
- The current directory.
- If it is set, the directory specified in the environment variable PPC_CONFIG_PATH.
- The directory where the compiler is.
whereas the IDE looks in the following places (check the IDE code below):
- $HOME/.fpc.cfg
- compiler path + fpc.cfg
- working directory + fpc.cfg
- /etc/fpc.cfg (on Unix only)
In particular, it will not find fpc.cfg in &LtPos;basedir>/lib/fpc/etc as evidenced by pressing the test button in the compiler options (fpc.cfg not found!).
Furthermore, it does not inspect the environment variable PPC_CONFIG_PATH.
--------------------------------------------
// check $HOME/.fpc.cfg
Dir:=GetEnvironmentVariableUTF8('HOME');
if Dir<>'' then begin
Filename:=CleanAndExpandDirectory(Dir)+'.fpc.cfg';
AddFile(Filename);
end;
// check compiler path + fpc.cfg
Dir:=ExtractFilePath(CompilerFilename);
Dir:=ReadAllLinks(Dir,false);
if Dir<>'' then begin
Filename:=CleanAndExpandDirectory(Dir)+'fpc.cfg';
AddFile(Filename);
end;
// check working directory + fpc.cfg
Dir:=ExtractFilePath(Options.BaseDirectory);
Dir:=ReadAllLinks(Dir,false);
if Dir<>'' then begin
Filename:=CleanAndExpandDirectory(Dir)+'fpc.cfg';
AddFile(Filename);
end;
// check /etc/fpc.cfg
{$IFDEF Unix}
Dir:=ExtractFilePath(CompilerFilename);
Dir:=GetEnvironmentVariableUTF8('HOME');
if Dir<>'' then begin
Filename:='/etc/fpc.cfg';
AddFile(Filename);
end;
{$ENDIF}
--------------------------------------------
Mantis conversion info:
- Mantis ID: 17700
- Version: 0.9.29 (SVN)
- Fixed in revision: 30457 (#0abcba4a)