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

revision 249, Sat Apr 17 18:57:03 1999 UTC revision 429, Wed Sep 8 09:47:00 1999 UTC
# Line 12  Line 12 
12  # get the target list  # get the target list
13  #  #
14  if [ ! -r config/targets ]; then  if [ ! -r config/targets ]; then
15    echo "!!! no target list"    echo "!!! File config/targets is missing."
16    exit 1;    exit 1;
17  fi  fi
18  . config/targets  . config/targets
# Line 23  Line 23 
23  MAKE=make  MAKE=make
24    
25  #  #
 # command for building SML libraries; this should be either  
 # "CM.recompile()" or "CM.stabilize true".  The latter builds  
 # stable libraries, which may be somewhat faster to use.  
 #  
 #CM_MAKE_LIB="CM.recompile();"  
 CM_MAKE_LIB="CM.stabilize true;"  
   
 #  
26  # check for ksh  # check for ksh
27  #  #
28  # ksh causes some people problems so we will always use /bin/sh  # ksh causes some people problems so we will always use /bin/sh
# Line 43  Line 35 
35  #else  #else
36    SHELL=/bin/sh    SHELL=/bin/sh
37  #fi  #fi
38  echo "  using $SHELL"  echo Using shell $SHELL.
39    
40  #  #
41  # set the SML root directory  # set the SML root directory
42  #  #
43  REAL_PWD=`pwd`  REAL_PWD=`pwd`
44  ROOT=${PWD:-$REAL_PWD}  ROOT=${PWD:-$REAL_PWD}
45  echo "SML root is $ROOT"  echo SML root is $ROOT.
46    
47  #  #
48  # set the various directory pathname variables  # set the various directory and file pathname variables
49  #  #
50  BINDIR=$ROOT/bin  BINDIR=$ROOT/bin                # main dir for binary stuff
51  CONFIGDIR=$ROOT/config  CONFIGDIR=$ROOT/config
52  HEAPDIR=$BINDIR/.heap  HEAPDIR=$BINDIR/.heap           # where heap images live
53  RUNDIR=$BINDIR/.run  RUNDIR=$BINDIR/.run             # where executables (i.e., the RTS) live
54  SRCDIR=$ROOT/src  SRCDIR=$ROOT/src                # where the source tree is rooted
55  LIBDIR=$ROOT/lib  LIBDIR=$ROOT/lib                # where libraries live
56    LIBLIST=$ROOT/liblist           # list of commands to stabilize libraries
57    LIBMOVESCRIPT=$ROOT/libmove     # a temporary script
58    LOCALPATHCONFIG=$ROOT/pathconfig # a temporary pathconfig file
59    
60  #  #
61  # the paths to ml-yacc and ml-lex; needed to configure CM  # the paths to ml-yacc, ml-burg, and ml-lex; needed to configure CM
62  #  #
63  YACCPATH=$BINDIR/ml-yacc  YACCPATH=$BINDIR/ml-yacc
64  LEXPATH=$BINDIR/ml-lex  LEXPATH=$BINDIR/ml-lex
# Line 72  Line 67 
67  #  #
68  # set the CM configuration variables (these are environment variables  # set the CM configuration variables (these are environment variables
69  # that will be queried by the bootstrap code)  # that will be queried by the bootstrap code)
70  #  -M.Blume (5/1998)  # Especially important is CM_PATHCONFIG_DEFAULT.
71  #  #
72  CM_YACC_DEFAULT=$YACCPATH  CM_YACC_DEFAULT=$YACCPATH
73  CM_LEX_DEFAULT=$LEXPATH  CM_LEX_DEFAULT=$LEXPATH
74  CM_BURG_DEFAULT=$BURGPATH  CM_BURG_DEFAULT=$BURGPATH
75  CM_PATH_DEFAULT=.:$LIBDIR  CM_PATHCONFIG_DEFAULT=$LIBDIR/pathconfig
76  export CM_YACC_DEFAULT CM_LEX_DEFAULT CM_BURG_DEFAULT CM_PATH_DEFAULT  export CM_YACC_DEFAULT CM_LEX_DEFAULT CM_BURG_DEFAULT CM_PATHCONFIG_DEFAULT
77    
78  #  #
79  # the release version that we are installing  # the release version that we are installing
80  #  #
81  VERSION=`cat $CONFIGDIR/version`  VERSION=`cat $CONFIGDIR/version`
82  echo "installing version $VERSION"  echo Installing version $VERSION.
83    
84  #  #
85  # create the various sub directories  # Function to make a directory (and advertise such action).
86  #  #
87  for dir in $BINDIR $HEAPDIR $RUNDIR $LIBDIR $SRCDIR  makedir() {
88  do      if [ ! -d $1 ] ; then
89    if [ -d $dir ]; then          echo Making directory $1
90      echo "$dir already exists"          if mkdir $1 ; then
91                : everything is fine
92    else    else
93      echo "creating $dir"              echo "!!! Unable to make directory $1!"
     mkdir $dir  
     if [ $? != "0" ]; then  
       echo "unable to create $dir"  
94        exit 1        exit 1
95      fi      fi
96    fi    fi
97    }
98    
99    #
100    # Function to unpack a source archive.
101    #
102    # $1: descriptive name of the sources to be unpacked
103    # $2: the directory into which to unpack the sources
104    # $3: the sub-directory of $2 that is going to be created by unpacking
105    # $4: the basename of the source archive (the script will check several
106    #     different suffixes to determine what kind of de-compression is to
107    #     be used)
108    unpack() {
109        if [ ! -d $2/$3 ]; then
110            echo Unpacking $1 source files.
111            cd $2
112            if [ -r $4.tar.Z ] ; then
113                zcat $4.tar.Z | tar -xf -
114            elif [ -r $4.tar ] ; then
115                tar -xf $4.tar
116            elif [ -r $4.tar.gz ] ; then
117                gunzip -c $4.tar.gz | tar -xf -
118            elif [ -r $4.tar.bz2 ] ; then
119                bunzip2 -c $4.tar.bz2 | tar -xf -
120            elif [ -r $4.tgz ] ; then
121                gunzip -c $4.tgz | tar -xf -
122            elif [ -r $4.tz ] ; then
123                zcat $4.tz | tar -xf -
124            else
125                echo "!!! The $1 source files are missing."
126                exit 1
127            fi
128            if [ ! -d $2/$3 ]; then
129                echo "!!! Unable to unpack $1 source files."
130                exit 1
131            fi
132        fi
133    }
134    
135    #
136    # Move the stable archive of a library whose description file was $1/$2 to
137    # $LIBDIR/$2/CM/$ARCH-unix/$2 so that it appears as if the description file
138    # had been at $LIBDIR/$2/$2
139    #
140    movelib() {
141        if [ -f $1/CM/$ARCH-unix/$2 ] ; then
142            echo Moving library $2 to $LIBDIR.
143            makedir $LIBDIR/$2
144            makedir $LIBDIR/$2/CM
145            makedir $LIBDIR/$2/CM/$ARCH-unix
146            mv $1/CM/$ARCH-unix/$2 $LIBDIR/$2/CM/$ARCH-unix/$2
147        fi
148    }
149    
150    # A shell function that registers a library for being built.
151    # This function takes two arguments: 1. a name under which the library
152    # is to be known later (something.cm) and 2. the path relative to $SRCDIR
153    # that leads to the library's .cm file.  The library's .cm file must be the
154    # same as $1.
155    #
156    # This works by adding ML code to file $LIBLIST.  The code in this file
157    # will be executed near the end of this script.  If $MOVE_LIBRARIES is
158    # set to true, then reglib will also register a "movelib" to be executed at
159    # the end by putting a "movelib" line into $LIBMOVESCRIPT.
160    
161    reglib() {
162        if [ x$MOVE_LIBRARIES = xtrue ] ; then
163            FINALLOCATION=$LIBDIR/$1
164        else
165            FINALLOCATION=$SRCDIR/$2
166        fi
167        if [ -d $FINALLOCATION ] ; then
168            echo "Library $1 already exists in $FINALLOCATION."
169        else
170            echo "Scheduling library $1 to be built in $FINALLOCATION."
171            echo "andalso CM.stabilize false \"$1\"" >>$LIBLIST
172            echo $1 $SRCDIR/$2 >>$LOCALPATHCONFIG
173            if [ x$MOVE_LIBRARIES = xtrue ] ; then
174                echo movelib $SRCDIR/$2 $1 >>$LIBMOVESCRIPT
175            fi
176            echo $1 $FINALLOCATION >>$CM_PATHCONFIG_DEFAULT
177        fi
178    }
179    
180    #
181    # Function to build a standalone program such as ml-yacc.  The function takes
182    # 2 or 3 arguments.  First the name of the program with at the same time
183    # is the directory name under $SRCDIR where the sources reside.  The second
184    # argument is a descriptive name for the program (passed on to "unpack").
185    # The optional third argument specifies the path relative to $SRCDIR/$1
186    # of the directory where the program's heap image is to be found.
187    #
188    
189    standalone() {
190        TARGET=$1.$HEAP_SUFFIX
191        if [ $# = 3 ] ; then
192            TARGETLOC=$3/$TARGET
193        else
194            TARGETLOC=$TARGET
195        fi
196        if [ -r $HEAPDIR/$TARGET ] ; then
197            echo Target $TARGET already exists.
198        else
199            echo Building $TARGET.
200            unpack $2 $SRCDIR $1 $ROOT/$VERSION-$1
201            cd $SRCDIR/$1
202            ./build
203            if [ -r $TARGETLOC ] ; then
204                mv $TARGETLOC $HEAPDIR/$TARGET
205                if [ ! -f $BINDIR/$1 ] ; then
206                    cd $BINDIR
207                    ln -s .run-sml $1
208                fi
209            else
210                echo "!!! Build of $TARGET failed."
211            fi
212        fi
213    }
214    
215    #
216    # create the various sub directories
217    #
218    for dir in $BINDIR $HEAPDIR $RUNDIR $LIBDIR $SRCDIR
219    do
220        makedir $dir
221  done  done
222    
223    
# Line 108  Line 225 
225  # install the script that tests the architecture, and make sure that it works  # install the script that tests the architecture, and make sure that it works
226  #  #
227  if [ -x $BINDIR/.arch-n-opsys ]; then  if [ -x $BINDIR/.arch-n-opsys ]; then
228    echo "$BINDIR/.arch-n-opsys already exists"    echo Script $BINDIR/.arch-n-opsys already exists.
229  else  else
230    cat $CONFIGDIR/_arch-n-opsys | sed -e "s,@SHELL@,$SHELL,g" > $BINDIR/.arch-n-opsys    cat $CONFIGDIR/_arch-n-opsys | sed -e "s,@SHELL@,$SHELL,g" > $BINDIR/.arch-n-opsys
231    chmod 555 $BINDIR/.arch-n-opsys    chmod 555 $BINDIR/.arch-n-opsys
232    if [ ! -x $BINDIR/.arch-n-opsys ]; then    if [ ! -x $BINDIR/.arch-n-opsys ]; then
233      echo "!!! installation of $BINDIR/.arch-n-opsys failed for some reason"      echo "!!! Installation of $BINDIR/.arch-n-opsys failed for some reason."
234      exit 1      exit 1
235    fi    fi
236  fi  fi
237  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`
238  if [ "$?" != "0" ]; then  if [ "$?" != "0" ]; then
239    echo "!!! $BINDIR/.arch-n-opsys fails on this machine"    echo "!!! Script $BINDIR/.arch-n-opsys fails on this machine."
240    echo "!!! you must patch this by hand and repeat the installation"    echo "!!! You must patch this by hand and repeat the installation."
241    exit 2    exit 2
242  else  else
243    echo "$BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS"    echo Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.
244  fi  fi
245  eval $ARCH_N_OPSYS  eval $ARCH_N_OPSYS
246    
247  if [ -x $BINDIR/.run-sml ]; then  if [ -x $BINDIR/.run-sml ]; then
248    echo "$BINDIR/.run-sml already exists"    echo Script $BINDIR/.run-sml already exists.
249  else  else
250    cat $CONFIGDIR/_run-sml | \    cat $CONFIGDIR/_run-sml | \
251      sed -e "s,@SHELL@,$SHELL,g" -e "s,@BINDIR@,$BINDIR," -e "s,@VERSION@,$VERSION," \      sed -e "s,@SHELL@,$SHELL,g" -e "s,@BINDIR@,$BINDIR," -e "s,@VERSION@,$VERSION," \
252      > $BINDIR/.run-sml      > $BINDIR/.run-sml
253    chmod 555 $BINDIR/.run-sml    chmod 555 $BINDIR/.run-sml
254    if [ ! -x $BINDIR/.run-sml ]; then    if [ ! -x $BINDIR/.run-sml ]; then
255      echo "!!! installation of $BINDIR/.run-sml failed for some reason"      echo "!!! Installation of $BINDIR/.run-sml failed for some reason."
256      exit 1      exit 1
257    fi    fi
258  fi  fi
# Line 162  Line 279 
279    linux)    linux)
280      EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`      EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`
281      if [ "$?" != "0" ]; then      if [ "$?" != "0" ]; then
282        echo "problems checking for underscores in global names"        echo "!!! Problems checking for underscores in global names."
283        exit 1        exit 1
284      fi      fi
285      EXTRA_DEFS="XDEFS=$EXTRA_DEFS"      EXTRA_DEFS="XDEFS=$EXTRA_DEFS"
# Line 172  Line 289 
289  #  #
290  # the name of the bin files directory  # the name of the bin files directory
291  #  #
292  BIN_FILES=bin.$ARCH-unix  BOOT_FILES=comp.boot.$ARCH-unix
293    
294  #  #
295  # build the run-time system  # build the run-time system
296  #  #
297  $CONFIGDIR/unpack.sh "run-time" $SRCDIR runtime $ROOT/$VERSION-runtime.tar  unpack "run-time" $SRCDIR runtime $ROOT/$VERSION-runtime
 if [ "$?" != "0" ]; then  
   exit $?  
 fi  
298  if [ ! -x $RUNDIR/run.$ARCH-$OPSYS ]; then  if [ ! -x $RUNDIR/run.$ARCH-$OPSYS ]; then
299    cd $SRCDIR/runtime/objs    cd $SRCDIR/runtime/objs
300    echo "compiling the run-time system"    echo Compiling the run-time system.
301    $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS    $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
302    if [ -x run.$ARCH-$OPSYS ]; then    if [ -x run.$ARCH-$OPSYS ]; then
303      mv run.$ARCH-$OPSYS $RUNDIR      mv run.$ARCH-$OPSYS $RUNDIR
304      $MAKE MAKE=$MAKE clean      $MAKE MAKE=$MAKE clean
305    else    else
306      echo "!!! run-time system build failed for some reason"      echo "!!! Run-time system build failed for some reason."
307      exit 1      exit 1
308    fi    fi
309  fi  fi
# Line 199  Line 313 
313  # boot the base SML system  # boot the base SML system
314  #  #
315  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then
316    echo "$HEAPDIR/sml.$HEAP_SUFFIX already exists"    echo Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.
317  else  else
318    $CONFIGDIR/unpack.sh bin $ROOT $BIN_FILES $ROOT/$VERSION-$BIN_FILES.tar    unpack bin $ROOT $BOOT_FILES $ROOT/$VERSION-$BOOT_FILES
319    cd $ROOT    cd $ROOT
320    $RUNDIR/run.$ARCH-$OPSYS @SMLboot=$ROOT/$BIN_FILES @SMLalloc=$ALLOC <<XXXX    if $RUNDIR/run.$ARCH-$OPSYS @SMLheap=sml \
321      $SET_FLAGS          @SMLboot=$ROOT/$BOOT_FILES @SMLrtpid=`cat $BOOT_FILES/RTPID` \
322      val use = Compiler.Interact.useFile          @SMLalloc=$ALLOC
323      val _ = (SMLofNJ.exportML "sml";    then
              print Compiler.banner;  
              print "\n");  
 XXXX  
324    if [ -r sml.$HEAP_SUFFIX ]; then    if [ -r sml.$HEAP_SUFFIX ]; then
325      mv sml.$HEAP_SUFFIX $HEAPDIR      mv sml.$HEAP_SUFFIX $HEAPDIR
326      cd $BINDIR      cd $BINDIR
327      ln -s .run-sml sml      ln -s .run-sml sml
328    
329            #
330            # Now move all stable libraries to #LIBDIR and generate
331            # the pathconfig file.
332            #
333    
334            cd $ROOT/$BOOT_FILES
335            for lib in *.cm ; do
336                echo $lib $LIBDIR/$lib >>$CM_PATHCONFIG_DEFAULT
337                movelib $ROOT/$BOOT_FILES/$lib $lib
338            done
339            cd $ROOT
340            rm -rf $BOOT_FILES
341    
342        else
343            echo "!!! Boot code did not produce heap image (sml.$HEAP_SUFFIX)."
344            exit 1
345        fi
346    else    else
347      echo "!!! unable to build SML heap image (sml.$HEAP_SUFFIX)"      echo "!!! Boot code failed, no heap image built (sml.$HEAP_SUFFIX)."
348      exit 1      exit 1
349    fi    fi
350  fi  fi
351    
352    #
353    # Initialize $LIBLIST
354    #
355    cd $ROOT
356    rm -f $LOCALPATHCONFIG $LIBLIST
357    echo 'OS.Process.exit (if true' >$LIBLIST
358    
359  #  #
360  # now build the individual targets  # now build (or prepare to build) the individual targets
361  #  #
362  cd $SRCDIR  cd $SRCDIR
363  echo "install targets"  echo Installing other targets.
364  for i in $TARGETS  for i in $TARGETS ; do
 do  
   if [ $i = "doc" ]; then  
     TARGET=$i  
   else  
     TARGET=$i.$HEAP_SUFFIX  
   fi  
   if [ -r $HEAPDIR/$TARGET ]; then  
     echo "$TARGET already exists"  
   else  
     echo "  building $TARGET"  
365      case $i in      case $i in
366        src-smlnj)        src-smlnj)
367          for src in compiler comp-lib cm MLRISC; do          for src in compiler comp-lib cm MLRISC smlnj-lib ml-yacc system
368            $CONFIGDIR/unpack.sh $src $ROOT/src $src $ROOT/$VERSION-$src.tar          do
369                unpack $src $ROOT/src $src $ROOT/$VERSION-$src
370          done          done
371        ;;        ;;
       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  
       ;;  
372        ml-yacc)        ml-yacc)
373          $CONFIGDIR/unpack.sh ML-Yacc $SRCDIR ml-yacc $ROOT/$VERSION-ml-yacc.tar          standalone ml-yacc ML-Yacc src
         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  
374        ;;        ;;
375        ml-lex)        ml-lex)
376          $CONFIGDIR/unpack.sh ML-Lex $SRCDIR ml-lex $ROOT/$VERSION-ml-lex.tar          standalone ml-lex ML-Lex
         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  
377        ;;        ;;
378        ml-burg)        ml-burg)
379          $CONFIGDIR/unpack.sh ML-Burg $SRCDIR ml-burg $ROOT/$VERSION-ml-burg.tar          standalone ml-burg ML-Burg
         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  
380        ;;        ;;
381        smlnj-lib)        smlnj-lib)
382          $CONFIGDIR/unpack.sh "SML/NJ Library" $SRCDIR smlnj-lib $ROOT/$VERSION-smlnj-lib.tar          unpack "SML/NJ Library" $SRCDIR smlnj-lib $ROOT/$VERSION-smlnj-lib
383          if [ "$?" != "0" ]; then  
384            exit $?          # Don't make the Util library -- it came pre-made and has been
385          fi          # installed when making the base system.  In other words, don't do...
386        # make the Util library              #reglib smlnj-lib.cm smlnj-lib/Util
         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  
387        # make the Unix library        # make the Unix library
388          cd $SRCDIR/smlnj-lib/Unix              reglib unix-lib.cm smlnj-lib/Unix
389          echo "$CM_MAKE_LIB" | $BINDIR/sml          # make the INet library
390          if [ ! -f $LIBDIR/unix-lib.cm ]; then              reglib inet-lib.cm smlnj-lib/INet
           cd $LIBDIR  
           echo "Alias $SRCDIR/smlnj-lib/Unix/sources.cm" > unix-lib.cm  
         fi  
391        # make the HTML library        # make the HTML library
392          cd $SRCDIR/smlnj-lib/HTML              reglib html-lib.cm 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  
393        # make the PP library        # make the PP library
394          cd $SRCDIR/smlnj-lib/PP              reglib pp-lib.cm 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  
395        # make the RegExp library        # make the RegExp library
396          cd $SRCDIR/smlnj-lib/RegExp              reglib regexp-lib.cm smlnj-lib/RegExp
397          echo "$CM_MAKE_LIB" | $BINDIR/sml          # make the Reactive library
398          if [ ! -f $LIBDIR/regexp-lib.cm ]; then              reglib reactive-lib.cm smlnj-lib/Reactive
           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  
399        ;;        ;;
400        cml)        cml)
401          $CONFIGDIR/unpack.sh CML $SRCDIR cml $ROOT/$VERSION-cml.tar          unpack CML $SRCDIR cml $ROOT/$VERSION-cml
402          if [ "$?" != "0" ]; then          reglib core-cml.cm cml/src/core-cml
403            exit $?          reglib cml.cm cml/src
404          fi          reglib cml-basis.cm cml
         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  
405        ;;        ;;
406        cml-lib)        cml-lib)
407          $CONFIGDIR/unpack.sh CML $SRCDIR cml $ROOT/$VERSION-cml.tar          unpack CML $SRCDIR cml $ROOT/$VERSION-cml
408          if [ "$?" != "0" ]; then          reglib cml-lib.cm cml/cml-lib
           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  
409        ;;        ;;
410        eXene)        eXene)
411          $CONFIGDIR/unpack.sh EXene $SRCDIR eXene $ROOT/$VERSION-eXene.tar          unpack EXene $SRCDIR eXene $ROOT/$VERSION-eXene
412          if [ "$?" != "0" ]; then          reglib eXene.cm eXene
           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  
413        ;;        ;;
414        doc)        doc)
415          $CONFIGDIR/unpack.sh Doc $ROOT doc $ROOT/$VERSION-doc.tar          unpack Doc $ROOT doc $ROOT/$VERSION-doc
         if [ "$?" != "0" ]; then  
           exit $?  
         fi  
416          cd $ROOT/doc          cd $ROOT/doc
417          build $ROOT          build $ROOT
418        ;;        ;;
419        *)        *)
420          echo "!!! unknown target $i"          echo "!!! Unknown target $i."
421        ;;        ;;
422      esac      esac
   fi  
423  done  done
424    
425  if [ "$ENABLE_AUTOLOADING" = "TRUE" ]; then  #
426    CMD="CM.autoloading(SOME true); CM.clearAutoList();"  # Now go and stabilize all registered libraries...
427    if [ "$AUTOLOAD_SMLNJ_LIB" = "TRUE" ]; then  # This is done with library sources in their original locations inside
428      CMD="$CMD CM.autoload'(\"$LIBDIR/smlnj-lib.cm\");"  # $SRCDIR, so we must consult $LOCALPATHCONFIG.
429    fi  #
430    if [ "$AUTOLOAD_SMLNJ_UNIX" = "TRUE" ]; then  
431      CMD="$CMD CM.autoload'(\"$LIBDIR/unix-lib.cm\");"  echo Compiling library code.
432    fi  echo 'then OS.Process.success else OS.Process.failure);' >>$LIBLIST
433    if [ "$AUTOLOAD_SMLNJ_HTML" = "TRUE" ]; then  if CM_LOCAL_PATHCONFIG=$LOCALPATHCONFIG $BINDIR/sml <$LIBLIST ; then
434      CMD="$CMD CM.autoload'(\"$LIBDIR/html-lib.cm\");"      echo Libraries compiled successfully.
   fi  
   if [ "$AUTOLOAD_SMLNJ_REACTIVE" = "TRUE" ]; then  
     CMD="$CMD CM.autoload'(\"$LIBDIR/reactive-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  
   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  
435    else    else
436      echo "!!! unable to build SML with autoloading"      echo "!!! Something went wrong when compiling the libraries."
437      exit 1      exit 1
438    fi    fi
439  fi  rm -f $LIBLIST $LOCALPATHCONFIG
440    
441    #
442    # Finally, move the libraries to their final locations...
443    #
444    
445    if [ -r $LIBMOVESCRIPT ] ; then
446        echo Moving libraries to $LIBDIR.
447        . $LIBMOVESCRIPT
448        rm -f $LIBMOVESCRIPT
449    fi

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

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