Make Chicken produce static executables
This commit is contained in:
parent
29a161ff6a
commit
d6aba7593b
|
@ -45,26 +45,52 @@
|
|||
(chicken
|
||||
(type . compiler)
|
||||
(library-command . ,(lambda (library-file prepend-directories append-directories r6rs?)
|
||||
(let* ((out (string-append (if (string-starts-with? library-file "srfi")
|
||||
(let ((unit (string-append (if (string-starts-with? library-file "srfi")
|
||||
(string-replace (string-cut-from-end library-file 4) #\/ #\-)
|
||||
(string-replace (string-cut-from-end library-file 4) #\/ #\.))))
|
||||
(out (string-append (if (string-starts-with? library-file "srfi")
|
||||
(string-replace (string-cut-from-end library-file 4) #\/ #\-)
|
||||
(string-replace (string-cut-from-end library-file 4) #\/ #\.))
|
||||
".so")))
|
||||
(apply string-append `("csc -R r7rs -X r7rs -s -J"
|
||||
".o"))
|
||||
(static-out (string-append (if (string-starts-with? library-file "srfi")
|
||||
(string-replace (string-cut-from-end library-file 4) #\/ #\-)
|
||||
(string-replace (string-cut-from-end library-file 4) #\/ #\.))
|
||||
".a")))
|
||||
(apply string-append `("csc -R r7rs -X r7rs -static -c -J"
|
||||
" "
|
||||
,(util-getenv "COMPILE_R7RS_CHICKEN")
|
||||
"-unit"
|
||||
" "
|
||||
,unit
|
||||
" "
|
||||
"-o"
|
||||
" "
|
||||
,out
|
||||
" "
|
||||
,(util-getenv "COMPILE_R7RS_CHICKEN")
|
||||
" "
|
||||
,(search-library-file (append prepend-directories
|
||||
append-directories)
|
||||
library-file))))))
|
||||
library-file)
|
||||
"&&"
|
||||
" "
|
||||
"ar rcs"
|
||||
" "
|
||||
,static-out
|
||||
" "
|
||||
,out
|
||||
" ")))))
|
||||
(command . ,(lambda (input-file output-file prepend-directories append-directories library-files r6rs?)
|
||||
(apply string-append `("csc -R r7rs -X r7rs"
|
||||
(apply string-append `("csc -R r7rs -X r7rs -static"
|
||||
" "
|
||||
,(util-getenv "COMPILE_R7RS_CHICKEN")
|
||||
" "
|
||||
,@(map (lambda (library-file)
|
||||
(string-append "-uses "
|
||||
(if (string-starts-with? library-file "srfi")
|
||||
(string-replace (string-cut-from-end library-file 4) #\/ #\-)
|
||||
(string-replace (string-cut-from-end library-file 4) #\/ #\.))))
|
||||
library-files)
|
||||
" "
|
||||
"-output-file"
|
||||
" "
|
||||
,output-file
|
||||
|
@ -287,7 +313,7 @@
|
|||
" "
|
||||
,(util-getenv "COMPILE_R7RS_KAWA")
|
||||
" "
|
||||
"-Dkawa.import.path=.:"
|
||||
"-Dkawa.import.path="
|
||||
,@(map (lambda (item)
|
||||
(string-append item "/*.sld:"))
|
||||
(append prepend-directories append-directories))
|
||||
|
@ -304,6 +330,10 @@
|
|||
" "
|
||||
"-nobanner"
|
||||
" "
|
||||
"-quiet"
|
||||
" "
|
||||
"-utf8"
|
||||
" "
|
||||
,(if r6rs? "-r6rs" "-r7rs")
|
||||
" "
|
||||
,@(map (lambda (item)
|
||||
|
@ -313,6 +343,8 @@
|
|||
(string-append "-A " item " "))
|
||||
append-directories)
|
||||
" "
|
||||
"-program"
|
||||
" "
|
||||
,input-file)))))
|
||||
(loko
|
||||
(type . compiler)
|
||||
|
@ -359,8 +391,8 @@
|
|||
"--batch-mode"
|
||||
" "
|
||||
,@(map (lambda (item)
|
||||
(string-append "--load " item " "))
|
||||
library-files)
|
||||
(string-append "--prepend-library " item " "))
|
||||
(append prepend-directories append-directories))
|
||||
" "
|
||||
"--load"
|
||||
" "
|
||||
|
|
Loading…
Reference in New Issue