From 71ce04861d0951a40c05fcb3415ab34102f9ee8f Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sat, 9 May 2015 22:28:32 +0900 Subject: [PATCH] Actually installing compiled ffi bindings when present in chibi. --- lib/chibi/snow/commands.scm | 33 ++++++++++++++++++++++++--------- tools/snow-chibi | 1 + 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/lib/chibi/snow/commands.scm b/lib/chibi/snow/commands.scm index 000b0407..34161c1f 100644 --- a/lib/chibi/snow/commands.scm +++ b/lib/chibi/snow/commands.scm @@ -1638,7 +1638,8 @@ (string-append (library->path cfg library) "." ext)) (include-files (library-include-files impl cfg (make-path dir library-file))) - (install-dir (get-install-source-dir impl cfg))) + (install-dir (get-install-source-dir impl cfg)) + (install-lib-dir (get-install-library-dir impl cfg))) ;; install the library file (let ((path (make-path install-dir dest-library-file))) (install-directory cfg (path-directory path)) @@ -1646,13 +1647,25 @@ ;; install any includes (cons path - (map - (lambda (x) - (let ((dest-file (make-path install-dir (path-relative x dir)))) - (install-directory cfg (path-directory dest-file)) - (install-file cfg x dest-file) - dest-file)) - include-files))))) + (append + (map + (lambda (x) + (let ((dest-file (make-path install-dir (path-relative x dir)))) + (install-directory cfg (path-directory dest-file)) + (install-file cfg x dest-file) + dest-file)) + include-files) + (map + (lambda (x) + (let* ((so-file (string-append x (cond-expand (macosx ".dylib") + (else ".so")))) + (dest-file (make-path install-lib-dir + (path-relative so-file dir)))) + (install-directory cfg (path-directory dest-file)) + (install-file cfg so-file dest-file) + dest-file)) + (library-shared-include-files + impl cfg (make-path dir library-file)))))))) (define (chicken-installer impl cfg library dir) (let* ((library-file (get-library-file cfg library)) @@ -1770,7 +1783,9 @@ (cc (string-split (or (conf-get cfg 'cc) (get-environment-variable "CC") "cc"))) - (cflags (string-split (or (get-environment-variable "CFLAGS") "")))) + (cflags (string-split (or (conf-get cfg 'cflags) + (get-environment-variable "CFLAGS") + "")))) (let lp ((ls shared-includes)) (if (null? ls) library diff --git a/tools/snow-chibi b/tools/snow-chibi index 2254a8a5..cef8e3e4 100755 --- a/tools/snow-chibi +++ b/tools/snow-chibi @@ -87,6 +87,7 @@ (program-implementation symbol "impl to install programs for") (chibi-path filename "path to chibi-scheme executable") (cc string "path to c compiler") + (cflags string "flags for c compiler") (sexp? boolean ("sexp") "output information in sexp format") ))