#!/bin/sh

# Run a development version of the SketchyLISP interpreter.
# Prefer local executables, shared library and image.

S=sketchy
L=""
I=""

if [ -f ./sketchy-static -a \
     -x ./sketchy-static ]
then
	S=./sketchy-static
elif [ -f ./sketchy -a \
       -x ./sketchy ]
then
	S=./sketchy
	if [ -f ./libsketchy.so.* ]; then
		L="LD_LIBRARY_PATH=."
	fi
fi

if [ -f ./sketchy.image ]; then
	I="-l ./sketchy.image"
fi

echo $L $S $I $*

exec sh -c "$L $S $I $*"
