summaryrefslogtreecommitdiff
path: root/compiler/systems
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2018-03-17 21:58:24 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2018-03-17 21:58:24 +0000
commit52f95a728d410cdce1323fd3ad96cbe1c7d7be1b (patch)
treeab72ca03885cae277b3bd570836d051e78c130df /compiler/systems
parent8c728e2adbbf99c65954066a919b1bd42c588353 (diff)
downloadfpc-52f95a728d410cdce1323fd3ad96cbe1c7d7be1b.tar.gz
* 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: https://svn.freepascal.org/svn/fpc/trunk@38557 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/systems')
-rw-r--r--compiler/systems/t_linux.pas17
1 files changed, 16 insertions, 1 deletions
diff --git a/compiler/systems/t_linux.pas b/compiler/systems/t_linux.pas
index 10596763ae..fa06342085 100644
--- a/compiler/systems/t_linux.pas
+++ b/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