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

SCM Repository

[diderot] View of /trunk/config/install-sml-wrapper_sh.in
ViewVC logotype

View of /trunk/config/install-sml-wrapper_sh.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2660 - (download) (annotate)
Fri May 30 14:43:18 2014 UTC (5 years, 1 month ago) by jhr
File size: 1156 byte(s)
  porting changes from staging to trunk
#!/bin/sh
#
# COPYRIGHT (c) 2006 The SML/NJ Fellowship.
#
# @configure_input@
#
# a general-purpose script for installing executable wrappers for SML/NJ
# programs.
#
#	install-sml-wrapper.sh <program-name> <install-dir>

INSTALL="@INSTALL@"
INSTALL_DATA="@INSTALL_DATA@"
HEAP_SUFFIX="@SMLNJ_HEAP_SUFFIX@"

if test $# -ne 2 ; then
  echo "usage: install-sml-wrapper.sh <program-name> <install-dir>"
  exit 1
fi

SRC=$1
TARGET=`basename $SRC`
HEAP_IMAGE=$SRC.$HEAP_SUFFIX
INSTALL_DIR=$2
INSTALL_HEAP_DIR=$INSTALL_DIR/.heap
INSTALL_HEAP_IMAGE=$INSTALL_HEAP_DIR/$TARGET.$HEAP_SUFFIX

if test ! -f $HEAP_IMAGE ; then
  echo "heap image $HEAP_IMAGE not found"
  exit 1
fi

# create the wrapper script
#
cat > $TARGET <<XXXX
#!/bin/sh
#
exec @SMLNJ_CMD@ @SMLcmdname=\$0 @SMLload=$INSTALL_HEAP_IMAGE \$@
XXXX

#install the script and heap image
#
if test ! -d $INSTALL_DIR ; then
  mkdir -p $INSTALL_DIR || exit 1
fi
$INSTALL $TARGET $INSTALL_DIR/$TARGET || exit 1
if test ! -d $INSTALL_HEAP_DIR ; then
  mkdir -p $INSTALL_HEAP_DIR || exit 1
fi
$INSTALL_DATA $HEAP_IMAGE $INSTALL_HEAP_IMAGE || exit 1

# remove the local copy of the script
rm -f $TARGET

exit 0


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