Merge branch 'master' of factorcode.org:/git/factor
commit
7a388a64b2
|
@ -1,5 +1,5 @@
|
||||||
|
USING: combinators kernel sequences system vocabs
|
||||||
USING: combinators kernel system vocabs alien.libraries ;
|
alien.libraries ;
|
||||||
IN: alien.libraries.finder
|
IN: alien.libraries.finder
|
||||||
|
|
||||||
HOOK: find-library* os ( name -- path/f )
|
HOOK: find-library* os ( name -- path/f )
|
||||||
|
@ -7,6 +7,13 @@ HOOK: find-library* os ( name -- path/f )
|
||||||
: find-library ( name -- path/library-not-found )
|
: find-library ( name -- path/library-not-found )
|
||||||
dup find-library* [ nip ] when* ;
|
dup find-library* [ nip ] when* ;
|
||||||
|
|
||||||
|
! Try to find the library from a list, but if it's not found,
|
||||||
|
! try to open a library that is the first name in that list anyway
|
||||||
|
! or "library_not_found" as a last resort for better debugging.
|
||||||
|
: find-library-from-list ( seq -- path/f )
|
||||||
|
dup [ find-library* ] map
|
||||||
|
[ ] find nip [ nip ] [ ?first "library_not_found" or ] if* ;
|
||||||
|
|
||||||
{
|
{
|
||||||
{ [ os macosx? ] [ "alien.libraries.finder.macosx" ] }
|
{ [ os macosx? ] [ "alien.libraries.finder.macosx" ] }
|
||||||
{ [ os linux? ] [ "alien.libraries.finder.linux" ] }
|
{ [ os linux? ] [ "alien.libraries.finder.linux" ] }
|
||||||
|
|
|
@ -5,7 +5,7 @@ alien.syntax classes.struct combinators kernel system ;
|
||||||
IN: gdbm.ffi
|
IN: gdbm.ffi
|
||||||
|
|
||||||
<< "libgdbm"
|
<< "libgdbm"
|
||||||
os windows? [ "gdbm3.dll" ] [ "gdbm" find-library ] if
|
{ "gdbm" "gdbm3" "libgdbm-3" } find-library-from-list
|
||||||
cdecl add-library >>
|
cdecl add-library >>
|
||||||
|
|
||||||
LIBRARY: libgdbm
|
LIBRARY: libgdbm
|
||||||
|
|
|
@ -3,15 +3,12 @@
|
||||||
! adapted from "yaml.h" libYAML 0.1.4
|
! adapted from "yaml.h" libYAML 0.1.4
|
||||||
! http://pyyaml.org/wiki/LibYAML
|
! http://pyyaml.org/wiki/LibYAML
|
||||||
USING: alien alien.c-types alien.destructors alien.libraries
|
USING: alien alien.c-types alien.destructors alien.libraries
|
||||||
alien.syntax classes.struct combinators literals system ;
|
alien.syntax classes.struct combinators literals system
|
||||||
|
alien.libraries.finder ;
|
||||||
IN: yaml.ffi
|
IN: yaml.ffi
|
||||||
|
|
||||||
<<
|
<<
|
||||||
"libyaml" {
|
"libyaml" { "yaml" "libyaml-0-2" } find-library-from-list cdecl add-library
|
||||||
{ [ os windows? ] [ "libyaml.dll" ] }
|
|
||||||
{ [ os macosx? ] [ "libyaml.dylib" ] }
|
|
||||||
{ [ os unix? ] [ "libyaml.so" ] }
|
|
||||||
} cond cdecl add-library
|
|
||||||
>>
|
>>
|
||||||
|
|
||||||
C-TYPE: FILE
|
C-TYPE: FILE
|
||||||
|
|
Loading…
Reference in New Issue