Hi!

When trying to use the new `c-object` and `objects` facilities to link a C
library to one of my eggs, I found a couple of bugs.

Two path construction mistakes, and one linking mistake which linked the
dynamic variant inside the static archive.

From 719bc786e4ef9e22643c69bf5ff8cc22d2bd056f Mon Sep 17 00:00:00 2001
From: Kooda <ko...@upyum.com>
Date: Fri, 29 Mar 2019 14:35:40 +0100
Subject: [PATCH] Fix some bugs with the egg file c-object declaration

---
 egg-compile.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/egg-compile.scm b/egg-compile.scm
index ee7ed86e..bffcf7fa 100644
--- a/egg-compile.scm
+++ b/egg-compile.scm
@@ -618,7 +618,7 @@
            " " src " -o " out2)
     (when (pair? link-objects)
       (let ((lobjs (filelist srcdir
-                             (map (cut conc <> (object-extension platform))
+                             (map (cut conc <> ".static" (object-extension 
platform))
                                link-objects)
                              platform)))
         (print (qs* default-builder platform #t) " " out3 " : "
@@ -772,12 +772,13 @@
          (opts (if (null? options)
                    default-dynamic-compilation-options
                    options))
-         (sname (or source name))
+         (sname (prefix srcdir name))
+         (ssname (and source (prefix srcdir source)))
          (out (qs* (target-file (conc sname
                                       (object-extension platform))
                                 mode)
                    platform))
-         (src (qs* (conc sname ".c") platform)))
+         (src (qs* (or ssname (conc sname ".c")) platform)))
     (when custom
       (prepare-custom-command cmd platform))
     (print "\n" (slashify default-builder platform) " "
-- 
2.20.1

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

Reply via email to