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/install.sh
ViewVC logotype

Diff of /sml/trunk/config/install.sh

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

sml/branches/SMLNJ/config/install.sh revision 249, Sat Apr 17 18:57:03 1999 UTC sml/trunk/config/install.sh revision 1725, Tue Dec 14 23:23:41 2004 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/sh
2  #  #
3  # Copyright (c) 1994 AT&T Bell Laboratories.  # Copyright (c) 1994 AT&T Bell Laboratories.
4    # Copyright (c) 2003 The Fellowship of SML/NJ
5  #  #
6  # installation script for SML/NJ and related tools; this is a temporary  # Installation script for SML/NJ and related tools; this is a temporary
7  # placeholder until the configuration tool is finished.  # placeholder until the configuration tool is finished.
8  #  #
9    # Significant changes to take advantage of a new portable installer
10  #set -x  # script for everything after booting the interactive system.
   
11  #  #
12  # get the target list  # Author: Matthias Blume (blume@tti-c.org)
13  #  #
14  if [ ! -r config/targets ]; then  
15    echo "!!! no target list"  if [ x${INSTALL_QUIETLY} = xtrue ] ; then
16    exit 1;      export CM_VERBOSE
17        CM_VERBOSE=false
18  fi  fi
 . config/targets  
19    
20  #  vsay() {
21  # some OSs have make in strange places      if [ x${INSTALL_DEBUG} = xtrue ] ; then
22  #          echo "$@"
23  MAKE=make      elif [ x${INSTALL_QUIETLY} = xtrue ] ; then
24            :
25        else
26            echo "$@"
27        fi
28    }
29    
30    complain() {
31        echo "$@"
32        exit 1
33    }
34    
35    this=$0
36    
37    
38  #  #
39  # command for building SML libraries; this should be either  # create the preloads.standard file
 # "CM.recompile()" or "CM.stabilize true".  The latter builds  
 # stable libraries, which may be somewhat faster to use.  
40  #  #
41  #CM_MAKE_LIB="CM.recompile();"  if [ ! -r config/preloads ]; then
42  CM_MAKE_LIB="CM.stabilize true;"      complain "$this: !!! File config/preloads is missing."
43    fi
44    cp config/preloads preloads.standard
45    
46  #  #
47  # check for ksh  # Some OSs have make in strange places, but most of the time it is
48    # simply on the PATH:
49  #  #
50  # ksh causes some people problems so we will always use /bin/sh  MAKE=make
51  #  
 #echo "checking for ksh"  
 #if [ -x /bin/ksh ]; then  
 #  SHELL=/bin/ksh  
 #elif [ -x /usr/local/bin/ksh ]; then  
 #  SHELL=/usr/local/bin/ksh  
 #else  
52    SHELL=/bin/sh    SHELL=/bin/sh
53  #fi  vsay $this: Using shell $SHELL.
 echo "  using $SHELL"  
