SCM Repository
Annotation of /sml/trunk/config/_run-sml
Parent Directory
|
Revision Log
Revision 214 - (view) (download)
1 : | monnier | 211 | #!@SHELL@ |
2 : | # | ||
3 : | # The standard driver for SML/NJ under the new runtime system | ||
4 : | # | ||
5 : | |||
6 : | CMD=`basename $0` | ||
7 : | |||
8 : | # | ||
9 : | # for /bin/ksh, disable reading user's environment file | ||
10 : | # | ||
11 : | unset ENV | ||
12 : | |||
13 : | ############################################################################# | ||
14 : | # | ||
15 : | # BEGIN SITE SPECIFIC STUFF | ||
16 : | # | ||
17 : | ############################################################################# | ||
18 : | |||
19 : | # | ||
20 : | # SITE SPECIFIC CONFIGURATION INFO | ||
21 : | # | ||
22 : | |||
23 : | # the path of the directory in which executables (like this file) are kept. | ||
24 : | BIN_DIR=@BINDIR@ | ||
25 : | monnier | 214 | if [ ! -d "$BIN_DIR" ]; then |
26 : | cmddir=`dirname $0` | ||
27 : | case "$cmddir" in | ||
28 : | /* ) BIN_DIR="$cmddir";; | ||
29 : | * ) BIN_DIR=`cd $cmddir; pwd` ;; | ||
30 : | esac | ||
31 : | fi | ||
32 : | monnier | 211 | |
33 : | # the path of the directory in which the runtime system executables are kept. | ||
34 : | RUN_DIR=$BIN_DIR/.run | ||
35 : | |||
36 : | # the path of the directory in which the heap images are kept. | ||
37 : | HEAP_DIR=$BIN_DIR/.heap | ||
38 : | |||
39 : | # | ||
40 : | # the following could be replaced with some site specific code | ||
41 : | # | ||
42 : | ARCH_N_OPSYS=`$BIN_DIR/.arch-n-opsys` | ||
43 : | if [ "$?" != "0" ]; then | ||
44 : | echo "$CMD: unable to determine architecture/operating system" | ||
45 : | exit 1 | ||
46 : | fi | ||
47 : | eval $ARCH_N_OPSYS | ||
48 : | |||
49 : | ############################################################################# | ||
50 : | # | ||
51 : | # END SITE SPECIFIC STUFF | ||
52 : | # | ||
53 : | ############################################################################# | ||
54 : | |||
55 : | monnier | 214 | # special shortcut for frequent use (and for Linux' binfmt) |
56 : | case "$1" in /* | ./* | ../* ) HEAP="@SMLload=$1"; shift ;; esac | ||
57 : | |||
58 : | monnier | 211 | # |
59 : | # Process command line arguments | ||
60 : | # | ||
61 : | ARGS="" | ||
62 : | while [ "$#" != "0" ]; do | ||
63 : | arg=$1; shift | ||
64 : | case $arg in | ||
65 : | @SMLrun=*) | ||
66 : | RUN=`echo $arg | sed 's/@SMLrun=//'` | ||
67 : | ;; | ||
68 : | @SMLload=*) | ||
69 : | HEAP=$arg; | ||
70 : | ;; | ||
71 : | @SMLappl) | ||
72 : | if [ "$#" = "0" ]; then | ||
73 : | echo "$CMD: missing argument for @SMLappl option" | ||
74 : | exit 1 | ||
75 : | fi | ||
76 : | APPL=$1; shift | ||
77 : | ;; | ||
78 : | @SMLversion) | ||
79 : | echo "$CMD @VERSION@" | ||
80 : | exit 0 | ||
81 : | ;; | ||
82 : | *) | ||
83 : | ARGS="$ARGS $arg" | ||
84 : | ;; | ||
85 : | esac | ||
86 : | done | ||
87 : | |||
88 : | if [ "$RUN" = "" ]; then | ||
89 : | # | ||
90 : | # Construct the runtime system path from the ARCH and OS | ||
91 : | # | ||
92 : | RUN="$RUN_DIR/run.$ARCH-$OPSYS" | ||
93 : | if [ ! -x "$RUN" ]; then | ||
94 : | if [ "$ALT_OPSYS" = "" ]; then | ||
95 : | echo "$CMD: cannot find runtime system $RUN" | ||
96 : | exit 1 | ||
97 : | else | ||
98 : | RUN="$RUN_DIR/run.$ARCH-$ALT_OPSYS" | ||
99 : | if [ ! -x "$RUN" ]; then | ||
100 : | echo "$CMD: cannot find runtime system $RUN" | ||
101 : | exit 1 | ||
102 : | fi | ||
103 : | fi | ||
104 : | fi | ||
105 : | fi | ||
106 : | |||
107 : | if [ "$HEAP" = "" ]; then | ||
108 : | # | ||
109 : | # Construct the heap image path from the APPL and ARCH | ||
110 : | # | ||
111 : | if [ "$APPL" = "" ]; then | ||
112 : | APPL=$CMD | ||
113 : | fi | ||
114 : | HEAP="@SMLload=$HEAP_DIR/$APPL" | ||
115 : | fi | ||
116 : | |||
117 : | # | ||
118 : | # run the sucker! | ||
119 : | # | ||
120 : | exec $RUN @SMLcmdname=$0 $HEAP $ARGS |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |