Change the ffi and compile commands back

This commit is contained in:
retropikzel 2025-06-25 07:40:40 +03:00
parent 3142fc2fdc
commit 28490661cf

View file

@ -2051,22 +2051,30 @@
(lib-flags (lib-flags
(map (lambda (lib) (string-append "-l" lib)) (map (lambda (lib) (string-append "-l" lib))
(library-foreign-dependencies impl cfg library))) (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-cmd
`(,@cc ,@cflags ,@so-flags `(,@cc ,@cflags ,@so-flags
,@(if local-test? '("-Iinclude" "-L.") '()) ,@(if local-test? '("-Iinclude" "-L.") '())
"-o" ,so-file ,c-file "-lchibi-scheme" "-o" ,so-file ,c-file "-lchibi-scheme"
,@lib-flags))) ,@lib-flags)))
(when (or (and (not (file-exists? c-file)) (when (or (and (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)
(or (system? cc-cmd) (or (system? cc-cmd)
(yes-or-no? (yes-or-no?
cfg "couldn't compile chibi ffi c code: " cfg "couldn't compile chibi ffi c code: "
c-file " - install anyway?"))) 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: " (yes-or-no? cfg "can't find ffi stub or c source for: "
base " - install anyway?")) base " - install anyway?"))
(lp (cdr ls)))))))) (lp (cdr ls))))))))