Browse Source

* search also the "lib" path variants on x86-64 if the "lib64" ones are not
found, some distros use lib instead of lib64 for x86-64

git-svn-id: trunk@38557 -

florian 7 năm trước cách đây
mục cha
commit
35d49f804c
1 tập tin đã thay đổi với 16 bổ sung1 xóa
  1. 16 1
      compiler/systems/t_linux.pas

+ 16 - 1
compiler/systems/t_linux.pas

@@ -126,7 +126,22 @@ begin
   if not Dontlinkstdlibpath Then
     begin
 {$ifdef x86_64}
-      LibrarySearchPath.AddPath(sysrootpath,'/lib64;/usr/lib64;/usr/X11R6/lib64',true);
+      { some linuxes might not have the lib64 variants (Arch, LFS }
+      if PathExists('/usr/X11R6/lib64',true) then
+        LibrarySearchPath.AddPath(sysrootpath,'/usr/X11R6/lib64',true)
+      else if PathExists('/usr/X11R6/lib',true) then
+        LibrarySearchPath.AddPath(sysrootpath,'/usr/X11R6/lib',true);
+
+      if PathExists('/usr/lib64',true) then
+        LibrarySearchPath.AddPath(sysrootpath,'/usr/lib64',true)
+      else if PathExists('/usr/lib',true) then
+        LibrarySearchPath.AddPath(sysrootpath,'/usr/lib',true);
+
+      { /lib64 should be the really first, so add it before everything else }
+      if PathExists('/lib64',true) then
+        LibrarySearchPath.AddPath(sysrootpath,'/lib64',true)
+      else if PathExists('/lib',true) then
+        LibrarySearchPath.AddPath(sysrootpath,'/lib',true);
 {$else}
 {$ifdef powerpc64}
       if target_info.abi<>abi_powerpc_elfv2 then