Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /config/releases/release-110.66/_ml-build
ViewVC logotype

Annotation of /config/releases/release-110.66/_ml-build

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1342 - (view) (download)
Original Path: sml/trunk/config/_ml-build

1 : blume 537 #!@SHELL@
2 :    
3 : blume 1261 if [ x${SMLNJ_HOME} = x ] ; then
4 :     BIN_DIR=@BINDIR@
5 :     else
6 :     if [ x${CM_PATHCONFIG} = x ] ; then
7 :     CM_PATHCONFIG=${SMLNJ_HOME}/lib/pathconfig
8 :     export CM_PATHCONFIG
9 :     fi
10 :     BIN_DIR=${SMLNJ_HOME}/bin
11 :     fi
12 : blume 537
13 :     SML=$BIN_DIR/sml
14 :     LINK=$BIN_DIR/.link-sml
15 :    
16 :     thisscript=$0
17 :    
18 :     xx=$$
19 :     smlfile=$xx-export.sml
20 :     cmfile=$xx-export.cm
21 :     listfile=$xx-BOOTLIST
22 : mblume 1342 linkargsfile=$xx-LINKARGS
23 : blume 537
24 : blume 692 dulist=''
25 :    
26 : mblume 1342 trap 'rm -rf $smlfile $cmfile $listfile $linkargsfile' 0 1 2 3 15
27 : blume 537
28 :     usage() {
29 :     echo ${thisscript}: $*
30 :     echo Usage: $thisscript root-group main-function heapfile
31 :     exit 1
32 :     }
33 :    
34 : blume 692 while [ $# != 0 ] ; do
35 :     case $1 in
36 : blume 1126 -D*|-U*|-C*)
37 : blume 692 dulist="$dulist $1"
38 :     shift
39 :     ;;
40 :     *)
41 :     break
42 :     ;;
43 :     esac
44 :     done
45 :    
46 : blume 537 if [ $# != 3 ] ; then
47 :     usage wrong number of arguments
48 :     fi
49 :    
50 :     root=$1
51 :     main=$2
52 :     heap=$3
53 :    
54 :     rare=XYZ_XXX_0123
55 :    
56 :     cat >$smlfile <<EOF
57 :     structure ${rare} = struct val _ = SMLofNJ.exportFn ("${heap}", ${main}) end
58 :     EOF
59 :    
60 :     cat >$cmfile <<EOF
61 : blume 644 Group structure ${rare} is \$/basis.cm ${root} ${smlfile}
62 : blume 537 EOF
63 :    
64 : blume 716 # Invoke sml with special option that causes CM to do its magic.
65 : mblume 1342 # Unless the heap image exists and is up-to-date CM will write the arguments
66 :     # for the link script into $linkargsfile.
67 :     # (See src/cm/main/cm-boot.sml [function "mlbuild"] for details.)
68 :     if $SML $dulist @CMbuild $root $cmfile $heap $listfile $linkargsfile ; then
69 :     if [ -r $linkargsfile ]; then
70 :     $LINK `cat $linkargsfile`
71 :     fi
72 :     fi
73 : blume 537
74 : blume 692 exit $?

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