~ chicken-core (chicken-5) bce023b78610b2b97f274fe59f63147cd55c41b6


commit bce023b78610b2b97f274fe59f63147cd55c41b6
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Wed Oct 18 10:11:08 2017 +0200
Commit:     Kooda <kooda@upyum.com>
CommitDate: Sat Oct 21 21:19:17 2017 +0200

    "csc -static" is too static
    
    Signed-off-by: Kooda <kooda@upyum.com>

diff --git a/csc.scm b/csc.scm
index 296da5df..a4f8f9ac 100644
--- a/csc.scm
+++ b/csc.scm
@@ -121,7 +121,7 @@
       (libchicken)))
 
 (define (default-library)
-  (string-append (libchicken) "." library-extension))
+  (make-pathname library-dir (libchicken) library-extension))
 
 (define default-compilation-optimization-options
   (string-split (if host-mode host-cflags default-cflags)))
@@ -207,6 +207,9 @@
 (define rpath #f)
 (define ignore-repository #f)
 
+(define library-dir
+  (if host-mode host-libdir default-libdir))
+
 (define extra-libraries
   (if host-mode
       INSTALL_MORE_STATIC_LIBS
@@ -218,7 +221,7 @@
 (define (default-library-files)
   (list (string-append "-l" (if host-mode INSTALL_LIB_NAME TARGET_LIB_NAME))))
 
-(define (library-files) (default-library-files))
+(define (library-files) (list (default-library)))
 (define (shared-library-files) (default-library-files))
 
 (define translate-options '())
@@ -243,9 +246,6 @@
 (define compilation-optimization-options default-compilation-optimization-options)
 (define linking-optimization-options default-linking-optimization-options)
 
-(define library-dir
-  (if host-mode host-libdir default-libdir))
-
 (define link-options '())
 
 (define (builtin-link-options)
@@ -597,7 +597,6 @@ EOF
 		(set! objc-mode #t) ]
 	       [(-static)
 		(set! translate-options (cons "-static" translate-options))
-		(set! link-options (cons "-static" link-options))
 		(set! static #t)]
 	       [(-cflags)
 		(set! inquiry-only #t) 
Trap