From 96e141ffc6ef3f10e690aebe76318ae24877ef52 Mon Sep 17 00:00:00 2001
From: joost <joost@cnoc.nl>
Date: Sat, 3 Jan 2009 18:04:32 +0000
Subject: [PATCH]  * Instead of using a hardcoded SystemIDEDir first try to
 generate it from the startup-path

git-svn-id: trunk@12492 -
---
 ide/fpini.pas | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ide/fpini.pas b/ide/fpini.pas
index 8d3038540b..9208971285 100644
--- a/ide/fpini.pas
+++ b/ide/fpini.pas
@@ -152,7 +152,13 @@ begin
 {$ifndef unix}
   IDEDir:=CompleteDir(DirOf(system.Paramstr(0)));
 {$else}
-  SystemIDEDir:='/usr/lib/fpc/'+version_string+'/ide/text';
+  SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib/fpc/'+version_string+'/ide/text');
+  If Not ExistsDir(SystemIDEdir) Then
+    begin
+    SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib64/fpc/'+version_string+'/ide/text');
+    If Not ExistsDir(SystemIDEdir) Then
+      SystemIDEDir:='/usr/lib/fpc/'+version_string+'/ide/text';
+    end;
   IDEdir:=CompleteDir(FExpand('~/.fp'));
   If Not ExistsDir(IDEdir) Then
     begin