alien.libraries.finder.linux: some fixes to allow "LLVM-3.4" to find "LLVM-3.4.1".

db4
John Benediktsson 2014-06-08 11:43:15 -07:00
parent 1b29731927
commit 490bb44a94
1 changed files with 10 additions and 3 deletions
basis/alien/libraries/finder/linux

View File

@ -27,15 +27,22 @@ CONSTANT: mach-map {
: ldconfig-arch ( -- str )
mach-map cpu of { "libc6" } or ;
: name-matches? ( lib triple -- ? )
first swap ?head [ ?first CHAR: . = t ] [ f ] if ;
: arch-matches? ( lib triple -- ? )
nip second ldconfig-arch subset? ;
: ldconfig-matches? ( lib triple -- ? )
{ [ first head? ] [ nip second ldconfig-arch subset? ] } 2&& ;
{ [ name-matches? ] [ arch-matches? ] } 2&& ;
: ldconfig-find-soname ( lib -- seq )
load-ldconfig-cache [ ldconfig-matches? ] with filter [ third ] map ;
load-ldconfig-cache [ ldconfig-matches? ] with filter
[ third ] map ;
PRIVATE>
M: linux find-library*
"lib" ".so" surround ldconfig-find-soname [
"lib" prepend ldconfig-find-soname [
{ [ exists? ] [ file-info regular-file? ] } 1&&
] map-find nip ;