adding --scheme-script and --scheme-program-command args to snow (issue #400)

This commit is contained in:
Alex Shinn 2017-03-26 21:30:53 +09:00
parent ae1a2aa6be
commit 806d92aa15
2 changed files with 45 additions and 39 deletions

View file

@ -1341,7 +1341,8 @@
(define (scheme-script-command impl cfg) (define (scheme-script-command impl cfg)
(or (and (eq? impl 'chibi) (conf-get cfg 'chibi-path)) (or (and (eq? impl 'chibi) (conf-get cfg 'chibi-path))
(let* ((prog (cond ((assq impl known-implementations) => cadr) (let* ((prog (cond ((conf-get cfg 'scheme-script))
((assq impl known-implementations) => cadr)
(else "scheme-script"))) (else "scheme-script")))
(path (or (find-in-path prog) prog)) (path (or (find-in-path prog) prog))
(arg (case impl (arg (case impl
@ -1354,46 +1355,49 @@
path)))) path))))
(define (scheme-program-command impl cfg file . o) (define (scheme-program-command impl cfg file . o)
(let ((lib-path (and (pair? o) (car o))) (cond
(install-dir (get-install-source-dir impl cfg))) ((conf-get cfg 'scheme-program-command) => string-split)
(case impl (else
((chibi) (let ((lib-path (and (pair? o) (car o)))
(let ((chibi (string-split (conf-get cfg 'chibi-path "chibi-scheme")))) (install-dir (get-install-source-dir impl cfg)))
(case impl
((chibi)
(let ((chibi (string-split (conf-get cfg 'chibi-path "chibi-scheme"))))
(if lib-path
`(,@chibi -A ,install-dir -A ,lib-path ,file)
`(,@chibi -A ,install-dir ,file))))
((chicken)
(if lib-path (if lib-path
`(,@chibi -A ,install-dir -A ,lib-path ,file) `(csi -R r7rs -I ,install-dir -I ,lib-path -s ,file)
`(,@chibi -A ,install-dir ,file)))) `(csi -R r7rs -I ,install-dir -s ,file)))
((chicken) ((foment)
(if lib-path
`(csi -R r7rs -I ,install-dir -I ,lib-path -s ,file)
`(csi -R r7rs -I ,install-dir -s ,file)))
((foment)
(if lib-path
`(foment -A ,install-dir -A ,lib-path ,file)
`(foment -A ,install-dir ,file)))
((gauche)
(if lib-path
`(gosh -A ,install-dir -A ,lib-path ,file)
`(gosh -A ,install-dir ,file)))
((guile)
(if lib-path
`(guile -L ,install-dir -L ,lib-path ,file)
`(guile -L ,install-dir ,file)))
((kawa)
(let ((install-dir (path-resolve install-dir (current-directory))))
(if lib-path (if lib-path
`(kawa `(foment -A ,install-dir -A ,lib-path ,file)
,(string-append "-Dkawa.import.path=" install-dir ":" `(foment -A ,install-dir ,file)))
(path-resolve lib-path (current-directory))) ((gauche)
--r7rs --script ,file) (if lib-path
`(kawa ,(string-append "-Dkawa.import.path=" install-dir) `(gosh -A ,install-dir -A ,lib-path ,file)
--r7rs --script ,file)))) `(gosh -A ,install-dir ,file)))
((larceny) ((guile)
(if lib-path (if lib-path
`(larceny -r7rs -path ,(string-append install-dir ":" lib-path) `(guile -L ,install-dir -L ,lib-path ,file)
-program ,file) `(guile -L ,install-dir ,file)))
`(larceny -r7rs -path ,install-dir -program ,file))) ((kawa)
(else (let ((install-dir (path-resolve install-dir (current-directory))))
#f)))) (if lib-path
`(kawa
,(string-append "-Dkawa.import.path=" install-dir ":"
(path-resolve lib-path (current-directory)))
--r7rs --script ,file)
`(kawa ,(string-append "-Dkawa.import.path=" install-dir)
--r7rs --script ,file))))
((larceny)
(if lib-path
`(larceny -r7rs -path ,(string-append install-dir ":" lib-path)
-program ,file)
`(larceny -r7rs -path ,install-dir -program ,file)))
(else
#f))))))
(define (get-install-search-dirs impl cfg) (define (get-install-search-dirs impl cfg)
(let ((install-dir (get-install-source-dir impl cfg)) (let ((install-dir (get-install-source-dir impl cfg))

View file

@ -85,6 +85,8 @@
(program-builder symbol "name of program builder to use") (program-builder symbol "name of program builder to use")
(implementations (list symbol) ("impls") "impls to install for, or 'all'") (implementations (list symbol) ("impls") "impls to install for, or 'all'")
(program-implementation symbol "impl to install programs for") (program-implementation symbol "impl to install programs for")
(scheme-script string "shell command to use for running scheme scripts")
(scheme-program-command string "shell command to use for running scheme programs")
(chibi-path filename "path to chibi-scheme executable") (chibi-path filename "path to chibi-scheme executable")
(cc string "path to c compiler") (cc string "path to c compiler")
(cflags string "flags for c compiler") (cflags string "flags for c compiler")