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/trunk/_ml-build
ViewVC logotype

Annotation of /config/trunk/_ml-build

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : blume 537 #!@SHELL@
2 :    
3 : blume 1261 if [ x${SMLNJ_HOME} = x ] ; then
4 : mblume 1725 BIN_DIR="@BINDIR@"
5 : blume 1261 else
6 : mblume 1725 if [ x"$CM_PATHCONFIG" = x ] ; then
7 : blume 1261 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 1494 trap 'rm -rf $smlfile $cmfile $listfile $linkargsfile @CMDIRARC@/*/$smlfile' 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 : mblume 1656 if [ $# = 3 ] ; then
47 :     setup=
48 :     root=$1
49 :     main=$2
50 :     heap=$3
51 :     elif [ $# = 4 ] ; then
52 :     setup=$1
53 :     root=$2
54 :     main=$3
55 :     heap=$4
56 :     else
57 : blume 537 usage wrong number of arguments
58 :     fi
59 :    
60 :     rare=XYZ_XXX_0123
61 :    
62 :     cat >$smlfile <<EOF
63 :     structure ${rare} = struct val _ = SMLofNJ.exportFn ("${heap}", ${main}) end
64 :     EOF
65 :    
66 :     cat >$cmfile <<EOF
67 : blume 644 Group structure ${rare} is \$/basis.cm ${root} ${smlfile}
68 : blume 537 EOF
69 :    
70 : blume 716 # Invoke sml with special option that causes CM to do its magic.
71 : mblume 1342 # Unless the heap image exists and is up-to-date CM will write the arguments
72 :     # for the link script into $linkargsfile.
73 :     # (See src/cm/main/cm-boot.sml [function "mlbuild"] for details.)
74 : mblume 1725 if "$SML" $dulist @CMbuild $setup "$root" "$cmfile" "$heap" "$listfile" "$linkargsfile"
75 : mblume 1656 then
76 : mblume 1725 if [ -r "$linkargsfile" ]; then
77 :     "$LINK" `cat "$linkargsfile"`
78 : mblume 1342 fi
79 : mblume 1480 else
80 :     exit $?
81 : mblume 1342 fi

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