On Thu, May 25, 2017 at 03:55:42PM +0200, lemonboy wrote:
> Hello hackers,
> here's a small patch that fixes the problem with chicken-install
> reported by Mario in #1373.
> I've briefly tested it and have inspected the contents of the
> .install.sh file and it does look right.

Here's a signed off copy, with one small tweak: the (or oname target)
in the (set! prgs ..) list can be replaced by rtarget, to avoid
repeating ourselves again.  This requires extending the LET's body
to include that set! call, hence the slightly larger patch due to
the reindent.

Cheers,
Peter
From 941e78d5ad8324a1c9e3a5f90ad076bc97a05a7b Mon Sep 17 00:00:00 2001
From: LemonBoy <thatle...@gmail.com>
Date: Thu, 25 May 2017 15:53:30 +0200
Subject: [PATCH] Respect install-name when specified.

Do this for 'program' and 'extension' components.

Signed-off-by: Peter Bex <pe...@more-magic.net>
---
 egg-compile.scm | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/egg-compile.scm b/egg-compile.scm
index 4d7332c..e72db6e 100644
--- a/egg-compile.scm
+++ b/egg-compile.scm
@@ -143,15 +143,17 @@
                       (oname #f)
                       (opts '()))
             (for-each compile-extension/program (cddr info))
-            (let ((dest (destination-repository mode #t)))
-              (when (eq? #t tfile) (set! tfile target))
-              (when (eq? #t ifile) (set! ifile target))
+            (let ((dest (destination-repository mode #t))
+                  ; Respect install-name if specified
+                  (rtarget (or oname target)))
+              (when (eq? #t tfile) (set! tfile rtarget))
+              (when (eq? #t ifile) (set! ifile rtarget))
               (addfiles 
                 (if (memq 'static link) 
-                    (list (conc dest "/" target objext)
-                          (conc dest "/" target +link-file-extension+))
+                    (list (conc dest "/" rtarget objext)
+                          (conc dest "/" rtarget +link-file-extension+))
                     '())
-                (if (memq 'dynamic link) (list (conc dest "/" target ".so")) '())
+                (if (memq 'dynamic link) (list (conc dest "/" rtarget ".so")) '())
                 (if tfile 
                     (list (conc dest "/" tfile ".types"))
                     '())
@@ -159,8 +161,8 @@
                     (list (conc dest "/" ifile ".inline"))
                     '())
                 (list (if (uses-compiled-import-library? mode)
-                          (conc dest "/" target ".import.so")
-                          (conc dest "/" target ".import.scm")))))
+                          (conc dest "/" rtarget ".import.so")
+                          (conc dest "/" rtarget ".import.scm")))))
             (set! exts 
               (cons (list target dependencies: deps source: src options: opts 
                           link-options: lopts linkage: link custom: cbuild
@@ -235,13 +237,15 @@
             (for-each compile-extension/program (cddr info))
             (let ((dest (if (eq? mode 'target) 
                             default-bindir   ; XXX wrong!
-                            host-bindir)))
-              (addfiles (list (conc dest "/" target exeext))))
-            (set! prgs 
-              (cons (list target dependencies: deps source: src options: opts 
-                          link-options: lopts linkage: link custom: cbuild
-                          mode: mode output-file: (or oname target))                         
-                    prgs))))))
+                            host-bindir))
+                  ; Respect install-name if specified
+                  (rtarget (or oname target)))
+              (addfiles (list (conc dest "/" rtarget exeext)))
+	      (set! prgs 
+		(cons (list target dependencies: deps source: src options: opts 
+			    link-options: lopts linkage: link custom: cbuild
+			    mode: mode output-file: rtarget)
+		      prgs)))))))
     (define (compile-extension/program info)
       (case (car info)
         ((target) 
-- 
2.1.4

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to