Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/config/_run-sml
ViewVC logotype

View of /sml/trunk/config/_run-sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 569 - (download) (annotate)
Tue Mar 7 04:01:07 2000 UTC (19 years, 7 months ago) by blume
File size: 3384 byte(s)
- size info in BOOTLIST
     * no fixed upper limits for number of bootfiles or length of
       bootfile names in runtime
     * falling back to old behavior if no BOOTLIST size info found
- allocation size heuristics in .run-sml
     * tries to read cache size from /proc/cpuinfo (this is important for
        small-cache Celeron systems!)
- install.sh robustified
- CM manual updates
- paranoid mode
     * no more CMB.deliver() (i.e., all done by CMB.make())
     * can re-use existing sml.boot.* files
     * init.cmi now treated as library
     * library stamps for consistency checks
- sml.boot.<arch>-<os>/PIDMAP file
     * This file is read by the CM startup code.  This is used to minimize
       the amount of dynamic state that needs to be stowed away for the
       purpose of sharing between interactive system and user code.
- CM.Anchor.anchor instead of CM.Anchor.{set,cancel}
     * Upon request by Elsa.  Anchors now controlled by get-set-pair
       like most other CM state variables.
- Compiler.CMSA eliminated
     * No longer supported by CM anyway.
- fixed bugs in pickler that kept biting Stefan
     * past refs to past refs (was caused by the possibility that
       ad-hoc sharing is more discriminating than hash-cons sharing)
     * integer overflow on LargeInt.minInt
- ml-{lex,yacc} build scripts now use new mechanism
  for building standalone programs
- fixed several gcc -Wall warnings that were caused by missing header
  files, missing initializations, etc., in runtime (not all warnings
  eliminated, though)
#!@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
#

# the path of the directory in which executables (like this file) are kept.
BIN_DIR=@BINDIR@
if [ ! -d "$BIN_DIR" ]; then
    cmddir=`dirname $0`
    case "$cmddir" in
    	/* ) BIN_DIR="$cmddir";;
    	* ) BIN_DIR=`cd $cmddir; pwd` ;;
    esac
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)
case "$1" in /* | ./* | ../* ) HEAP="@SMLload=$1"; shift ;; esac

ALLOC=""

#
# Process command line arguments
#
ARGS=""
while [ "$#" != "0" ]; do
  arg=$1; shift
  case $arg in
    @SMLrun=*)
      RUN=`echo $arg | sed 's/@SMLrun=//'`
      ;;
    @SMLload=*)
      HEAP=$arg;
      ;;
    @SMLappl)
      if [ "$#" = "0" ]; then
        echo "$CMD: missing argument for @SMLappl option"
        exit 1
      fi
      APPL=$1; shift
      ;;
    @SMLversion)
      echo "$CMD @VERSION@"
      exit 0
      ;;
    @SMLalloc=*)
      ALLOC=$arg
      ;;
    *)
      ARGS="$ARGS $arg"
      ;;
  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' </proc/cpuinfo | head -1`
	if [ $? = 0 ] ; then
	    kb=`echo $cache | sed -e 's/^[^0-9]*\([0-9]*\).*$/\1/'`
	    case $kb in 
		128)
		    # This is the Celeron case.
		    ALLOC="@SMLalloc=32k"
		    ;;
		256)
		    # Do CPUs like this exist?
		    ALLOC="@SMLalloc=128k"
		    ;;
		512)
		    # The Pentium II case...
		    ALLOC="@SMLalloc=512k"
		    ;;
		*)
		    ;;
	    esac
	fi
    fi
fi

if [ "$RUN" = "" ]; then
  #
  # Construct the runtime system path from the ARCH and OS
  #
  RUN="$RUN_DIR/run.$ARCH-$OPSYS"
  if [ ! -x "$RUN" ]; then
    if [ "$ALT_OPSYS" = "" ]; then
      echo "$CMD: cannot find runtime system $RUN"
      exit 1
    else
      RUN="$RUN_DIR/run.$ARCH-$ALT_OPSYS"
      if [ ! -x "$RUN" ]; then
	echo "$CMD: cannot find runtime system $RUN"
	exit 1
      fi
    fi
  fi
fi

if [ "$HEAP" = "" ]; then
  #
  # Construct the heap image path from the APPL and ARCH
  #
  if [ "$APPL" = "" ]; then
    APPL=$CMD
  fi
  HEAP="@SMLload=$HEAP_DIR/$APPL"
fi

#
# run the sucker!
#
exec $RUN @SMLcmdname=$0 $HEAP $ALLOC $ARGS

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0