#!@SHELL@ # # The standard driver for SML/NJ under the new runtime system # CMD=`basename "$0"` # # for /bin/ksh, disable reading user's environment file # unset ENV ############################################################################# # # BEGIN SITE SPECIFIC STUFF # ############################################################################# # # SITE SPECIFIC CONFIGURATION INFO # # On cygwin, make sure SMLNJ_HOME is given a POSIX-style pathname. if [ x"$SMLNJ_HOME" != x ] ; then if [ x"$SMLNJ_CYGWIN_RUNTIME" != x ] ; then if [ "`uname -o`" = "Cygwin" ] ; then # Convert to Unix style, absolute pathname. SMLNJ_HOME=`cygpath -u -a "$SMLNJ_HOME"` fi fi fi # the path of the directory in which executables (like this file) are kept. if [ x"$SMLNJ_HOME" = x ] ; then BIN_DIR="@BINDIR@" if [ ! -d "$BIN_DIR" ]; then cmddir=`dirname "$0"` case "$cmddir" in /* ) BIN_DIR="$cmddir";; * ) BIN_DIR=`cd $cmddir; pwd` ;; esac fi else if [ x"$CM_PATHCONFIG" = x ] ; then CM_PATHCONFIG=${SMLNJ_HOME}/lib/pathconfig export CM_PATHCONFIG fi BIN_DIR=${SMLNJ_HOME}/bin fi # the path of the directory in which the runtime system executables are kept. RUN_DIR=$BIN_DIR/.run # the path of the directory in which the heap images are kept. HEAP_DIR=$BIN_DIR/.heap # # the following could be replaced with some site specific code # ARCH_N_OPSYS=`"$BIN_DIR/.arch-n-opsys"` if [ "$?" != "0" ]; then echo "$CMD: unable to determine architecture/operating system" exit 1 fi eval $ARCH_N_OPSYS ############################################################################# # # END SITE SPECIFIC STUFF # ############################################################################# # special shortcut for frequent use (and for Linux' binfmt) if [ `basename "$0"` = sml ] ; then case "$1" in /* | ./* | ../* ) case "$1" in *.cm | *.sml | *.sig | *.fun ) ;; * ) HEAP="@SMLload=$1" shift ;; esac ;; esac fi ALLOC="" # # Process command line arguments # while [ "$#" != "0" ]; do arg=$1 case "$arg" in @SMLrun=*) shift RUN=`echo $arg | sed 's/@SMLrun=//'` ;; @SMLload=*) shift HEAP=$arg ;; @SMLappl) shift if [ "$#" = "0" ]; then echo "$CMD: missing argument for @SMLappl option" exit 1 fi APPL=$1 shift ;; @SMLversion) echo "$CMD @VERSION@" exit 0 ;; @SMLalloc=*) shift ALLOC=$arg ;; *) break ;; esac done # # Try to figure out the CPU's cache size and set the allocation area # size accordingly. This is majorly important for Celeron systems # which suffer badly when the allocation area is too big. # if [ "$ALLOC" = "" ] ; then if [ -f /proc/cpuinfo ] ; then # "head" is called to make sure we consider only one matching line. # (On linux SMP systems there is more than one such line.) cache=`fgrep 'cache size'