#!/bin/sh
#
# MathLink template compiler
#
# Copyright 1988 - 1999  Wolfram Research, Inc.
#

spath=`expr $0'/' : '\(/\)[^/]*//*$' \| $0'/' : \
            '\(.*[^/]\)//*[^/][^/]*//*$' \| .`

if [ "." = $spath ]; then
   MLPATH=`pwd`
else
   if [ .`(echo $spath | grep "^/")` = .$spath ]; then
      MLPATH=$spath
   else
      MLPATH="`pwd`/$spath"
   fi
fi
sysid=`basename $MLPATH`

topdir=`\cd $MLPATH/../../Files; pwd`

if [ ! -x $topdir/AddOns/MathLink/DevelopersKits/$sysid/CompilerAdditions/mcc ]; then
  echo "Command not found.  Check that you have installed the MathLink"
  echo "Developer's Kit for the system you are running on."
  exit
fi

exec $topdir/AddOns/MathLink/DevelopersKits/$sysid/CompilerAdditions/mcc "$@"
