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

SCM Repository

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

Diff of /config/trunk/_run-sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 569, Tue Mar 7 04:01:07 2000 UTC revision 1368, Sat Sep 13 04:44:43 2003 UTC
# Line 21  Line 21 
21  #  #
22    
23  # the path of the directory in which executables (like this file) are kept.  # the path of the directory in which executables (like this file) are kept.
24    if [ x${SMLNJ_HOME} = x ] ; then
25  BIN_DIR=@BINDIR@  BIN_DIR=@BINDIR@
26  if [ ! -d "$BIN_DIR" ]; then  if [ ! -d "$BIN_DIR" ]; then
27      cmddir=`dirname $0`      cmddir=`dirname $0`
# Line 29  Line 30 
30          * ) BIN_DIR=`cd $cmddir; pwd` ;;          * ) BIN_DIR=`cd $cmddir; pwd` ;;
31      esac      esac
32  fi  fi
33    else
34        if [ x${CM_PATHCONFIG} = x ] ; then
35            CM_PATHCONFIG=${SMLNJ_HOME}/lib/pathconfig
36            export CM_PATHCONFIG
37        fi
38        BIN_DIR=${SMLNJ_HOME}/bin
39    fi
40    
41  # the path of the directory in which the runtime system executables are kept.  # the path of the directory in which the runtime system executables are kept.
42  RUN_DIR=$BIN_DIR/.run  RUN_DIR=$BIN_DIR/.run
# Line 53  Line 61 
61  #############################################################################  #############################################################################
62    
63  # special shortcut for frequent use (and for Linux' binfmt)  # special shortcut for frequent use (and for Linux' binfmt)
64  case "$1" in /* | ./* | ../* ) HEAP="@SMLload=$1"; shift ;; esac  if [ `basename $0` = sml ] ; then
65        case "$1" in
66            /* | ./* | ../* )
67                case "$1" in
68                    *.cm | *.sml | *.sig | *.fun )
69                        ;;
70                    * )
71                        HEAP="@SMLload=$1"
72                        shift
73                        ;;
74                esac
75                ;;
76        esac
77    fi
78    
79  ALLOC=""  ALLOC=""
80    
81  #  #
82  # Process command line arguments  # Process command line arguments
83  #  #
 ARGS=""  
84  while [ "$#" != "0" ]; do  while [ "$#" != "0" ]; do
85    arg=$1; shift    arg=$1
86    case $arg in    case $arg in
87      @SMLrun=*)      @SMLrun=*)
88          shift
89        RUN=`echo $arg | sed 's/@SMLrun=//'`        RUN=`echo $arg | sed 's/@SMLrun=//'`
90        ;;        ;;
91      @SMLload=*)      @SMLload=*)
92        HEAP=$arg;        shift
93          HEAP=$arg
94        ;;        ;;
95      @SMLappl)      @SMLappl)
96          shift
97        if [ "$#" = "0" ]; then        if [ "$#" = "0" ]; then
98          echo "$CMD: missing argument for @SMLappl option"          echo "$CMD: missing argument for @SMLappl option"
99          exit 1          exit 1
100        fi        fi
101        APPL=$1; shift        APPL=$1
102          shift
103        ;;        ;;
104      @SMLversion)      @SMLversion)
105        echo "$CMD @VERSION@"        echo "$CMD @VERSION@"
106        exit 0        exit 0
107        ;;        ;;
108      @SMLalloc=*)      @SMLalloc=*)
109          shift
110        ALLOC=$arg        ALLOC=$arg
111        ;;        ;;
112      *)      *)
113        ARGS="$ARGS $arg"        break
114        ;;        ;;
115    esac    esac
116  done  done
# Line 100  Line 125 
125          # "head" is called to make sure we consider only one matching line.          # "head" is called to make sure we consider only one matching line.
126          # (On linux SMP systems there is more than one such line.)          # (On linux SMP systems there is more than one such line.)
127          cache=`fgrep 'cache size' </proc/cpuinfo | head -1`          cache=`fgrep 'cache size' </proc/cpuinfo | head -1`
128          if [ $? = 0 ] ; then          if [ "x$cache" = "x" ] ; then
129                # No cache info in /proc/cputype.  No we are checking the CPU
130                # type....
131                cpu=`fgrep 'cpu     ' </proc/cpuinfo | head -1`
132                cputype=`echo $cpu | sed -e 's/^.*:[ \t]*\(.*\)$/\1/'`
133                case $cputype in
134                    586)
135                        # An old Pentium.  Seems to work best with 64k.
136                        # Some extreme cases run best with even less
137                        #  (32k, 16k, or even just 8k).
138                        ALLOC="@SMLalloc=64k"
139                        ;;
140                    *)
141                        ;;
142                esac
143            else
144              kb=`echo $cache | sed -e 's/^[^0-9]*\([0-9]*\).*$/\1/'`              kb=`echo $cache | sed -e 's/^[^0-9]*\([0-9]*\).*$/\1/'`
145              case $kb in              case $kb in
146                  128)                  128)
147                      # This is the Celeron case.                      # This is the Celeron case.
148                      ALLOC="@SMLalloc=32k"                      # ALLOC="@SMLalloc=32k"
149                        ALLOC="@SMLalloc=64k"
150                      ;;                      ;;
151                  256)                  256)
152                      # Do CPUs like this exist?                      # Do CPUs like this exist?
# Line 113  Line 154 
154                      ;;                      ;;
155                  512)                  512)
156                      # The Pentium II case...                      # The Pentium II case...
157                      ALLOC="@SMLalloc=512k"                      ALLOC="@SMLalloc=256k"
158                      ;;                      ;;
159                  *)                  *)
160                      ;;                      ;;
# Line 154  Line 195 
195  #  #
196  # run the sucker!  # run the sucker!
197  #  #
198  exec $RUN @SMLcmdname=$0 $HEAP $ALLOC $ARGS  exec $RUN @SMLcmdname=$0 $HEAP $ALLOC "$@"

Legend:
Removed from v.569  
changed lines
  Added in v.1368

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