guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

08/08: ld-wrapper: Add '-rpath' for arguments such as 'libfoo.so.5.3'.


From: Ludovic Courtès
Subject: 08/08: ld-wrapper: Add '-rpath' for arguments such as 'libfoo.so.5.3'.
Date: Thu, 26 Feb 2015 23:09:54 +0000

civodul pushed a commit to branch core-updates
in repository guix.

commit f307947ecc8a3427a7787a478ef7d08bdb1e72aa
Author: Ludovic Courtès <address@hidden>
Date:   Fri Feb 27 00:08:04 2015 +0100

    ld-wrapper: Add '-rpath' for arguments such as 'libfoo.so.5.3'.
    
    Suggested by Andreas Enge <address@hidden>
    at <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00810.html>.
    CMake command lines appear to refer to such file names.
    
    * gnu/packages/ld-wrapper.scm (shared-library?): New procedure.
      (library-files-linked): Use it.
---
 gnu/packages/ld-wrapper.scm |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/gnu/packages/ld-wrapper.scm b/gnu/packages/ld-wrapper.scm
index 1985617..4fa2962 100644
--- a/gnu/packages/ld-wrapper.scm
+++ b/gnu/packages/ld-wrapper.scm
@@ -104,6 +104,15 @@ exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main 
(cdr (command-line)))" "
                    (< depth %max-symlink-depth)
                    (loop (readlink file) (+ 1 depth))))))))
 
+(define (shared-library? file)
+  ;; Return #t when FILE denotes a shared library.
+  (or (string-suffix? ".so" file)
+      (let ((index (string-contains file ".so.")))
+        ;; Since we cannot use regexps during bootstrap, roll our own.
+        (and index
+             (string-every (char-set-union (char-set #\.) char-set:digit)
+                           (string-drop file (+ index 3)))))))
+
 (define (library-files-linked args)
   ;; Return the file names of shared libraries explicitly linked against via
   ;; `-l' or with an absolute file name in ARGS.
@@ -125,7 +134,7 @@ exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main 
(cdr (command-line)))" "
                                   (cons full library-files))
                             result)))
                      ((and (string-prefix? %store-directory argument)
-                           (string-suffix? ".so" argument)) ;add library
+                           (shared-library? argument)) ;add library
                       (cons library-path
                             (cons argument library-files)))
                      (else



reply via email to

[Prev in Thread] Current Thread [Next in Thread]