#! /bin/sh
# Shell wrapper for Xeve
case "$OSTYPE" in

    cygwin32)
	# Cygwin 32 NT
	if [ -z "$ESTEREL" ] 
	then
	    echo "*** ESTEREL environment variable is unset"
	    exit 1
	fi
	# Cygwin bash requires UNC path, else path drive: is
	# considered as relative. But, tclsh requires drive and slashes.
	ESTEREL=`echo $ESTEREL | sed -e 's![\\]!/!g' `
	XEVE=`echo $ESTEREL/bin/xeve.exe | sed -e 's!^\([a-zA-Z]\):!//\1!'`
	PATH=`echo $ESTEREL/tcltk/bin | sed -e 's!^\([a-zA-Z]\):!//\1!'`:$PATH
	export PATH
	;;

    *)
	# Other Unixes
	if [ -z "$ESTEREL" ]
	then
	    ESTEREL=../esterelv5_92.linux
	fi
	XEVE=$ESTEREL/bin/xeve.exe
	;;
esac

export ESTEREL

XEVE_LIB=$ESTEREL/lib/xeve
export XEVE_LIB

TCL_LIBRARY=$ESTEREL/tcltk/lib/tcl8.2
export TCL_LIBRARY

TK_LIBRARY=$ESTEREL/tcltk/lib/tk8.2
export TK_LIBRARY

exec $XEVE $*
