]> gitweb.factorcode.org Git - factor.git/blob - basis/alien/libraries/finder/finder.factor
stomp.cli: simplify
[factor.git] / basis / alien / libraries / finder / finder.factor
1 USING: accessors alien.libraries kernel sequences system vocabs ;
2 IN: alien.libraries.finder
3
4 HOOK: find-library* os ( name -- path/f )
5
6 : find-library ( name -- path/library-not-found )
7     [ find-library* ] transmute ;
8
9 : ?update-library ( name path abi -- )
10     pick lookup-library [ dll>> dll-valid? ] [ f ] if* [
11         3drop
12     ] [
13         [ find-library ] [ update-library ] bi*
14     ] if ;
15
16 ! Try to find the library from a list, but if it's not found,
17 ! try to open a library that is the first name in that list anyway
18 ! or "library_not_found" as a last resort for better debugging.
19 : find-library-from-list ( seq -- path/f )
20     [ [ find-library* ] map-find drop ]
21     [ ?first "library_not_found" or ] ?unless ;
22
23 "alien.libraries.finder." os name>> append require