diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:06:40 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:06:40 -0800 |
commit | a69c9fb665459e2bfdbda1bf80741a0af31a7faf (patch) | |
tree | f0bc974f8805049e6b9a4e6864886298fbaa05a4 /slib.sh | |
parent | 4684239efa63dc1b2c1cbe37ef7d3062029f5532 (diff) | |
download | slib-a69c9fb665459e2bfdbda1bf80741a0af31a7faf.tar.gz slib-a69c9fb665459e2bfdbda1bf80741a0af31a7faf.zip |
New upstream version 3b5upstream/3b5upstream
Diffstat (limited to 'slib.sh')
-rwxr-xr-x | slib.sh | 34 |
1 files changed, 21 insertions, 13 deletions
@@ -28,9 +28,9 @@ Usage: slib SCHEME Usage: slib - Initialize SLIB session using executable (MIT) 'scheme', 'scm', - 'gsi', 'mzscheme', 'guile', 'slib48', 'larceny', 'scmlit', 'elk', - 'sisc', or 'kawa'." + Initialize SLIB session using executable (MIT)'scheme', 'scm', + 'gsi', 'gosh', 'guile', 'slib48', 'larceny', 'scmlit', 'elk', + 'sisc', 'kawa', or 'mzscheme'." case "$1" in -v | --ver*) echo slib "$VERSION"; exit 0;; @@ -41,18 +41,18 @@ case "$1" in *) command="$1" shift esac -# If more arguments are supplied, then err out. -if [ ! -z "$1" ]; then - echo "$usage"; exit 1 -fi +## If more arguments are supplied, then err out. +# if [ ! -z "$1" ]; then +# echo "$usage"; exit 1 +# fi if [ -z "$command" ]; then if type scm>/dev/null 2>&1; then command=scm; implementation=scm elif type gsi>/dev/null 2>&1; then command=gsi; implementation=gam - elif type mzscheme>/dev/null 2>&1; then - command=mzscheme; implementation=plt + elif type gosh>/dev/null 2>&1; then + command=gosh; implementation=gch elif type guile>/dev/null 2>&1; then command=guile; implementation=gui elif type slib48>/dev/null 2>&1; then @@ -67,12 +67,14 @@ if [ -z "$command" ]; then command=sisc; implementation=ssc elif type kawa>/dev/null 2>&1; then command=kawa; implementation=kwa + elif type mzscheme>/dev/null 2>&1; then + command=mzscheme; implementation=plt else echo No Scheme implementation found. exit 1 fi # Gambit 4.0 doesn't allow input redirection; foils --version test. -elif [ "$command" == "gsi" ]; then implementation=gam +elif [ "$command" = "gsi" ]; then implementation=gam elif type $command>/dev/null 2>&1; then SPEW="`$command --version < /dev/null 2>&1`" if echo ${SPEW} | grep 'Initialize load-path (colon-list of directories)'\ @@ -80,12 +82,13 @@ elif type $command>/dev/null 2>&1; then elif echo ${SPEW} | grep 'MIT' >/dev/null 2>&1; then implementation=mit elif echo ${SPEW} | grep 'UMB Scheme'>/dev/null 2>&1; then implementation=umb elif echo ${SPEW} | grep 'scheme48' >/dev/null 2>&1; then implementation=s48 - elif echo ${SPEW} | grep 'MzScheme' >/dev/null 2>&1; then implementation=plt elif echo ${SPEW} | grep 'larceny' >/dev/null 2>&1; then implementation=lar elif echo ${SPEW} | grep 'Guile' >/dev/null 2>&1; then implementation=gui + elif echo ${SPEW} | grep 'gosh' >/dev/null 2>&1; then implementation=gch elif echo ${SPEW} | grep 'SCM' >/dev/null 2>&1; then implementation=scm elif echo ${SPEW} | grep 'SISC' >/dev/null 2>&1; then implementation=ssc elif echo ${SPEW} | grep 'Kawa' >/dev/null 2>&1; then implementation=kwa + elif echo ${SPEW} | grep 'MzScheme' >/dev/null 2>&1; then implementation=plt else implementation= fi else @@ -124,10 +127,14 @@ case $implementation in scm) exec $command -ip1 -l ${SCHEME_LIBRARY_PATH}scm.init "$@";; elk) exec $command -i -l ${SCHEME_LIBRARY_PATH}elk.init "$@";; gam) exec $command -:s ${SCHEME_LIBRARY_PATH}gambit.init - "$@";; + gch) exec $command -l ${SCHEME_LIBRARY_PATH}gosh.init "$@";; ssc) exec $command -e "(load \"${SCHEME_LIBRARY_PATH}sisc.init\")" -- "$@";; kwa) exec $command -f ${SCHEME_LIBRARY_PATH}kawa.init -- "$@";; - plt) exec $command -f ${SCHEME_LIBRARY_PATH}mzscheme.init "$@";; - gui) exec $command -l ${SCHEME_LIBRARY_PATH}guile.init "$@";; + gui) if [ -f ${SCHEME_LIBRARY_PATH}guile.use ]; then + exec $command -l ${SCHEME_LIBRARY_PATH}guile.init -l ${SCHEME_LIBRARY_PATH}guile.use "$@" + else + exec $command -l ${SCHEME_LIBRARY_PATH}guile.init "$@" + fi;; lar) exec $command -- -e "(require 'srfi-96)" "$@";; mit) exec $command -load ${SCHEME_LIBRARY_PATH}mitscheme.init "$@";; s48) if [ -f "${S48_VICINITY}slib.image" ]; then @@ -136,6 +143,7 @@ case $implementation in echo "scheme48 found; in slib directory do: 'make slib48 && make install48'"; fi exit 1;; + plt) exec $command -f ${SCHEME_LIBRARY_PATH}mzscheme.init "$@";; umb) echo "umb-scheme vicinities are too wedged to run slib"; exit 1;; *) exit 1;; esac |