SCM Repository
Annotation of /branches/vis12/config/install-sml-wrapper_sh.in
Parent Directory
|
Revision Log
Revision 123 -
(view)
(download)
Original Path: trunk/config/install-sml-wrapper_sh.in
1 : | jhr | 123 | #!/bin/sh |
2 : | # | ||
3 : | # COPYRIGHT (c) 2006 The SML/NJ Fellowship. | ||
4 : | # | ||
5 : | # @configure_input@ | ||
6 : | # | ||
7 : | # a general-purpose script for installing executable wrappers for SML/NJ | ||
8 : | # programs. | ||
9 : | # | ||
10 : | # install-sml-wrapper.sh <program-name> <install-dir> | ||
11 : | |||
12 : | INSTALL="@INSTALL@" | ||
13 : | INSTALL_DATA="@INSTALL_DATA@" | ||
14 : | HEAP_SUFFIX="@SMLNJ_HEAP_SUFFIX@" | ||
15 : | |||
16 : | if test $# -ne 2 ; then | ||
17 : | echo "usage: install-sml-wrapper.sh <program-name> <install-dir>" | ||
18 : | exit 1 | ||
19 : | fi | ||
20 : | |||
21 : | SRC=$1 | ||
22 : | TARGET=`basename $SRC` | ||
23 : | HEAP_IMAGE=$SRC.$HEAP_SUFFIX | ||
24 : | INSTALL_DIR=$2 | ||
25 : | INSTALL_HEAP_DIR=$INSTALL_DIR/.heap | ||
26 : | INSTALL_HEAP_IMAGE=$INSTALL_HEAP_DIR/$TARGET.$HEAP_SUFFIX | ||
27 : | |||
28 : | if test ! -f $HEAP_IMAGE ; then | ||
29 : | echo "heap image $HEAP_IMAGE not found" | ||
30 : | exit 1 | ||
31 : | fi | ||
32 : | |||
33 : | # create the wrapper script | ||
34 : | # | ||
35 : | cat > $TARGET <<XXXX | ||
36 : | #!/bin/sh | ||
37 : | # | ||
38 : | exec @SMLNJ_CMD@ @SMLcmdname=\$0 @SMLload=$INSTALL_HEAP_IMAGE \$@ | ||
39 : | XXXX | ||
40 : | |||
41 : | #install the script and heap image | ||
42 : | # | ||
43 : | $INSTALL $TARGET $INSTALL_DIR/$TARGET || exit 1 | ||
44 : | if test ! -d $INSTALL_HEAP_DIR ; then | ||
45 : | mkdir $INSTALL_HEAP_DIR || exit 1 | ||
46 : | fi | ||
47 : | $INSTALL_DATA $HEAP_IMAGE $INSTALL_HEAP_IMAGE || exit 1 | ||
48 : | |||
49 : | # remove the local copy of the script | ||
50 : | rm -f $TARGET | ||
51 : | |||
52 : | exit 0 | ||
53 : |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |