SCM Repository
Annotation of /sml/branches/SMLNJ/config/_run-sml
Parent Directory
|
Revision Log
Revision 211 - (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 : | |||
26 : | # the path of the directory in which the runtime system executables are kept. | ||
27 : | RUN_DIR=$BIN_DIR/.run | ||
28 : | |||
29 : | # the path of the directory in which the heap images are kept. | ||
30 : | HEAP_DIR=$BIN_DIR/.heap | ||
31 : | |||
32 : | # | ||
33 : | # the following could be replaced with some site specific code | ||
34 : | # | ||
35 : | ARCH_N_OPSYS=`$BIN_DIR/.arch-n-opsys` | ||
36 : | if [ "$?" != "0" ]; then | ||
37 : | echo "$CMD: unable to determine architecture/operating system" | ||
38 : | exit 1 | ||
39 : | fi | ||
40 : | eval $ARCH_N_OPSYS | ||
41 : | |||
42 : | ############################################################################# | ||
43 : | # | ||
44 : | # END SITE SPECIFIC STUFF | ||
45 : | # | ||
46 : | ############################################################################# | ||
47 : | |||
48 : | # | ||
49 : | # Process command line arguments | ||
50 : | # | ||
51 : | ARGS="" | ||
52 : | while [ "$#" != "0" ]; do | ||
53 : | arg=$1; shift | ||
54 : | case $arg in | ||
55 : | @SMLrun=*) | ||
56 : | RUN=`echo $arg | sed 's/@SMLrun=//'` | ||
57 : | ;; | ||
58 : | @SMLload=*) | ||
59 : | HEAP=$arg; | ||
60 : | ;; | ||
61 : | @SMLappl) | ||
62 : | if [ "$#" = "0" ]; then | ||
63 : | echo "$CMD: missing argument for @SMLappl option" | ||
64 : | exit 1 | ||
65 : | fi | ||
66 : | APPL=$1; shift | ||
67 : | ;; | ||
68 : | @SMLversion) | ||
69 : | echo "$CMD @VERSION@" | ||
70 : | exit 0 | ||
71 : | ;; | ||
72 : | *) | ||
73 : | ARGS="$ARGS $arg" | ||
74 : | ;; | ||
75 : | esac | ||
76 : | done | ||
77 : | |||
78 : | if [ "$RUN" = "" ]; then | ||
79 : | # | ||
80 : | # Construct the runtime system path from the ARCH and OS | ||
81 : | # | ||
82 : | RUN="$RUN_DIR/run.$ARCH-$OPSYS" | ||
83 : | if [ ! -x "$RUN" ]; then | ||
84 : | if [ "$ALT_OPSYS" = "" ]; then | ||
85 : | echo "$CMD: cannot find runtime system $RUN" | ||
86 : | exit 1 | ||
87 : | else | ||
88 : | RUN="$RUN_DIR/run.$ARCH-$ALT_OPSYS" | ||
89 : | if [ ! -x "$RUN" ]; then | ||
90 : | echo "$CMD: cannot find runtime system $RUN" | ||
91 : | exit 1 | ||
92 : | fi | ||
93 : | fi | ||
94 : | fi | ||
95 : | fi | ||
96 : | |||
97 : | if [ "$HEAP" = "" ]; then | ||
98 : | # | ||
99 : | # Construct the heap image path from the APPL and ARCH | ||
100 : | # | ||
101 : | if [ "$APPL" = "" ]; then | ||
102 : | APPL=$CMD | ||
103 : | fi | ||
104 : | HEAP="@SMLload=$HEAP_DIR/$APPL" | ||
105 : | fi | ||
106 : | |||
107 : | # | ||
108 : | # run the sucker! | ||
109 : | # | ||
110 : | exec $RUN @SMLcmdname=$0 $HEAP $ARGS |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |