Browse Source

* use iterarive numbering to find first usable libaspell.so.xx on linux
* don't use specific libaspell.so.xx on BSDs (they have dev by default)

git-svn-id: trunk@12001 -

Almindor 17 years ago
parent
commit
da3718b74b
1 changed files with 17 additions and 4 deletions
  1. 17 4
      packages/aspell/src/aspell.pp

+ 17 - 4
packages/aspell/src/aspell.pp

@@ -16,15 +16,15 @@ uses
   cTypes;
   cTypes;
 
 
 {$IFDEF Linux}
 {$IFDEF Linux}
-  const libaspell = '/usr/lib/libaspell.so.15';
+  const libaspell = '/usr/lib/libaspell.so';
 {$ENDIF}
 {$ENDIF}
 
 
 {$IFDEF FreeBSD}
 {$IFDEF FreeBSD}
-  const libaspell = '/usr/local/lib/libaspell.so.15';
+  const libaspell = '/usr/local/lib/libaspell.so';
 {$ENDIF}
 {$ENDIF}
 
 
 {$IFDEF darwin}
 {$IFDEF darwin}
- const libaspell = '/opt/local/lib/libaspell.15.dylib';
+ const libaspell = '/opt/local/lib/libaspell.dylib';
 {$ENDIF}
 {$ENDIF}
 
 
 {$IFDEF windows}
 {$IFDEF windows}
@@ -1050,6 +1050,10 @@ var
   bversion, path: ansistring;
   bversion, path: ansistring;
   version: dword;
   version: dword;
   {$ENDIF}
   {$ENDIF}
+  {$ifdef linux}
+  i: Integer;
+  s: string;
+  {$endif}
 begin
 begin
   aspell_init := True;
   aspell_init := True;
   libname := libn;
   libname := libn;
@@ -1067,11 +1071,20 @@ begin
   LibHandle := LoadLibrary(libname);
   LibHandle := LoadLibrary(libname);
   {$ifdef darwin}
   {$ifdef darwin}
   if LibHandle = 0 then begin
   if LibHandle = 0 then begin
-    libname := '/sw/lib/libaspell.15.dylib';
+    libname := '/sw/lib/libaspell.dylib';
     LibHandle := LoadLibrary(libname);
     LibHandle := LoadLibrary(libname);
   end;
   end;
   {$endif}
   {$endif}
 
 
+  {$ifdef linux}
+  if LibHandle = 0 then begin
+    for i := 15 to 30 do begin // TODO: make sure to up this when required
+      str(i, s);
+      libname := libn + '.' + s;
+      LibHandle := LoadLibrary(libname);
+    end;
+  {$endif}
+
   if LibHandle = 0 then
   if LibHandle = 0 then
     Exit(False);
     Exit(False);