Browse Source

* make aspell use dynamic runtime linking again
* default to latest aspell version, enable override

git-svn-id: trunk@9214 -

Almindor 18 years ago
parent
commit
20b147f8ac
1 changed files with 9 additions and 8 deletions
  1. 9 8
      packages/extra/aspell/aspell.pp

+ 9 - 8
packages/extra/aspell/aspell.pp

@@ -15,13 +15,13 @@ uses
   cTypes, DynLibs;
   cTypes, DynLibs;
 
 
 {$IFDEF Linux}
 {$IFDEF Linux}
-  {$DEFINE Static}
-  const aspelllib='aspell';
+  {$DEFINE Dynamic}
+  const aspelllib='/usr/lib/libaspell.so.15';
 {$ENDIF}
 {$ENDIF}
 
 
 {$IFDEF FreeBSD}
 {$IFDEF FreeBSD}
   {$DEFINE Static}
   {$DEFINE Static}
-  const aspelllib='aspell';
+  const aspelllib='/usr/local/lib/libaspell.so.15';
 {$ENDIF}
 {$ENDIF}
 
 
 {$IFDEF darwin}
 {$IFDEF darwin}
@@ -96,7 +96,7 @@ var aspellpresent:longbool;
     delete_aspell_speller:procedure (ths:aspellspeller); cdecl;
     delete_aspell_speller:procedure (ths:aspellspeller); cdecl;
    {$ENDIF}
    {$ENDIF}
 
 
-procedure aspell_init;
+procedure aspell_init(const libn: ansistring);
 procedure aspell_done;
 procedure aspell_done;
 
 
 {$IFDEF Static}
 {$IFDEF Static}
@@ -149,7 +149,7 @@ var addr:pointer;
  end;
  end;
 {$ENDIF}
 {$ENDIF}
 
 
-procedure aspell_init;
+procedure aspell_init(const libn: ansistring);
 var
 var
   mylib:string;
   mylib:string;
   {$ifdef windows}
   {$ifdef windows}
@@ -161,13 +161,14 @@ var
  aspellpresent:=true;
  aspellpresent:=true;
 {$ELSE}
 {$ELSE}
  aspellpresent:=false;
  aspellpresent:=false;
- mylib:=aspelllib;
+ mylib:=libn;
 
 
 {$IFDEF windows}
 {$IFDEF windows}
  bversion:=RegistryQueryValue (regLocalMachine,'SOFTWARE\Aspell','AspellVersion');
  bversion:=RegistryQueryValue (regLocalMachine,'SOFTWARE\Aspell','AspellVersion');
  move (bversion[1],version,4);
  move (bversion[1],version,4);
  path:=RegistryQueryValue (regLocalMachine,'SOFTWARE\Aspell','Path');
  path:=RegistryQueryValue (regLocalMachine,'SOFTWARE\Aspell','Path');
- mylib:=path + PathDelim + StringReplace(aspelllib, '%s', IntToStr(Version), [rfReplaceAll]);
+ // will work if they passed %s, won't bork if they passed absolute
+ mylib:=path + PathDelim + StringReplace(libn, '%s', IntToStr(Version), [rfReplaceAll]);
 {$ENDIF}
 {$ENDIF}
 
 
  alib := LoadLibrary(mylib);
  alib := LoadLibrary(mylib);
@@ -207,7 +208,7 @@ procedure aspell_done;
  end;
  end;
  
  
 initialization
 initialization
- aspell_init;
+ aspell_init(aspelllib);
  
  
 finalization
 finalization
  aspell_done;
  aspell_done;