54    
55  #  #
56  # set the SML root directory  # set the SML root directory
57  #  #
58  REAL_PWD=`pwd`  REAL_PWD=`pwd`
59  ROOT=${PWD:-$REAL_PWD}  ROOT=${PWD:-$REAL_PWD}
60  echo "SML root is $ROOT"  vsay $this: SML root is $ROOT.
61    
62    cd "${INSTALLDIR:=$ROOT}"
63    INSTALLDIR=`pwd`
64    cd "$ROOT"
65    vsay $this: Installation directory is ${INSTALLDIR}.
66    
67  #  #
68  # set the various directory pathname variables  # set the various directory and file pathname variables
69  #  #
70  BINDIR=$ROOT/bin  BINDIR=$INSTALLDIR/bin          # main dir for binary stuff
71  CONFIGDIR=$ROOT/config  CONFIGDIR=$ROOT/config
72  HEAPDIR=$BINDIR/.heap  HEAPDIR=$BINDIR/.heap           # where heap images live
73  RUNDIR=$BINDIR/.run  RUNDIR=$BINDIR/.run             # where executables (i.e., the RTS) live
74  SRCDIR=$ROOT/src  SRCDIR=$ROOT/src                # where the source tree is rooted
75  LIBDIR=$ROOT/lib  LIBDIR=$INSTALLDIR/lib          # where libraries live
76    
77  #  #
78  # the paths to ml-yacc and ml-lex; needed to configure CM  # files to be deleted after we are done...
79  #  #
80  YACCPATH=$BINDIR/ml-yacc  tmpfiles=""
81  LEXPATH=$BINDIR/ml-lex  tmpfiles="$tmpfiles preloads.standard"
82  BURGPATH=$BINDIR/ml-burg  #
83    # make sure we always clean up after ourselves...
84    #
85    trap 'cd "$ROOT"; rm -f $tmpfiles' 0 1 2 3 15
86    
87    
88  #  #
89  # set the CM configuration variables (these are environment variables  # set the CM configuration variables (these are environment variables
90  # that will be queried by the bootstrap code)  # that will be queried by the bootstrap code)
91  #  -M.Blume (5/1998)  # Especially important is CM_PATHCONFIG.
92  #  #
93  CM_YACC_DEFAULT=$YACCPATH  export CM_PATHCONFIG
94  CM_LEX_DEFAULT=$LEXPATH  CM_PATHCONFIG=$LIBDIR/pathconfig
 CM_BURG_DEFAULT=$BURGPATH  
 CM_PATH_DEFAULT=.:$LIBDIR  
 export CM_YACC_DEFAULT CM_LEX_DEFAULT CM_BURG_DEFAULT CM_PATH_DEFAULT  
