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

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

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

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