Permalink
Browse files

sqlite: don't look in 64 bit library paths if running a 32 bit binary

  • Loading branch information...
darealshinji committed Jan 11, 2019
1 parent ecc79b3 commit 3549e3fad9fb55092bd9610a32d1815a77fe1759
Showing with 12 additions and 13 deletions.
  1. +12 −13 dbases_sqlite.pas
@@ -199,23 +199,22 @@ procedure TfrmSQLiteDBases.FormCreate(Sender: TObject);
end;
{$endif}
{$ifdef Linux}
// If it's 64-bit Debian based Linux, use the 64-bit Debian SQLite3 SO file

try
slSQLitePaths := TStringList.Create;
// Most common on a 64-bit Debian based system
slSQLitePaths := TStringList.Create;
{$ifdef CPU64}
slSQLitePaths.Add('/usr/lib/x86_64-linux-gnu/libsqlite3.so.0');
// Most 32-bit based distributions might have it in these paths:
slSQLitePaths.Add('/usr/lib/libsqlite3.so.0');
slSQLitePaths.Add('/usr/lib/i386-linux-gnu/libsqlite3.so.0');
slSQLitePaths.Add('/usr/lib32/libsqlite3.so.0');
slSQLitePaths.Add('/lib/libsqlite3.so.0');
slSQLitePaths.Add('/lib32/libsqlite3.so.0');
slSQLitePaths.Add('/lib/i386-linux-gnu/libsqlite3.so.0');
// Most 64-bit based distributions might have it in these paths, if not in the first one
slSQLitePaths.Add('/usr/lib64/libsqlite3.so.0');
slSQLitePaths.Add('/lib/x86_64-linux-gnu/libsqlite3.so.0');
slSQLitePaths.Add('/lib64/libsqlite3.so.0');
{$else ifdef CPU32}
slSQLitePaths.Add('/usr/lib/i386-linux-gnu/libsqlite3.so.0');
slSQLitePaths.Add('/usr/lib32/libsqlite3.so.0');
slSQLitePaths.Add('/lib/i386-linux-gnu/libsqlite3.so.0');
slSQLitePaths.Add('/lib32/libsqlite3.so.0');
{$endif}
slSQLitePaths.Add('/usr/local/lib/libsqlite3.so.0');
slSQLitePaths.Add('/usr/lib/libsqlite3.so.0');
slSQLitePaths.Add('/lib/libsqlite3.so.0');
finally
SQLiteLibraryPath := ''; // just empty this for now
end;
@@ -240,7 +239,7 @@ procedure TfrmSQLiteDBases.FormCreate(Sender: TObject);
end
else
begin
SQLDBLibraryLoaderLinux.LibraryName := SQLiteLibraryPath; // '/usr/lib/x86_64-linux-gnu/libsqlite3.so.0';
SQLDBLibraryLoaderLinux.LibraryName := SQLiteLibraryPath;
SQLDBLibraryLoaderLinux.Enabled := true;
SQLDBLibraryLoaderLinux.LoadLibrary;
if CreateGUID(guid) = 0 then

0 comments on commit 3549e3f

Please sign in to comment.