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 /config/releases/release-110.71/_ml-build
ViewVC logotype

Diff of /config/releases/release-110.71/_ml-build

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

sml/trunk/config/_ml-build revision 569, Tue Mar 7 04:01:07 2000 UTC config/trunk/_ml-build revision 2275, Tue Jan 30 17:00:52 2007 UTC
# Line 1  Line 1 
1  #!@SHELL@  #!@SHELL@
2    
3  BIN_DIR=@BINDIR@  if [ x${SMLNJ_HOME} = x ] ; then
4        BIN_DIR="@BINDIR@"
5        LIB_DIR="@LIBDIR"
6    else
7        BIN_DIR=${SMLNJ_HOME}/bin
8        LIB_DIR=${SMLNJ_HOME}/lib
9    fi
10    
11    if [ x"$CM_PATHCONFIG" = x ] ; then
12        CM_PATHCONFIG=${LIB_DIR}/pathconfig
13        export CM_PATHCONFIG
14    fi
15    
16  SML=$BIN_DIR/sml  SML=$BIN_DIR/sml
17  LINK=$BIN_DIR/.link-sml  LINK=$BIN_DIR/.link-sml
# Line 11  Line 22 
22  smlfile=$xx-export.sml  smlfile=$xx-export.sml
23  cmfile=$xx-export.cm  cmfile=$xx-export.cm
24  listfile=$xx-BOOTLIST  listfile=$xx-BOOTLIST
25  mlscript=$xx-script  linkargsfile=$xx-LINKARGS
26    
27  trap 'rm -rf `find . -name $smlfile` $cmfile $listfile $mlscript' 0 1 2 3 15  dulist=''
28    
29    trap 'rm -rf $smlfile $cmfile $listfile $linkargsfile @CMDIRARC@/*/$smlfile' 0 1 2 3 15
30    
31  usage() {  usage() {
32      echo ${thisscript}: $*      echo ${thisscript}: $*
33      echo Usage: $thisscript root-group main-function heapfile      echo Usage: $thisscript '[-S setup] root-group [main-function [heapfile]]'
34      exit 1      exit 1
35  }  }
36    
37  if [ $# != 3 ] ; then  setup=
     usage wrong number of arguments  
 fi  
38    
39    while [ $# != 0 ] ; do
40        case $1 in
41        -D*|-U*|-C*)
42            dulist="$dulist $1"
43            shift
44            ;;
45        -S)
46            shift
47            if [ $# = 0 ] ; then
48                usage missing argument for -S
49            fi
50            setup=$1
51            shift
52            ;;
53        *)
54            break
55            ;;
56        esac
57    done
58    
59    if [ $# = 4 ] ; then
60        setup=$1
61        root=$2
62        main=$3
63        heap=$4
64    elif [ $# = 3 ] ; then
65  root=$1  root=$1
66  main=$2  main=$2
67  heap=$3  heap=$3
68    elif [ $# = 2 ] ; then
69        root=$1
70        main=$2
71        heap=`basename "$root" .cm`
72    elif [ $# = 1 ] ; then
73        root=$1
74        # quick hack for now:
75        main=Test.main
76        heap=`basename "$root" .cm`
77    else
78        usage no CM description file specified
79    fi
80    
81  rare=XYZ_XXX_0123  rare=XYZ_XXX_0123
82    
# Line 36  Line 85 
85  EOF  EOF
86    
87  cat >$cmfile <<EOF  cat >$cmfile <<EOF
88  Group structure ${rare} is basis.cm ${root} ${smlfile}  Group structure ${rare} is \$/basis.cm ${root} ${smlfile}
89  EOF  EOF
90    
91  cat >$mlscript <<EOF  # Invoke sml with special option that causes CM to do its magic.
92  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
93     NONE => OS.Process.failure  # for the link script into $linkargsfile.
94   | SOME l => let val s = TextIO.openOut "${listfile}"  # (See src/cm/main/cm-boot.sml [function "mlbuild"] for details.)
95                   fun wr str = TextIO.output (s, str ^ "\n")  if "$SML" $dulist @CMbuild $setup "$root" "$cmfile" "$heap" "$listfile" "$linkargsfile"
96                   val n = length l  then
97                   fun maxsz (s, n) = Int.max (size s, n)      if [ -r "$linkargsfile" ]; then
98                   val m = foldl maxsz 0 l          "$LINK" `cat "$linkargsfile"`
99     in wr (concat ["%", Int.toString n, " ", Int.toString m]);      fi
       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 $  
100  else  else
101      echo Compilation failed.      exit $?
     exit 1  
102  fi  fi

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

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