#! /bin/sh

cppsim_root=${CPPSIMHOME-$HOME/CppSim}
cppsimshared_root=${CPPSIMSHAREDHOME-$cppsim_root/CppSimShared}

ARCH=`arch`

cd ${cppsimshared_root}/Sue2/bin

if [ "$ARCH" = "i686" ] 
   then
   type -P "wish" &>/dev/null || { echo -e "Error: wish command not found!\n--> You must install Tcl/Tk before running Sue2 (http://tcl.sourceforge.net)"; exit 1; }
   wish sue2
else
if [ "$ARCH" = "x86_64" ] 
   then
   type -P "wish" &>/dev/null || { echo -e "Error: wish command not found!\n--> You must install Tcl/Tk before running Sue2 (http://tcl.sourceforge.net)"; exit 1; }
   wish sue2
else
if [ "$ARCH" = "i386" ] 
   then
   type -P "wish" &>/dev/null || { echo -e "Error: wish command not found!\n--> You must install Tcl/Tk before running Sue2 (http://tcl.sourceforge.net)"; exit 1; }
   wish sue2
else
   echo "Error: architecture $ARCH unknown"
fi
fi
fi
