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

Diff of /config/trunk/install.sh

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

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

Legend:
Removed from v.411  
changed lines
  Added in v.1794

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