alien.libraries.finder: using find-library for some often missing libs

db4
Björn Lindqvist 2013-12-10 22:53:26 +01:00 committed by John Benediktsson
parent 0c3580844d
commit a6b3f50e2c
3 changed files with 34 additions and 44 deletions

View File

@ -2,15 +2,12 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
! An interface to the sqlite database. Tested against sqlite v3.1.3. ! An interface to the sqlite database. Tested against sqlite v3.1.3.
! Not all functions have been wrapped. ! Not all functions have been wrapped.
USING: alien compiler kernel math namespaces sequences strings alien.syntax USING: alien alien.libraries alien.libraries.finder compiler kernel
system combinators alien.c-types alien.libraries ; math namespaces sequences strings alien.syntax system combinators
alien.c-types ;
IN: db.sqlite.ffi IN: db.sqlite.ffi
<< "sqlite" { << "sqlite" "sqlite3" find-library cdecl add-library >>
{ [ os windows? ] [ "sqlite3.dll" ] }
{ [ os macosx? ] [ "/usr/lib/libsqlite3.dylib" ] }
{ [ os unix? ] [ "libsqlite3.so" ] }
} cond cdecl add-library >>
! Return values from sqlite functions ! Return values from sqlite functions
CONSTANT: SQLITE_OK 0 ! Successful result CONSTANT: SQLITE_OK 0 ! Successful result

View File

@ -1,7 +1,7 @@
! Copyright (C) 2010 Anton Gorenko. ! Copyright (C) 2010 Anton Gorenko.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.c-types alien.destructors alien.libraries USING: alien alien.c-types alien.destructors alien.libraries
alien.syntax combinators gobject-introspection alien.libraries.finder alien.syntax assocs gobject-introspection
gobject-introspection.standard-types kernel pango.ffi system gobject-introspection.standard-types kernel pango.ffi system
vocabs ; vocabs ;
IN: gtk.ffi IN: gtk.ffi
@ -15,10 +15,9 @@ LIBRARY: gtk
<< <<
"gtk" { "gtk" {
{ [ os windows? ] [ "libgtk-win32-2.0-0.dll" cdecl add-library ] } { linux "gtk-x11-2.0" }
{ [ os macosx? ] [ drop ] } { windows "libgtk-win32-2.0-0" }
{ [ os unix? ] [ "libgtk-x11-2.0.so" cdecl add-library ] } } os of [ find-library cdecl add-library ] when*
} cond
>> >>
IMPLEMENT-STRUCTS: GtkTreeIter ; IMPLEMENT-STRUCTS: GtkTreeIter ;

View File

@ -1,17 +1,11 @@
! Copyright (C) 2010 Erik Charlebois ! Copyright (C) 2010 Erik Charlebois
! See http:// factorcode.org/license.txt for BSD license. ! See http:// factorcode.org/license.txt for BSD license.
USING: alien alien.c-types kernel alien.syntax classes.struct USING: alien alien.c-types alien.syntax alien.libraries.finder
accessors libc math make unix.types namespaces system classes.struct accessors kernel libc math make unix.types namespaces
combinators alien.libraries ; system combinators alien.libraries ;
IN: readline.ffi IN: readline.ffi
<< << "readline" dup find-library cdecl add-library >>
"readline" {
{ [ os windows? ] [ "readline.dll" ] }
{ [ os macosx? ] [ "libreadline.dylib" ] }
{ [ os unix? ] [ "libreadline.so" ] }
} cond cdecl add-library
>>
LIBRARY: readline LIBRARY: readline
TYPEDEF: void* histdata_t TYPEDEF: void* histdata_t