Przeglądaj źródła

* Fix for resolving libc-path on non-english Linux

git-svn-id: trunk@31906 -
joost 10 lat temu
rodzic
commit
5f46057eea
1 zmienionych plików z 7 dodań i 0 usunięć
  1. 7 0
      packages/fpmkunit/src/fpmkunit.pp

+ 7 - 0
packages/fpmkunit/src/fpmkunit.pp

@@ -2608,6 +2608,13 @@ function GetDefaultLibGCCDir(CPU : TCPU;OS: TOS; var ErrorMessage: string): stri
 {$ifdef HAS_UNIT_PROCESS}
       ExecResult:=GetCompilerInfo(GccExecutable,'-v '+GCCParams, True);
       libgccFilename:=Get4thWord(ExecResult);
+      // Use IsRelativePath to check if the 4th word is an (absolute) path.
+      // This depends on the language settings. In English the 4th word is
+      // empty, if this particular gcc version does not return the libgcc-
+      // filename on -v. But in other languages (e.g. Dutch) it may be another
+      // word.
+      if IsRelativePath(libgccFilename) then
+        libgccFilename:='';
       if libgccFilename='' then
         libgccFilename:=GetCompilerInfo(GccExecutable,'--print-libgcc-file-name '+GCCParams, False);
       result := ExtractFileDir(libgccFilename);