diff --git a/README.md b/README.md index 1d95471..daf42df 100644 --- a/README.md +++ b/README.md @@ -21,17 +21,27 @@ For jar: ## Usage -The environment variable SCMC must be set to the same value as the implementations command. -The command is the first word on the list. So for example guile for Guile, csi for Chicken -interpreter, csc for Chicken compiler. +The environment variable SCMC must be set to the same value as the +implementations command. 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. +If the command has .exe at it's end cross compilation from Linux to .exe with +Wine is assumed. Run SCMC= compile-r7rs -I +So for example to build hello-world.scm with Racket for both Linux and Wine run: + + SCMC=racket compile-r7rs -I ./snow hello-world.scm + SCMC=racket.exe compile-r7rs -I ./snow hello-world.scm + +Libraries in these commands are assumed to be under snow directory, so library +(foo bar) would be in snow/foo/bar.sld. + ## Outputs ### Self contained, self extracting and runnable shell script @@ -53,7 +63,7 @@ Requires the Scheme implementation to be installed to run. ### Static binary executable -Requires nothing to be installed to run. +Does not require Scheme implementation to be installed to run. - csc (Chicken) - racket (Racket) @@ -68,6 +78,7 @@ Only requires Java to be installed to run. ### .exe - racket.exe + - Install Racket and r7rs library with Wine to default locations ## How it works diff --git a/compile-r7rs b/compile-r7rs index 20273cc..ba3ab52 100755 --- a/compile-r7rs +++ b/compile-r7rs @@ -1,5 +1,6 @@ #!/bin/sh + if [ ! "$COMPILE_R7RS_DEBUG" = "" ]; then set -x; fi if [ "$CC" = "" ] @@ -46,7 +47,11 @@ case "$SCMC" in scm_cmd="csi -b -R r7rs $paths -script" ;; csc) - set -x + if [ "$CSC_FLAGS" = "" ] + then + CSC_FLAGS="" + fi + set -eu paths="-I $tmpdir" objects="" units="r7rs,scheme.base,scheme.case-lambda,scheme.char,scheme.complex,scheme.cxr,scheme.eval,scheme.file,scheme.inexact,scheme.lazy,scheme.load,scheme.process-context,scheme.read,scheme.repl,scheme.time,scheme.write,scheme.r5rs" @@ -54,7 +59,7 @@ case "$SCMC" in do paths="$paths -I $tmpdir/${dir#./}" findtmp="$(mktemp)" - find "$dir" -name '*.sld' > "$findtmp" + find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp" while IFS= read -r lib do unit0=$(cd "$dir" && find . -name "$(basename "$lib")") @@ -115,7 +120,7 @@ case "$SCMC" in do paths="$paths ${dir#./}" findtmp="$(mktemp)" - find "$dir" -name '*.sld' > "$findtmp" + find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp" while IFS= read -r lib do libs="$libs $lib" @@ -140,7 +145,7 @@ case "$SCMC" in do paths="$paths $dir" findtmp="$(mktemp)" - find "$dir" -name '*.sld' > "$findtmp" + find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp" while IFS= read -r lib do kawa -C "$lib" @@ -171,7 +176,7 @@ case "$SCMC" in do paths="$PWD/${dir#./}:$paths" findtmp="$(mktemp)" - find "$dir" -name '*.sld' > "$findtmp" + find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp" while IFS= read -r lib do { @@ -190,12 +195,13 @@ case "$SCMC" in exit ;; racket.exe) - paths="$PWD" + set -x + paths="$(winepath --windows $PWD)" for dir in $libdirs do - paths="$paths;$(winepath "$PWD"/"${dir#./}")" + paths="$paths;$(winepath --windows "$PWD"/"${dir#./}" | sed 's/\//\\/')" findtmp="$(mktemp)" - find "$dir" -name '*.sld' > "$findtmp" + find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp" while IFS= read -r lib do {