]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/deploy/libraries/unix/unix.factor
alien.libraries: add a "deploy-library" word that marks a library to have its dll...
[factor.git] / basis / tools / deploy / libraries / unix / unix.factor
1 ! (c)2010 Joe Groff bsd license
2 USING: io.files io.pathnames io.pathnames.private kernel
3 sequences system tools.deploy.libraries ;
4 IN: tools.deploy.libraries.unix
5
6 ! stupid hack. better ways to find the library name would be open the library,
7 ! note a symbol address found in the library, then call dladdr (or use
8 : ?exists ( path -- path/f )
9     dup exists? [ drop f ] unless ; inline
10
11 M: unix find-library-file
12     dup absolute-path? [ ?exists ] [
13         { "/lib" "/usr/lib" "/usr/local/lib" }
14         [ prepend-path ?exists ] with map-find drop
15     ] if ;
16