From 3edd58d75acbe2c504585c50f14f2eb774ce99a2 Mon Sep 17 00:00:00 2001 From: retropikzel Date: Tue, 15 Jul 2025 17:09:38 +0300 Subject: [PATCH] Chicken 6 for default --- README.md | 9 +++------ libs/data.sld | 38 +++++++++++++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 790f628..bdf7490 100644 --- a/README.md +++ b/README.md @@ -240,13 +240,10 @@ and input file to .sps file and other way around is undefined behaviour. ### Chicken -To run executable at place set LD\_LIBRARY\_PATH=. (executable directory) -before running it. For example: +By default Chicken 6 is assumed, for Chicken 5 use environment variable to +add R7RS libraries: - LD\_LIBRARY\_PATH=. ./test - -If you are using Chicken you should propably read the next section too, you -will most propably run into it soon. + COMPILE_R7RS_CHIKEN="-X r7r -R r7rs" ### mit-scheme diff --git a/libs/data.sld b/libs/data.sld index 1d7245b..c4dd1a3 100644 --- a/libs/data.sld +++ b/libs/data.sld @@ -51,25 +51,53 @@ (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 -static -c -J" + " " + ,(util-getenv "COMPILE_R7RS_CHICKEN") " " "-o" " " ,out " " - ,(util-getenv "COMPILE_R7RS_CHICKEN") + ,(search-library-file (append prepend-directories append-directories) library-file) " " - ,(search-library-file (append prepend-directories append-directories) library-file)))))) + "-unit" + " " + ,unit + " " + "&&" + " " + "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" " " ,(util-getenv "COMPILE_R7RS_CHICKEN") " " + "-static" + " " ,@(map (lambda (item) (string-append "-I " item " ")) (append append-directories prepend-directories)) " " + ,@(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