1 USING: accessors alien.libraries kernel lexer parser sequences
2 system vocabs vocabs.platforms ;
3 IN: alien.libraries.finder
5 HOOK: find-library* os ( name -- path/f )
7 : find-library ( name -- path/library-not-found )
8 dup find-library* [ nip ] when* ;
10 : ?update-library ( name path abi -- )
11 pick lookup-library [ dll>> dll-valid? ] [ f ] if* [
14 [ find-library ] [ update-library ] bi*
17 ! Try to find the library from a list, but if it's not found,
18 ! try to open a library that is the first name in that list anyway
19 ! or "library_not_found" as a last resort for better debugging.
20 : find-library-from-list ( seq -- path/f )
21 dup [ find-library* ] map-find drop
22 [ ] [ ?first "library_not_found" or ] ?if ;
24 SYNTAX: ADD-FIRST-LIBRARY:
25 scan-token scan-word scan-object
26 find-library-from-list swap add-library ;
28 USE-OS-SUFFIX: alien.libraries.finder