Update readme, fixing racket.exe building
This commit is contained in:
parent
afb0fafa29
commit
251004fdd5
21
README.md
21
README.md
|
@ -21,17 +21,27 @@ For jar:
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
The environment variable SCMC must be set to the same value as the implementations command.
|
The environment variable SCMC must be set to the same value as the
|
||||||
The command is the first word on the list. So for example guile for Guile, csi for Chicken
|
implementations command. The command is the first word on the list.
|
||||||
interpreter, csc for Chicken compiler.
|
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
|
Run
|
||||||
|
|
||||||
SCMC=<SCHEME> compile-r7rs -I <DIR> <file.scm>
|
SCMC=<SCHEME> compile-r7rs -I <DIR> <file.scm>
|
||||||
|
|
||||||
|
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
|
## Outputs
|
||||||
|
|
||||||
### Self contained, self extracting and runnable shell script
|
### Self contained, self extracting and runnable shell script
|
||||||
|
@ -53,7 +63,7 @@ Requires the Scheme implementation to be installed to run.
|
||||||
|
|
||||||
### Static binary executable
|
### Static binary executable
|
||||||
|
|
||||||
Requires nothing to be installed to run.
|
Does not require Scheme implementation to be installed to run.
|
||||||
|
|
||||||
- csc (Chicken)
|
- csc (Chicken)
|
||||||
- racket (Racket)
|
- racket (Racket)
|
||||||
|
@ -68,6 +78,7 @@ Only requires Java to be installed to run.
|
||||||
### .exe
|
### .exe
|
||||||
|
|
||||||
- racket.exe
|
- racket.exe
|
||||||
|
- Install Racket and r7rs library with Wine to default locations
|
||||||
|
|
||||||
## How it works
|
## How it works
|
||||||
|
|
||||||
|
|
22
compile-r7rs
22
compile-r7rs
|
@ -1,5 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
if [ ! "$COMPILE_R7RS_DEBUG" = "" ]; then set -x; fi
|
if [ ! "$COMPILE_R7RS_DEBUG" = "" ]; then set -x; fi
|
||||||
|
|
||||||
if [ "$CC" = "" ]
|
if [ "$CC" = "" ]
|
||||||
|
@ -46,7 +47,11 @@ case "$SCMC" in
|
||||||
scm_cmd="csi -b -R r7rs $paths -script"
|
scm_cmd="csi -b -R r7rs $paths -script"
|
||||||
;;
|
;;
|
||||||
csc)
|
csc)
|
||||||
set -x
|
if [ "$CSC_FLAGS" = "" ]
|
||||||
|
then
|
||||||
|
CSC_FLAGS=""
|
||||||
|
fi
|
||||||
|
set -eu
|
||||||
paths="-I $tmpdir"
|
paths="-I $tmpdir"
|
||||||
objects=""
|
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"
|
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
|
do
|
||||||
paths="$paths -I $tmpdir/${dir#./}"
|
paths="$paths -I $tmpdir/${dir#./}"
|
||||||
findtmp="$(mktemp)"
|
findtmp="$(mktemp)"
|
||||||
find "$dir" -name '*.sld' > "$findtmp"
|
find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp"
|
||||||
while IFS= read -r lib
|
while IFS= read -r lib
|
||||||
do
|
do
|
||||||
unit0=$(cd "$dir" && find . -name "$(basename "$lib")")
|
unit0=$(cd "$dir" && find . -name "$(basename "$lib")")
|
||||||
|
@ -115,7 +120,7 @@ case "$SCMC" in
|
||||||
do
|
do
|
||||||
paths="$paths ${dir#./}"
|
paths="$paths ${dir#./}"
|
||||||
findtmp="$(mktemp)"
|
findtmp="$(mktemp)"
|
||||||
find "$dir" -name '*.sld' > "$findtmp"
|
find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp"
|
||||||
while IFS= read -r lib
|
while IFS= read -r lib
|
||||||
do
|
do
|
||||||
libs="$libs $lib"
|
libs="$libs $lib"
|
||||||
|
@ -140,7 +145,7 @@ case "$SCMC" in
|
||||||
do
|
do
|
||||||
paths="$paths $dir"
|
paths="$paths $dir"
|
||||||
findtmp="$(mktemp)"
|
findtmp="$(mktemp)"
|
||||||
find "$dir" -name '*.sld' > "$findtmp"
|
find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp"
|
||||||
while IFS= read -r lib
|
while IFS= read -r lib
|
||||||
do
|
do
|
||||||
kawa -C "$lib"
|
kawa -C "$lib"
|
||||||
|
@ -171,7 +176,7 @@ case "$SCMC" in
|
||||||
do
|
do
|
||||||
paths="$PWD/${dir#./}:$paths"
|
paths="$PWD/${dir#./}:$paths"
|
||||||
findtmp="$(mktemp)"
|
findtmp="$(mktemp)"
|
||||||
find "$dir" -name '*.sld' > "$findtmp"
|
find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp"
|
||||||
while IFS= read -r lib
|
while IFS= read -r lib
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -190,12 +195,13 @@ case "$SCMC" in
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
racket.exe)
|
racket.exe)
|
||||||
paths="$PWD"
|
set -x
|
||||||
|
paths="$(winepath --windows $PWD)"
|
||||||
for dir in $libdirs
|
for dir in $libdirs
|
||||||
do
|
do
|
||||||
paths="$paths;$(winepath "$PWD"/"${dir#./}")"
|
paths="$paths;$(winepath --windows "$PWD"/"${dir#./}" | sed 's/\//\\/')"
|
||||||
findtmp="$(mktemp)"
|
findtmp="$(mktemp)"
|
||||||
find "$dir" -name '*.sld' > "$findtmp"
|
find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp"
|
||||||
while IFS= read -r lib
|
while IFS= read -r lib
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue