#! /bin/sh # Copyright (C) 1988-1995 Swedish Institute of Computer Science. SP_LIB=/usr/local/src/lang/sicstus/sicstus3/bin base=sp qlbase=sp ext=sav switch=-r args= while [ "$1" != "" ] ; do if [ $1 = -P ] ; then base=muse qlbase=muse elif [ $1 = -PT ] ; then base=muse-trace qlbase=muse elif [ $1 = -PS ] ; then base=muse-stat qlbase=muse fi if [ $1 = -B ] ; then # boot, Remove the -B argument ext=ql switch=-b elif [ $1 = -F ] ; then # boot, Remove the -B argument ext=ql switch=-b args="$args $1" elif [ $1 = -a ] ; then # Do not interpret after -a break; else args="$args $1" fi shift done program=$SP_LIB/bin/$base.exe # if only muse installed, then plain sicstus defaults to muse # should use -x but it is not available everywhere if [ '!' -f $program ] ; then base2=muse program2=$SP_LIB/bin/$base2.exe if [ -f $program2 ] ; then base=$base2 qlbase=muse program=$program2 fi fi if [ $ext = sav ] ; then file=$SP_LIB/bin/$base.$ext if [ '!' -r $file ] ; then # If no saved state then boot ext=ql switch=-b fi fi if [ $ext = ql ] ; then file=$SP_LIB/bin/$qlbase.$ext fi if [ '!' -r $file ] ; then echo Cannot find file: $file exit 1 fi exec $program $switch $file $args "$@"