95    
96  #  #
97  # the release version that we are installing  # the release version that we are installing
98  #  #
99  VERSION=`cat $CONFIGDIR/version`  VERSION=`cat "$CONFIGDIR/version"`
100  echo "installing version $VERSION"  vsay $this: Installing version $VERSION.
101    
102  #  #
103  # create the various sub directories  # the URL for the (usually remote) source archive
104  #  #
105  for dir in $BINDIR $HEAPDIR $RUNDIR $LIBDIR $SRCDIR  . "$CONFIGDIR"/srcarchiveurl
106  do  vsay $this: URL of source archive is $SRCARCHIVEURL.
107    if [ -d $dir ]; then  
108      echo "$dir already exists"  #
109    else  # Function to make a directory including its ancestors.
110      echo "creating $dir"  #
111      mkdir $dir  makedir() {
112      if [ $? != "0" ]; then      if [ x"$1" = x ] ; then
113        echo "unable to create $dir"          :
114        exit 1      elif [ -d "$1" ] ; then
115            :
116        else
117            makedirtmp=`dirname "$1"`
118            makedir "$makedirtmp"
119            if [ x${INSTALL_VERBOSE} = xtrue ] ; then
120                vsay "$this: Making directory $1"
121      fi      fi
122            if mkdir "$1" ; then
123                :
124            else
125                complain "$this: !!! Unable to make directory $1!"
126    fi    fi
127  done      fi
128    }
129    
130  #  #
131  # install the script that tests the architecture, and make sure that it works  # Fish out the CM metadata directory name from library files
132    # and store it in ORIG_CM_DIR_ARC.
133    # The single argument is the name of the directory containing
134    # a single subdirectory which is a CM metadata directory:
135  #  #
136  if [ -x $BINDIR/.arch-n-opsys ]; then  fish() {
137    echo "$BINDIR/.arch-n-opsys already exists"      cd "$1"
138        ORIG_CM_DIR_ARC=unknown
139        for i in * .[a-zA-Z0-9]* ; do
140            if [ -d $i ] ; then
141                ORIG_CM_DIR_ARC=$i
142                break
143            fi
144        done
145        if [ $ORIG_CM_DIR_ARC = unknown ] ; then
146            complain "$this: could not determine CM metadata directory name"
147  else  else
148    cat $CONFIGDIR/_arch-n-opsys | sed -e "s,@SHELL@,$SHELL,g" > $BINDIR/.arch-n-opsys          echo "$this: CM metadata directory name is \"${ORIG_CM_DIR_ARC}\""
149    chmod 555 $BINDIR/.arch-n-opsys      fi
150    if [ ! -x $BINDIR/.arch-n-opsys ]; then  }
151      echo "!!! installation of $BINDIR/.arch-n-opsys failed for some reason"  
152      exit 1  
153    # A function to move all stable library files to a parallel directory
154    # hierarchy.
155    # The first argument must be a simple path (no / inside), and
156    # the second argument must be an absolute path.
157    move() {
158        if [ -L "$1" ] ; then
159            rm -f "$1"           # remove symbolic link made by diracs (see below)
160        elif [ -d "$1" ] ; then
161            if [ ! -d "$2" ] ; then
162                if [ -f "$2" ] ; then
163                    complain $this: $2 exists as a non-directory.
164                fi
165                mkdir "$2"
166            fi
167            cd "$1"
168            for i in * .[a-zA-Z0-9]* ; do
169                move "$i" "$2"/"$i"
170            done
171            cd ..
172        elif [ -f "$1" ] ; then
173            rm -f "$2"
174            mv "$1" "$2"
175        fi
176    }
177    
178    #
179    # Traverse the directory tree rooted at $3 (must be single arc!).
180    # Find all directories named $1, rename them into $2 and make
181    # and establish $1 as a symbolic link to $2:
182    #
183    dirarcs() {
184        if [ -d "$3" ] ; then
185            if [ "$3" = "$1" ] ; then
186                mv "$1" "$2"
187                ln -s "$2" "$1"
188            else
189                cd "$3"
190                for d in * .[a-zA-Z0-9]* ; do
191                    dirarcs "$1" "$2" "$d"
192                done
193                cd ..
194    fi    fi
195  fi  fi
196  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`  }
197    
198    
199    ######################################################################
200    
201    #
202    # create the various sub directories
203    #
204    for dir in "$BINDIR" "$HEAPDIR" "$RUNDIR" "$LIBDIR" "$SRCDIR" ; do
205        makedir "$dir"
206    done
207    
208    #
209    # Function to install a "driver" script...
210    #   This takes care of patching the source of the script with the SHELL,
211    #   BINDIR, and VERSION variables to use.
212    #
213    installdriver() {
214        dsrc=$1
215        ddst=$2
216    # We install the driver unconditionally. (It would be better to test
217    # for an outdated driver script, but not all "test" commands understand
218    # the -nt comparison operator....)
219    #   if [ -x $BINDIR/$ddst ]; then
220    #       echo $this: Script $BINDIR/$ddst already exists.
221    #   else
222            rm -f "$BINDIR"/"$ddst"
223            cat "$CONFIGDIR"/"$dsrc" | \
224            sed -e "s,@SHELL@,$SHELL,g" \
225                -e "s,@BINDIR@,$BINDIR," \
226                -e "s,@VERSION@,$VERSION," \
227                -e "s,@CMDIRARC@,${CM_DIR_ARC:-dummy}," \
228                > "$BINDIR"/"$ddst"
229            chmod 555 "$BINDIR"/"$ddst"
230            if [ ! -x "$BINDIR"/"$ddst" ]; then
231                complain "$this: !!! Installation of $BINDIR/${ddst} failed."
232            fi
233    #   fi
234    }
235    
236    #
237    # install the script that tests architecture and os...
238    #
239    installdriver _arch-n-opsys .arch-n-opsys
240    
241    #
242    # run it to figure out what architecture and os we are using, define
243    # corresponding variables...
244    #
245    ARCH_N_OPSYS=`"$BINDIR"/.arch-n-opsys`
246  if [ "$?" != "0" ]; then  if [ "$?" != "0" ]; then
247    echo "!!! $BINDIR/.arch-n-opsys fails on this machine"      echo "$this: !!! Script $BINDIR/.arch-n-opsys fails on this machine."
248    echo "!!! you must patch this by hand and repeat the installation"      echo "$this: !!! You must patch this by hand and repeat the installation."
249    exit 2    exit 2
250  else  else
251    echo "$BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS"      vsay $this: Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.
252  fi  fi
253  eval $ARCH_N_OPSYS  eval $ARCH_N_OPSYS
254    
255  if [ -x $BINDIR/.run-sml ]; then  #
256    echo "$BINDIR/.run-sml already exists"  # now install most of the other driver scripts
257  else  #  (except ml-build, since we don't know $CM_DIR_ARC yet)
258    cat $CONFIGDIR/_run-sml | \  #
259      sed -e "s,@SHELL@,$SHELL,g" -e "s,@BINDIR@,$BINDIR," -e "s,@VERSION@,$VERSION," \  installdriver _run-sml .run-sml
260      > $BINDIR/.run-sml  installdriver _link-sml .link-sml
261    chmod 555 $BINDIR/.run-sml  installdriver _ml-makedepend ml-makedepend
   if [ ! -x $BINDIR/.run-sml ]; then  
     echo "!!! installation of $BINDIR/.run-sml failed for some reason"  
     exit 1  
   fi  
 fi  
262    
263  #  #
264  # set some architecture dependent run-time system flags  # set some architecture dependent run-time system flags
265  #  #
266  case $ARCH in  case $ARCH in
267    mips*) ALLOC=1M ;;      mips*)
268            ALLOC=1M
269            ;;
270    x86)    x86)
271            # The following is the _wrong_ value for many popular x86 chips
272            # (i.e., Celerons).  However, the optimal value for those is 32k,
273            # and such a small value is not enough for the runtime system's boot
274            # code.  Therefore, we use 256k here and re-set it to the proper
275            # value in .run-sml.
276      ALLOC=256k      ALLOC=256k
277    ;;    ;;
278    alpha32)    alpha32)
# Line 155  Line 282 
282      ALLOC=512k      ALLOC=512k
283    ;;    ;;
284  esac  esac
285    
286  case $OPSYS in  case $OPSYS in
287    solaris)    solaris)
288      MAKE=/usr/ccs/bin/make      MAKE=/usr/ccs/bin/make
# Line 162  Line 290 
290    linux)    linux)
291      EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`      EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`
292      if [ "$?" != "0" ]; then      if [ "$?" != "0" ]; then
293        echo "problems checking for underscores in global names"              complain "$this: !!! Problems checking for underscores in asm names."
       exit 1  
294      fi      fi
295      EXTRA_DEFS="XDEFS=$EXTRA_DEFS"      EXTRA_DEFS="XDEFS=$EXTRA_DEFS"
296    ;;    ;;
# Line 172  Line 299 
299  #  #
300  # the name of the bin files directory  # the name of the bin files directory
301  #  #
302  BIN_FILES=bin.$ARCH-unix  BOOT_ARCHIVE=boot.$ARCH-unix
303    BOOT_FILES=sml.$BOOT_ARCHIVE
304    
305  #  #
306  # build the run-time system  # build the run-time system
307  #  #
308  $CONFIGDIR/unpack.sh "run-time" $SRCDIR runtime $ROOT/$VERSION-runtime.tar  if [ -x "$RUNDIR"/run.$ARCH-$OPSYS ]; then
309  if [ "$?" != "0" ]; then      vsay $this: Run-time system already exists.
310    exit $?  else
311  fi      "$CONFIGDIR"/unpack "$ROOT" runtime
312  if [ ! -x $RUNDIR/run.$ARCH-$OPSYS ]; then      cd "$SRCDIR"/runtime/objs
313    cd $SRCDIR/runtime/objs      echo $this: Compiling the run-time system.
   echo "compiling the run-time system"  
314    $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS    $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
315    if [ -x run.$ARCH-$OPSYS ]; then    if [ -x run.$ARCH-$OPSYS ]; then
316      mv run.$ARCH-$OPSYS $RUNDIR          mv run.$ARCH-$OPSYS "$RUNDIR"
317      $MAKE MAKE=$MAKE clean      $MAKE MAKE=$MAKE clean
318    else    else
319      echo "!!! run-time system build failed for some reason"          complain "$this: !!! Run-time system build failed for some reason."
     exit 1  
320    fi    fi
321  fi  fi
322  cd $SRCDIR  cd "$SRCDIR"
323    
324  #  #
325  # boot the base SML system  # boot the base SML system
326  #  #
327  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then  if [ -r "$HEAPDIR"/sml.$HEAP_SUFFIX ]; then
328    echo "$HEAPDIR/sml.$HEAP_SUFFIX already exists"      vsay $this: Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.
329        fish "$LIBDIR"/basis.cm
330        # ignore requested arc name since we have to live with what is there:
331        export CM_DIR_ARC
332        CM_DIR_ARC=$ORIG_CM_DIR_ARC
333  else  else
334    $CONFIGDIR/unpack.sh bin $ROOT $BIN_FILES $ROOT/$VERSION-$BIN_FILES.tar      "$CONFIGDIR"/unpack "$ROOT" "$BOOT_ARCHIVE"
335    cd $ROOT  
336    $RUNDIR/run.$ARCH-$OPSYS @SMLboot=$ROOT/$BIN_FILES @SMLalloc=$ALLOC <<XXXX      fish "$ROOT"/"$BOOT_FILES"/basis.cm
337      $SET_FLAGS  
338      val use = Compiler.Interact.useFile      cd "$ROOT"
339      val _ = (SMLofNJ.exportML "sml";  
340               print Compiler.banner;      # Target arc:
341               print "\n");      export CM_DIR_ARC
342  XXXX      CM_DIR_ARC=${CM_DIR_ARC:-".cm"}
343    if [ -r sml.$HEAP_SUFFIX ]; then  
344      mv sml.$HEAP_SUFFIX $HEAPDIR      if [ $CM_DIR_ARC = $ORIG_CM_DIR_ARC ] ; then
345      cd $BINDIR          : we are happy
     ln -s .run-sml sml  
346    else    else
347      echo "!!! unable to build SML heap image (sml.$HEAP_SUFFIX)"          # now we have to make a symbolic link for each occurrence of
348      exit 1          # $ORIG_CM_DIR_ARC to $CM_DIR_ARC
349    fi          dirarcs "$ORIG_CM_DIR_ARC" "$CM_DIR_ARC" "$BOOT_FILES"
350  fi  fi
351    
352        cd "$ROOT"/"$BOOT_FILES"
353    
354        # now link (boot) the system and let it initialize itself...
355        if "$BINDIR"/.link-sml @SMLheap="$ROOT"/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC
356        then
357            cd "$ROOT"
358            if [ -r sml.$HEAP_SUFFIX ]; then
359                mv sml.$HEAP_SUFFIX "$HEAPDIR"
360                cd "$BINDIR"
361                ln -s .run-sml sml
362  #  #
363  # now build the individual targets              # Now move all stable libraries to #LIBDIR and generate
364                # the pathconfig file.
365  #  #
366  cd $SRCDIR              cd "$ROOT"/"$BOOT_FILES"
367  echo "install targets"              for anchor in * ; do
368  for i in $TARGETS                  if [ -d $anchor ] ; then
369  do                      echo $anchor $anchor >>$CM_PATHCONFIG
370    if [ $i = "doc" ]; then                      move $anchor "$LIBDIR"/$anchor
     TARGET=$i  
   else  
     TARGET=$i.$HEAP_SUFFIX  
   fi  
   if [ -r $HEAPDIR/$TARGET ]; then  
     echo "$TARGET already exists"  
   else  
     echo "  building $TARGET"  
     case $i in  
       src-smlnj)  
         for src in compiler comp-lib cm MLRISC; do  
           $CONFIGDIR/unpack.sh $src $ROOT/src $src $ROOT/$VERSION-$src.tar  
         done  
       ;;  
       sml-full)  
         if [ ! -d $ROOT/$BIN_FILES ]; then  
           echo "!!! bin files are missing; build of $TARGET failed"  
           exit 1  
         else  
           cd $ROOT  
           $RUNDIR/run.$ARCH-$OPSYS @SMLfull @SMLboot=$ROOT/$BIN_FILES @SMLalloc=$ALLOC <<XXXX  
             $SET_FLAGS  
             val use = Compiler.Interact.useFile  
             val _ = (SMLofNJ.exportML "sml-full";  
                      print Compiler.banner;  
                      print " [full]\n");  
 XXXX  
           if [ -r sml-full.$HEAP_SUFFIX ]; then  
             mv sml-full.$HEAP_SUFFIX $HEAPDIR  
             cd $BINDIR  
             ln -s .run-sml sml-full  
           else  
             echo "!!! unable to build SML-FULL heap image"  
             exit 1  
           fi  
         fi  
       ;;  
       ml-yacc)  
         $CONFIGDIR/unpack.sh ML-Yacc $SRCDIR ml-yacc $ROOT/$VERSION-ml-yacc.tar  
         if [ "$?" != "0" ]; then  
           exit $?  
         fi  
         cd $SRCDIR/ml-yacc  
         ./build  
         if [ -r src/$TARGET ]; then  
           mv src/$TARGET $HEAPDIR  
           if [ ! -f $BINDIR/$i ]; then  
             cd $BINDIR  
             ln -s .run-sml $i  
           fi  
         else  
           echo "!!! build of $TARGET failed"  
           exit 1  
         fi  
       ;;  
       ml-lex)  
         $CONFIGDIR/unpack.sh ML-Lex $SRCDIR ml-lex $ROOT/$VERSION-ml-lex.tar  
         if [ "$?" != "0" ]; then  
           exit $?  
         fi  
         cd $SRCDIR/ml-lex  
         ./build  
         if [ -r $TARGET ]; then  
           mv $TARGET $HEAPDIR  
           if [ ! -f $BINDIR/$i ]; then  
             cd $BINDIR  
             ln -s .run-sml $i  
           fi  
         else  
           echo "!!! build of $TARGET failed"  
           exit 1  
         fi  
       ;;  
       ml-burg)  
         $CONFIGDIR/unpack.sh ML-Burg $SRCDIR ml-burg $ROOT/$VERSION-ml-burg.tar  
         if [ "$?" != "0" ]; then  
           exit $?  
         fi  
         cd $SRCDIR/ml-burg  
         ./build  
         if [ -r $TARGET ]; then  
           mv $TARGET $HEAPDIR  
           if [ ! -f $BINDIR/$i ]; then  
             cd $BINDIR  
             ln -s .run-sml $i  
371            fi            fi
372                done
373                cd "$ROOT"
374                # $BOOT_FILES is now only an empty skeleton, let's get rid of it.
375                rm -rf "$BOOT_FILES"
376    
377          else          else
378            echo "!!! build of $TARGET failed"              complain "$this !!! No heap image generated (sml.$HEAP_SUFFIX)."
           exit 1  
         fi  
       ;;  
       smlnj-lib)  
         $CONFIGDIR/unpack.sh "SML/NJ Library" $SRCDIR smlnj-lib $ROOT/$VERSION-smlnj-lib.tar  
         if [ "$?" != "0" ]; then  
           exit $?  
         fi  
       # make the Util library  
         cd $SRCDIR/smlnj-lib/Util  
         echo "$CM_MAKE_LIB" | $BINDIR/sml  
         if [ ! -f $LIBDIR/smlnj-lib.cm ]; then  
           cd $LIBDIR  
           echo "Alias $SRCDIR/smlnj-lib/Util/sources.cm" > smlnj-lib.cm  
         fi  
       # make the Unix library  
         cd $SRCDIR/smlnj-lib/Unix  
         echo "$CM_MAKE_LIB" | $BINDIR/sml  
         if [ ! -f $LIBDIR/unix-lib.cm ]; then  
           cd $LIBDIR  
           echo "Alias $SRCDIR/smlnj-lib/Unix/sources.cm" > unix-lib.cm  
         fi  
       # make the HTML library  
         cd $SRCDIR/smlnj-lib/HTML  
         echo "$CM_MAKE_LIB" | $BINDIR/sml  
         if [ ! -f $LIBDIR/html-lib.cm ]; then  
           cd $LIBDIR  
           echo "Alias $SRCDIR/smlnj-lib/HTML/sources.cm" > html-lib.cm  
         fi  
       # make the Reactive library  
         cd $SRCDIR/smlnj-lib/Reactive  
         echo "$CM_MAKE_LIB" | $BINDIR/sml  
         if [ ! -f $LIBDIR/reactive-lib.cm ]; then  
           cd $LIBDIR  
           echo "Alias $SRCDIR/smlnj-lib/Reactive/sources.cm" > reactive-lib.cm  
         fi  
       # make the PP library  
         cd $SRCDIR/smlnj-lib/PP  
         echo "$CM_MAKE_LIB" | $BINDIR/sml  
         if [ ! -f $LIBDIR/pp-lib.cm ]; then  
           cd $LIBDIR  
           echo "Alias $SRCDIR/smlnj-lib/PP/sources.cm" > pp-lib.cm  
         fi  
       # make the RegExp library  
         cd $SRCDIR/smlnj-lib/RegExp  
         echo "$CM_MAKE_LIB" | $BINDIR/sml  
         if [ ! -f $LIBDIR/regexp-lib.cm ]; then  
           cd $LIBDIR  
           echo "Alias $SRCDIR/smlnj-lib/RegExp/sources.cm" > regexp-lib.cm  
         fi  
       ;;  
       ml-yacc-lib)  
         $CONFIGDIR/unpack.sh ML-Yacc $SRCDIR ml-yacc $ROOT/$VERSION-ml-yacc.tar  
         if [ "$?" != "0" ]; then  
           exit $?  
         fi  
         cd $SRCDIR/ml-yacc/lib  
         echo "$CM_MAKE_LIB" | $BINDIR/sml  
         if [ ! -f $LIBDIR/ml-yacc-lib.cm ]; then  
           cd $LIBDIR  
           echo "Alias $SRCDIR/ml-yacc/lib/sources.cm" > ml-yacc-lib.cm  
         fi  
       ;;  
       cml)  
         $CONFIGDIR/unpack.sh CML $SRCDIR cml $ROOT/$VERSION-cml.tar  
         if [ "$?" != "0" ]; then  
           exit $?  
         fi  
         cd $SRCDIR/cml/src  
         echo "$CM_MAKE_LIB" | $BINDIR/sml  
         if [ ! -f $LIBDIR/cml.cm ]; then  
           cd $LIBDIR  
           echo "Alias $SRCDIR/cml/src/sources.cm" > cml.cm  
         fi  
       ;;  
       cml-lib)  
         $CONFIGDIR/unpack.sh CML $SRCDIR cml $ROOT/$VERSION-cml.tar  
         if [ "$?" != "0" ]; then  
           exit $?  
         fi  
         cd $SRCDIR/cml/cml-lib  
         echo "$CM_MAKE_LIB" | $BINDIR/sml  
         if [ ! -f $LIBDIR/cml-lib.cm ]; then  
           cd $LIBDIR  
           echo "Alias $SRCDIR/cml/cml-lib/sources.cm" > cml-lib.cm  
         fi  
       ;;  
       cml-cm)  
         CMD="CM.autoloading(SOME true); CM.clearAutoList();"  
         CMD="$CMD CM.autoload'(\"$LIBDIR/cml.cm\");"  
         if [ "$AUTOLOAD_CML_LIB" = "TRUE" ]; then  
           CMD="$CMD CM.autoload'(\"$LIBDIR/cml-lib.cm\");"  
         fi  
         if [ "$AUTOLOAD_EXENE" = "TRUE" ]; then  
           CMD="$CMD CM.autoload'(\"$LIBDIR/eXene.cm\");"  
         fi  
         cd $ROOT  
         $BINDIR/sml <<XXXX  
           $CMD  
           val _ = (SMLofNJ.exportML "$i";  
                 print CML.banner;  
                 print "[CML autoload]\n");  
 XXXX  
         if [ -r $TARGET ]; then  
           mv $TARGET $HEAPDIR  
           if [ ! -f $BINDIR/$i ]; then  
             cd $BINDIR  
             ln -s .run-sml $i  
379            fi            fi
380          else          else
381            echo "!!! unable to build autoloading CML"          complain "$this !!! Boot code failed, no heap image (sml.$HEAP_SUFFIX)."
           exit 1  
         fi  
       ;;  
       eXene)  
         $CONFIGDIR/unpack.sh EXene $SRCDIR eXene $ROOT/$VERSION-eXene.tar  
         if [ "$?" != "0" ]; then  
           exit $?  
382          fi          fi
         cd $SRCDIR/eXene  
         echo "$CM_MAKE_LIB" | $BINDIR/sml  
         if [ ! -f $LIBDIR/eXene.cm ]; then  
           cd $LIBDIR  
           echo "Alias $SRCDIR/eXene/sources.cm" > eXene.cm  
383          fi          fi
       ;;  
       doc)  
         $CONFIGDIR/unpack.sh Doc $ROOT doc $ROOT/$VERSION-doc.tar  
         if [ "$?" != "0" ]; then  
           exit $?  
         fi  
         cd $ROOT/doc  
         build $ROOT  
       ;;  
       *)  
         echo "!!! unknown target $i"  
       ;;  
     esac  
   fi  
 done  
384    
385  if [ "$ENABLE_AUTOLOADING" = "TRUE" ]; then  #
386    CMD="CM.autoloading(SOME true); CM.clearAutoList();"  # now that we know CM_DIR_ARC we can install the ml-build driver...
387    if [ "$AUTOLOAD_SMLNJ_LIB" = "TRUE" ]; then  #
388      CMD="$CMD CM.autoload'(\"$LIBDIR/smlnj-lib.cm\");"  installdriver _ml-build ml-build
389    fi  
390    if [ "$AUTOLOAD_SMLNJ_UNIX" = "TRUE" ]; then  cd "$ROOT"
391      CMD="$CMD CM.autoload'(\"$LIBDIR/unix-lib.cm\");"  
392    fi  #
393    if [ "$AUTOLOAD_SMLNJ_HTML" = "TRUE" ]; then  # Now do all the rest using the precompiled installer:
394      CMD="$CMD CM.autoload'(\"$LIBDIR/html-lib.cm\");"  #
395    fi  echo $this: Installing other libraries and programs:
396    if [ "$AUTOLOAD_SMLNJ_REACTIVE" = "TRUE" ]; then  export ROOT INSTALLDIR CONFIGDIR BINDIR
397      CMD="$CMD CM.autoload'(\"$LIBDIR/reactive-lib.cm\");"  if "$BINDIR"/sml -m \$smlnj/installer.cm
398    fi  then
399    if [ "AUTOLOAD_SMLNJ_PP" = "TRUE" ]; then      vsay $this: Installation complete.
     CMD="$CMD CM.autoload'(\"$LIBDIR/pp-lib.cm\");"  
   fi  
   if [ "AUTOLOAD_SMLNJ_REGEXP" = "TRUE" ]; then  
     CMD="$CMD CM.autoload'(\"$LIBDIR/regexp-lib.cm\");"  
   fi  
   cd $ROOT  
   $BINDIR/sml <<XXXX  
     $CMD  
     val _ = (SMLofNJ.exportML "sml";  
              print Compiler.banner;  
              print " [CM; autoload enabled]\n");  
 XXXX  
   if [ -r sml.$HEAP_SUFFIX ]; then  
     mv sml.$HEAP_SUFFIX $HEAPDIR  
400    else    else
401      echo "!!! unable to build SML with autoloading"      complain "$this: !!! Installation of libraries and programs failed."
     exit 1  
   fi  
402  fi  fi
403    
404    exit 0

Legend:
Removed from v.249  
changed lines
  Added in v.1725

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