diff --git a/lib/chibi/snow/commands.scm b/lib/chibi/snow/commands.scm index 06ad4bd3..9411e18c 100644 --- a/lib/chibi/snow/commands.scm +++ b/lib/chibi/snow/commands.scm @@ -2051,22 +2051,30 @@ (lib-flags (map (lambda (lib) (string-append "-l" lib)) (library-foreign-dependencies impl cfg library))) - (ffi-cmd `(,@chibi-ffi ,stub-file)) + (ffi-cmd + `(,@chibi-ffi + "-c" "-cc" ,(car cc) + "-f" ,(string-join cflags " ") + "-f" ,(string-join lib-flags " ") + ,@(if local-test? '("-f" "-Iinclude -L.") '()) + ,@(if (pair? (cdr cc)) + (list "-f" (string-join (cdr cc) " ")) + '()) + ,stub-file)) (cc-cmd `(,@cc ,@cflags ,@so-flags ,@(if local-test? '("-Iinclude" "-L.") '()) "-o" ,so-file ,c-file "-lchibi-scheme" ,@lib-flags))) - (when (or (and (not (file-exists? c-file)) - (file-exists? stub-file) - (or (system? ffi-cmd) - (yes-or-no? cfg "couldn't compile stub: " - stub-file " - install anyway?"))) - (and (file-exists? c-file) + (when (or (and (file-exists? c-file) (or (system? cc-cmd) (yes-or-no? cfg "couldn't compile chibi ffi c code: " c-file " - install anyway?"))) + (and (file-exists? stub-file) + (or (system? ffi-cmd) + (yes-or-no? cfg "couldn't compile stub: " + stub-file " - install anyway?"))) (yes-or-no? cfg "can't find ffi stub or c source for: " base " - install anyway?")) (lp (cdr ls))))))))