#!/bin/sh -f

SHARE_BIN=`dirname $0`

if test `basename $SHARE_BIN` = bin  ; then
  SHARE=`dirname $SHARE_BIN`
  if test `basename $SHARE` = share ; then
    MuPAD_ROOT_PATH=`dirname $SHARE`
  else
    MuPAD_ROOT_PATH=..
  fi
else
  MuPAD_ROOT_PATH=../..
fi
export MuPAD_ROOT_PATH

SYSINFO=`$MuPAD_ROOT_PATH/share/bin/sysinfo`
MuPAD_BIN=$MuPAD_ROOT_PATH/$SYSINFO/bin

if test -n "$LD_LIBRARY_PATH" ; then
   LD_LIBRARY_PATH=${MuPAD_ROOT_PATH}/${SYSINFO}/lib:${LD_LIBRARY_PATH}
else
   LD_LIBRARY_PATH=${MuPAD_ROOT_PATH}/${SYSINFO}/lib
fi
export LD_LIBRARY_PATH

if test -n "$PATH" ; then
   PATH=$MuPAD_ROOT_PATH/share/bin:${MuPAD_BIN}:$PATH
else
   PATH=$MuPAD_ROOT_PATH/share/bin:${MuPAD_BIN}
fi
export PATH

# This Bourne or Korn Shell script runs MuPAD with a TTY interface.

# These are the directories in which you installed MuPAD

# MuPAD_ROOT_PATH is the root directory of the MuPAD-System
# MuPAD_BIN       is the directory of the MuPAD programms

exec $MuPAD_BIN/xvc2jvx "$@"
