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

SCM Repository

[smlnj] Diff of /sml/trunk/config/_ml-build
ViewVC logotype

Diff of /sml/trunk/config/_ml-build

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 569, Tue Mar 7 04:01:07 2000 UTC revision 1342, Mon Aug 11 20:46:00 2003 UTC
# Line 1  Line 1 
1  #!@SHELL@  #!@SHELL@
2    
3    if [ x${SMLNJ_HOME} = x ] ; then
4  BIN_DIR=@BINDIR@  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    
13  SML=$BIN_DIR/sml  SML=$BIN_DIR/sml
14  LINK=$BIN_DIR/.link-sml  LINK=$BIN_DIR/.link-sml
# Line 11  Line 19 
19  smlfile=$xx-export.sml  smlfile=$xx-export.sml
20  cmfile=$xx-export.cm  cmfile=$xx-export.cm
21  listfile=$xx-BOOTLIST  listfile=$xx-BOOTLIST
22  mlscript=$xx-script  linkargsfile=$xx-LINKARGS
23    
24  trap 'rm -rf `find . -name $smlfile` $cmfile $listfile $mlscript' 0 1 2 3 15  dulist=''
25    
26    trap 'rm -rf $smlfile $cmfile $listfile $linkargsfile' 0 1 2 3 15
27    
28  usage() {  usage() {
29      echo ${thisscript}: $*      echo ${thisscript}: $*
# Line 21  Line 31 
31      exit 1      exit 1
32  }  }
33    
34    while [ $# != 0 ] ; do
35        case $1 in
36        -D*|-U*|-C*)
37            dulist="$dulist $1"
38            shift
39            ;;
40        *)
41            break
42            ;;
43        esac
44    done
45    
46  if [ $# != 3 ] ; then  if [ $# != 3 ] ; then
47      usage wrong number of arguments      usage wrong number of arguments
48  fi  fi
# Line 36  Line 58 
58  EOF  EOF
59    
60  cat >$cmfile <<EOF  cat >$cmfile <<EOF
61  Group structure ${rare} is basis.cm ${root} ${smlfile}  Group structure ${rare} is \$/basis.cm ${root} ${smlfile}
62  EOF  EOF
63    
64  cat >$mlscript <<EOF  # Invoke sml with special option that causes CM to do its magic.
65  ignore (OS.Process.exit ((case CM.mk_standalone NONE "${cmfile}" of  # Unless the heap image exists and is up-to-date CM will write the arguments
66     NONE => OS.Process.failure  # for the link script into $linkargsfile.
67   | SOME l => let val s = TextIO.openOut "${listfile}"  # (See src/cm/main/cm-boot.sml [function "mlbuild"] for details.)
68                   fun wr str = TextIO.output (s, str ^ "\n")  if $SML $dulist @CMbuild $root $cmfile $heap $listfile $linkargsfile ; then
69                   val n = length l      if [ -r $linkargsfile ]; then
70                   fun maxsz (s, n) = Int.max (size s, n)          $LINK `cat $linkargsfile`
                  val m = foldl maxsz 0 l  
    in wr (concat ["%", Int.toString n, " ", Int.toString m]);  
       app wr l;  
       TextIO.closeOut s;  
       OS.Process.success  
    end)  
    handle _ => OS.Process.failure))  
 EOF  
   
 if $SML full-cm.cm <$mlscript ; then  
     $LINK @SMLboot=$listfile $  
 else  
     echo Compilation failed.  
     exit 1  
71  fi  fi
72    fi
73    
74    exit $?

Legend:
Removed from v.569  
changed lines
  Added in v.1342

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