From da3718b74b9a9cd54a2fc85e54c133c867ca3eed Mon Sep 17 00:00:00 2001 From: Almindor Date: Thu, 30 Oct 2008 22:25:40 +0000 Subject: [PATCH] * 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 - --- packages/aspell/src/aspell.pp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/aspell/src/aspell.pp b/packages/aspell/src/aspell.pp index 0562b2eb7f..30074133fc 100644 --- a/packages/aspell/src/aspell.pp +++ b/packages/aspell/src/aspell.pp @@ -16,15 +16,15 @@ uses cTypes; {$IFDEF Linux} - const libaspell = '/usr/lib/libaspell.so.15'; + const libaspell = '/usr/lib/libaspell.so'; {$ENDIF} {$IFDEF FreeBSD} - const libaspell = '/usr/local/lib/libaspell.so.15'; + const libaspell = '/usr/local/lib/libaspell.so'; {$ENDIF} {$IFDEF darwin} - const libaspell = '/opt/local/lib/libaspell.15.dylib'; + const libaspell = '/opt/local/lib/libaspell.dylib'; {$ENDIF} {$IFDEF windows} @@ -1050,6 +1050,10 @@ var bversion, path: ansistring; version: dword; {$ENDIF} + {$ifdef linux} + i: Integer; + s: string; + {$endif} begin aspell_init := True; libname := libn; @@ -1067,11 +1071,20 @@ begin LibHandle := LoadLibrary(libname); {$ifdef darwin} if LibHandle = 0 then begin - libname := '/sw/lib/libaspell.15.dylib'; + libname := '/sw/lib/libaspell.dylib'; LibHandle := LoadLibrary(libname); end; {$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 Exit(False);