don't create temp files when compiling
This commit is contained in:
13
sexc.scm
13
sexc.scm
@@ -13,6 +13,7 @@
|
|||||||
(chicken pretty-print)
|
(chicken pretty-print)
|
||||||
(chicken process)
|
(chicken process)
|
||||||
(chicken process-context)
|
(chicken process-context)
|
||||||
|
(chicken port)
|
||||||
(chicken string)
|
(chicken string)
|
||||||
fmt
|
fmt
|
||||||
getopt-long
|
getopt-long
|
||||||
@@ -286,19 +287,19 @@
|
|||||||
"cc"))
|
"cc"))
|
||||||
(out-file (if (eq? output 'default)
|
(out-file (if (eq? output 'default)
|
||||||
"a.out"
|
"a.out"
|
||||||
output))
|
output)))
|
||||||
(temp-c-out (create-temporary-file ".sex.c")))
|
|
||||||
(with-output-to-file temp-c-out
|
|
||||||
(lambda ()
|
|
||||||
(emit-c sex-forms)))
|
|
||||||
(call-with-values
|
(call-with-values
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(process compiler (append (list temp-c-out "-o" out-file "-std=c89" "-pedantic")
|
(process compiler (append (list "-o" out-file "-std=c89" "-pedantic" "-x" "c")
|
||||||
(if (get-arg args 'compile-object #f)
|
(if (get-arg args 'compile-object #f)
|
||||||
(list "-c")
|
(list "-c")
|
||||||
(list))
|
(list))
|
||||||
|
(list "-") ; read stdin
|
||||||
(get-c-compiler-args args))))
|
(get-c-compiler-args args))))
|
||||||
(lambda (out-port in-port pid)
|
(lambda (out-port in-port pid)
|
||||||
|
(with-output-to-port in-port
|
||||||
|
(lambda () (emit-c sex-forms)))
|
||||||
|
(close-output-port in-port)
|
||||||
(process-wait pid)))))
|
(process-wait pid)))))
|
||||||
|
|
||||||
(define (process-input input raw-forms)
|
(define (process-input input raw-forms)
|
||||||
|
|||||||
Reference in New Issue
Block a user