]> gitweb.factorcode.org Git - factor.git/commitdiff
alien.libraries.finder.linux: some fixes to allow "LLVM-3.4" to find "LLVM-3.4.1".
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 8 Jun 2014 18:43:15 +0000 (11:43 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 8 Jun 2014 18:48:29 +0000 (11:48 -0700)
basis/alien/libraries/finder/linux/linux.factor

index 482a55cf032276c408d916dd35c446c5b450d1f5..c2978d1861336857b4580b8135b4d71a98e00e57 100644 (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 ;