From 611f23b9da331a3c669d3a21eb14f952d6c6e438 Mon Sep 17 00:00:00 2001 From: retropikzel Date: Tue, 24 Dec 2024 10:09:39 +0200 Subject: [PATCH] Started adding cross build racket --- README.md | 6 ++++++ compile-r7rs | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/README.md b/README.md index 58c1c8b..25e1ac1 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ The environment variable SCC must be set to the same value as the implementation The command is the first word on the list. So for example guile for Guile, csi for Chicken interpreter, csc for Chicken compiler. +If the command has .exe at it's end cross compilation from Linux to .exe with Wine is assumed. + ## Outputs ### Self contained, self extracting and runnable shell script @@ -69,6 +71,10 @@ Only requires Java to be installed to run. - kawa - The build folder needs to contain kawa.jar +### .exe + +- racket.exe + ## How it works The scripts searches for .sld files in given paths, compiles them if needed and combines them with diff --git a/compile-r7rs b/compile-r7rs index 3c4b4a7..a968eee 100755 --- a/compile-r7rs +++ b/compile-r7rs @@ -165,6 +165,31 @@ case ${SCC} in PLTCOLLECTS="$paths" raco exe --orig-exe -o $output ++lang r7rs "${main%.scm}.rkt" exit ;; + racket.exe) + paths="${PWD}" + for dir in $libdirs + do + paths="$paths;$(winepath ${PWD}/${dir#./})" + for lib in $(find "$dir" -name "*.sld") + do + { + echo "#lang r7rs" + echo "(import (scheme base))" + echo "(include \"$(basename $lib)\")" + } > "${lib%.sld}.rkt" + done + done + + { + echo "#lang r7rs" + cat "$main" + } > "${main%.scm}.rkt" + set -x + WINEPATH="${HOME}/.wine/drive_c/Program Files/Racket" \ + PLTCOLLECTS="$paths" \ + wine raco.exe exe --orig-exe --embed-dlls -o "${output}.exe" ++lang r7rs "${main%.scm}.rkt" + exit + ;; sash) paths="-L $tmpdir" for dir in $libdirs