Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/vis15/config/install-sml-wrapper_sh.in
ViewVC logotype

Annotation of /branches/vis15/config/install-sml-wrapper_sh.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5083 - (view) (download)

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 : jhr 5083 exec @SMLNJ_CMD@ @SMLcmdname=\$0 @SMLload=$INSTALL_HEAP_IMAGE "\$@"
39 : jhr 123 XXXX
40 :    
41 :     #install the script and heap image
42 :     #
43 : jhr 2456 if test ! -d $INSTALL_DIR ; then
44 :     mkdir -p $INSTALL_DIR || exit 1
45 :     fi
46 : jhr 123 $INSTALL $TARGET $INSTALL_DIR/$TARGET || exit 1
47 :     if test ! -d $INSTALL_HEAP_DIR ; then
48 : jhr 2456 mkdir -p $INSTALL_HEAP_DIR || exit 1
49 : jhr 123 fi
50 :     $INSTALL_DATA $HEAP_IMAGE $INSTALL_HEAP_IMAGE || exit 1
51 :    
52 :     # remove the local copy of the script
53 :     rm -f $TARGET
54 :    
55 :     exit 0
56 :    

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