From 28490661cf5a6d27188dc431c78cbcfd3cf0a7ba Mon Sep 17 00:00:00 2001 From: retropikzel Date: Wed, 25 Jun 2025 07:40:40 +0300 Subject: [PATCH] Change the ffi and compile commands back --- lib/chibi/snow/commands.scm | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) 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))))))))