sqlite3.lsp library path

Q&A's, tips, howto's
Locked
Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

sqlite3.lsp library path

Post by Dmi »

/usr/share/newlisp/sqlite3.lsp has the code for cross-platform autodetection of library's place.

Code: Select all

(if 
        ; LINUX and BSDs
        (< (& 0xF (last (sys-info))) 3) (set 'library "/usr/local/lib/libsqlite3.so")
        ; Mac OSX / Darwin
        (= (& 0xF (last (sys-info))) 3) (set 'library "/usr/lib/libsqlite3.0.dylib")
        ; Solaris
        (= (& 0xF (last (sys-info))) 4) (set 'library "/usr/local/lib/libsqlite3.so")
        ; MinGW, Win32
        (> (& 0xF (last (sys-info))) 4)
                (set 'library (string (env "PROGRAMFILES") "/sqlite3/sqlite3.dll"))
        true (println "Cannot load library OS not supported"))
Unfortunately, Debian Linux (and I think, at least Ubuntu too) have libsqlite library in /usr/lib/libsqlite3.so.0
Also, I think that all modern package-oriented Lunux distros have libsqlite in /usr/lib despite of library's name.

Lutz,
Can you correct this in sqlite3.lsp (or to extend an autodetection)?
...or simply to insert something like:

Code: Select all

(if 
        ; predefined place
        MAIN:libsqlite-path (set 'library MAIN:libsqlite-path)
        ; LINUX and BSDs
        (< (& 0xF (last (sys-info))) 3) (set 'library "/usr/local/lib/libsqlite3.so")
.......
WBR, Dmi

Locked