#! /bin/sh

REL=`/bin/uname -r`
MINOR=`echo $REL | cut -d. -f2`
if [ $MINOR -ge 7 ]; then
  if isalist | grep sparcv9 > /dev/null ; then
    PROC=sparcv9
  fi
fi
if [ -z "$PROC" ]; then
  if [ -x /bin/mach ]; then
    PROC=`/bin/mach`
  elif [ -x /usr/ucb/mach ]; then
    PROC=`/usr/ucb/mach`
  elif [ `/bin/uname -r | /bin/cut -d. -f1` = "5" ]; then
    PROC=`/bin/uname -p`
  else
    PROC=unknown
  fi
fi
TOP=`/bin/dirname $0`
if [ "$TOP" = "." ]; then
        TOP=`pwd`
fi
TOP=`/bin/dirname $TOP`
SE="$TOP"/bin/se.$PROC.$REL
if [ -z "$SEPATH" ]; then
  SEPATH="$TOP"/examples:.
else
  SEPATH="$SEPATH":"$TOP"/examples:.
fi
if [ -z "$SEINCLUDE" ]; then
  SEINCLUDE="$TOP"/include
else
  SEINCLUDE="$SEINCLUDE":"$TOP"/include
fi
export SEPATH SEINCLUDE
if [ -x $SE ]; then
  for i
  do
    argv="$argv '"$i"'"
  done
  eval exec $SE $argv
  exit $?
else
  echo "$0": Unsupported platform: $PROC SunOS $REL
  exit 1
fi
exit 0
