Run scm compiler as a sub-process

This commit is contained in:
Justin Ethier 2021-08-16 23:34:00 -04:00
parent 50631b8bb5
commit 7d92a39fdf

View file

@ -983,6 +983,7 @@
; (equal? #\- (string-ref arg 0))))) ; (equal? #\- (string-ref arg 0)))))
; args)) ; args))
(compile? #t) (compile? #t)
(run-scm-compiler? (member "-run-scm-compiler" args))
(cc-prog (apply string-append (collect-opt-values args "-CP"))) (cc-prog (apply string-append (collect-opt-values args "-CP")))
(cc-exec (apply string-append (collect-opt-values args "-CE"))) (cc-exec (apply string-append (collect-opt-values args "-CE")))
(cc-lib (apply string-append (collect-opt-values args "-CL"))) (cc-lib (apply string-append (collect-opt-values args "-CL")))
@ -1126,13 +1127,20 @@ Debug options:
(cdr err)) (cdr err))
(newline) (newline)
(exit 1))) (exit 1)))
(let ((t (thread-start! (cond
(make-thread (lambda () (run-compiler non-opts append-dirs prepend-dirs)))))) (run-scm-compiler?
(thread-join! t) ;; Compile Scheme code into a C file
(run-external-compiler (run-compiler non-opts append-dirs prepend-dirs))
non-opts compile? append-dirs prepend-dirs (else
cc-prog cc-exec cc-lib cc-so ;; Generate the C file
cc-opts cc-linker-opts cc-linker-extra-objects)) (system
(string-append
(calling-program) " -run-scm-compiler "
(string-join args " ")))
;; Call the C compiler
(run-external-compiler
non-opts compile? append-dirs prepend-dirs
cc-prog cc-exec cc-lib cc-so
cc-opts cc-linker-opts cc-linker-extra-objects)))
)))) ))))