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

Diff of /config/releases/release-110.63/install.sh

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

revision 411, Fri Sep 3 00:25:03 1999 UTC revision 418, Fri Sep 3 23:51:27 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        echo Scheduling library $1 to be built.
163        echo "andalso CM.stabilize false \"$1\"" >>$LIBLIST
164        echo $1 $SRCDIR/$2 >>$LOCALPATHCONFIG
165        if [ x$MOVE_LIBRARIES = xtrue ] ; then
166            echo movelib $SRCDIR/$2 $1 >>$LIBMOVESCRIPT
167            echo $1 $LIBDIR/$1 >>$CM_PATHCONFIG_DEFAULT
168        else
169            echo $1 $SRCDIR/$2 >>$CM_PATHCONFIG_DEFAULT
170        fi
171    }
172    
173    #
174    # Function to build a standalone program such as ml-yacc.  The function takes
175    # 2 or 3 arguments.  First the name of the program with at the same time
176    # is the directory name under $SRCDIR where the sources reside.  The second
177    # argument is a descriptive name for the program (passed on to "unpack").
178    # The optional third argument specifies the path relative to $SRCDIR/$1
179    # of the directory where the program's heap image is to be found.
180    #
181    
182    standalone() {
183        TARGET=$1.$HEAP_SUFFIX
184        if [ $# = 3 ] ; then
185            TARGETLOC=$3/$TARGET
186        else
187            TARGETLOC=$TARGET
188        fi
189        if [ -r $HEAPDIR/$TARGET ] ; then
190            echo Target $TARGET already exists.
191        else
192            echo Building $TARGET.
193            unpack $2 $SRCDIR $1 $ROOT/$VERSION-$1
194            cd $SRCDIR/$1
195            ./build
196            if [ -r $TARGETLOC ] ; then
197                mv $TARGETLOC $HEAPDIR/$TARGET
198                if [ ! -f $BINDIR/$1 ] ; then
199                    cd $BINDIR
200                    ln -s .run-sml $1
201                fi
202            else
203                echo "!!! Build of $TARGET failed."
204            fi
205        fi
206    }
207    
208    #
209    # create the various sub directories
210    #
211    for dir in $BINDIR $HEAPDIR $RUNDIR $LIBDIR $SRCDIR
212    do
213        makedir $dir
214  done  done
215    
216    
# Line 108  Line 218 
218  # 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
219  #  #
220  if [ -x $BINDIR/.arch-n-opsys ]; then  if [ -x $BINDIR/.arch-n-opsys ]; then
221    echo "$BINDIR/.arch-n-opsys already exists"    echo Script $BINDIR/.arch-n-opsys already exists.
222  else  else
223    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
224    chmod 555 $BINDIR/.arch-n-opsys    chmod 555 $BINDIR/.arch-n-opsys
225    if [ ! -x $BINDIR/.arch-n-opsys ]; then    if [ ! -x $BINDIR/.arch-n-opsys ]; then
226      echo "!!! installation of $BINDIR/.arch-n-opsys failed for some reason"      echo "!!! Installation of $BINDIR/.arch-n-opsys failed for some reason."
227      exit 1      exit 1
228    fi    fi
229  fi  fi
230  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`
231  if [ "$?" != "0" ]; then  if [ "$?" != "0" ]; then
232    echo "!!! $BINDIR/.arch-n-opsys fails on this machine"    echo "!!! Script $BINDIR/.arch-n-opsys fails on this machine."
233    echo "!!! you must patch this by hand and repeat the installation"    echo "!!! You must patch this by hand and repeat the installation."
234    exit 2    exit 2
235  else  else
236    echo "$BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS"    echo Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.
237  fi  fi
238  eval $ARCH_N_OPSYS  eval $ARCH_N_OPSYS
239    
240  if [ -x $BINDIR/.run-sml ]; then  if [ -x $BINDIR/.run-sml ]; then
241    echo "$BINDIR/.run-sml already exists"    echo Script $BINDIR/.run-sml already exists.
242  else  else
243    cat $CONFIGDIR/_run-sml | \    cat $CONFIGDIR/_run-sml | \
244      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," \
245      > $BINDIR/.run-sml      > $BINDIR/.run-sml
246    chmod 555 $BINDIR/.run-sml    chmod 555 $BINDIR/.run-sml
247    if [ ! -x $BINDIR/.run-sml ]; then    if [ ! -x $BINDIR/.run-sml ]; then
248      echo "!!! installation of $BINDIR/.run-sml failed for some reason"      echo "!!! Installation of $BINDIR/.run-sml failed for some reason."
249      exit 1      exit 1
250    fi    fi
251  fi  fi
# Line 162  Line 272 
272    linux)    linux)
273      EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`      EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`
274      if [ "$?" != "0" ]; then      if [ "$?" != "0" ]; then
275        echo "problems checking for underscores in global names"        echo "!!! Problems checking for underscores in global names."
276        exit 1        exit 1
277      fi      fi
278      EXTRA_DEFS="XDEFS=$EXTRA_DEFS"      EXTRA_DEFS="XDEFS=$EXTRA_DEFS"
# Line 172  Line 282 
282  #  #
283  # the name of the bin files directory  # the name of the bin files directory
284  #  #
285  BIN_FILES=bin.$ARCH-unix  BOOT_FILES=comp.boot.$ARCH-unix
286    
287  #  #
288  # build the run-time system  # build the run-time system
289  #  #
290  $CONFIGDIR/unpack.sh "run-time" $SRCDIR runtime $ROOT/$VERSION-runtime.tar  unpack "run-time" $SRCDIR runtime $ROOT/$VERSION-runtime
 if [ "$?" != "0" ]; then  
   exit $?  
 fi  
291  if [ ! -x $RUNDIR/run.$ARCH-$OPSYS ]; then  if [ ! -x $RUNDIR/run.$ARCH-$OPSYS ]; then
292    cd $SRCDIR/runtime/objs    cd $SRCDIR/runtime/objs
293    echo "compiling the run-time system"    echo Compiling the run-time system.
294    $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS    $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
295    if [ -x run.$ARCH-$OPSYS ]; then    if [ -x run.$ARCH-$OPSYS ]; then
296      mv run.$ARCH-$OPSYS $RUNDIR      mv run.$ARCH-$OPSYS $RUNDIR
297      $MAKE MAKE=$MAKE clean      $MAKE MAKE=$MAKE clean
298    else    else
299      echo "!!! run-time system build failed for some reason"      echo "!!! Run-time system build failed for some reason."
300      exit 1      exit 1
301    fi    fi
302  fi  fi
# Line 199  Line 306 
306  # boot the base SML system  # boot the base SML system
307  #  #
308  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then
309    echo "$HEAPDIR/sml.$HEAP_SUFFIX already exists"    echo Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.
310  else  else
311    $CONFIGDIR/unpack.sh bin $ROOT $BIN_FILES $ROOT/$VERSION-$BIN_FILES.tar    unpack bin $ROOT $BOOT_FILES $ROOT/$VERSION-$BOOT_FILES
312    cd $ROOT    cd $ROOT
313    $RUNDIR/run.$ARCH-$OPSYS @SMLboot=$ROOT/$BIN_FILES @SMLalloc=$ALLOC <<XXXX    if $RUNDIR/run.$ARCH-$OPSYS @SMLheap=sml \
314      $SET_FLAGS          @SMLboot=$ROOT/$BOOT_FILES @SMLrtpid=`cat $BOOT_FILES/RTPID` \
315      val use = Compiler.Interact.useFile          @SMLalloc=$ALLOC
316      val _ = (SMLofNJ.exportML "sml";    then
              print Compiler.banner;  
              print "\n");  
 XXXX  
317    if [ -r sml.$HEAP_SUFFIX ]; then    if [ -r sml.$HEAP_SUFFIX ]; then
318      mv sml.$HEAP_SUFFIX $HEAPDIR      mv sml.$HEAP_SUFFIX $HEAPDIR
319      cd $BINDIR      cd $BINDIR
320      ln -s .run-sml sml      ln -s .run-sml sml
321    
322            #
323            # Now move all stable libraries to #LIBDIR and generate
324            # the pathconfig file.
325            #
326    
327            cd $ROOT/$BOOT_FILES
328            for lib in *.cm ; do
329                echo $lib $LIBDIR/$lib >>$CM_PATHCONFIG_DEFAULT
330                movelib $ROOT/$BOOT_FILES/$lib $lib
331            done
332            cd $ROOT
333            rm -rf $BOOT_FILES
334    
335    else    else
336      echo "!!! unable to build SML heap image (sml.$HEAP_SUFFIX)"          echo "!!! Boot code did not produce heap image (sml.$HEAP_SUFFIX)."
337            exit 1
338        fi
339      else
340        echo "!!! Boot code failed, no heap image built (sml.$HEAP_SUFFIX)."
341      exit 1      exit 1
342    fi    fi
343  fi  fi
344    
345    #
346    # Initialize $LIBLIST
347    #
348    cd $ROOT
349    rm -f $LOCALPATHCONFIG $LIBLIST
350    echo 'OS.Process.exit (if true' >$LIBLIST
351    
352  #  #
353  # now build the individual targets  # now build (or prepare to build) the individual targets
354  #  #
355  cd $SRCDIR  cd $SRCDIR
356  echo "install targets"  echo Installing other targets.
357  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"  
358      case $i in      case $i in
359        src-smlnj)        src-smlnj)
360          for src in compiler comp-lib cm MLRISC; do          for src in compiler comp-lib new-cm MLRISC smlnj-lib ml-yacc system
361            $CONFIGDIR/unpack.sh $src $ROOT/src $src $ROOT/$VERSION-$src.tar          do
362                unpack $src $ROOT/src $src $ROOT/$VERSION-$src
363          done          done
364        ;;        ;;
       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  
       ;;  
365        ml-yacc)        ml-yacc)
366          $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  
367        ;;        ;;
368        ml-lex)        ml-lex)
369          $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  
370        ;;        ;;
371        ml-burg)        ml-burg)
372          $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  
373        ;;        ;;
374        smlnj-lib)        smlnj-lib)
375          $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
376          if [ "$?" != "0" ]; then  
377            exit $?          # Don't make the Util library -- it came pre-made and has been
378          fi          # installed when making the base system.  In other words, don't do...
379        # 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  
380        # make the Unix library        # make the Unix library
381          cd $SRCDIR/smlnj-lib/Unix              reglib unix-lib.cm 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  
382        # make the INet library        # make the INet library
383          cd $SRCDIR/smlnj-lib/INet              reglib inet-lib.cm 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  
384        # make the HTML library        # make the HTML library
385          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  
386        # make the PP library        # make the PP library
387          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  
388        # make the RegExp library        # make the RegExp library
389          cd $SRCDIR/smlnj-lib/RegExp              reglib regexp-lib.cm 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  
390        # make the Reactive library        # make the Reactive library
391          cd $SRCDIR/smlnj-lib/Reactive              reglib reactive-lib.cm 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  
392        ;;        ;;
393        cml)        cml)
394          $CONFIGDIR/unpack.sh CML $SRCDIR cml $ROOT/$VERSION-cml.tar          unpack CML $SRCDIR cml $ROOT/$VERSION-cml
395          if [ "$?" != "0" ]; then          reglib core-cml.cm cml/src/core-cml
396            exit $?          reglib cml.cm cml/src
397          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  
398        ;;        ;;
399        cml-lib)        cml-lib)
400          $CONFIGDIR/unpack.sh CML $SRCDIR cml $ROOT/$VERSION-cml.tar          unpack CML $SRCDIR cml $ROOT/$VERSION-cml
401          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  
402        ;;        ;;
403        eXene)        eXene)
404          $CONFIGDIR/unpack.sh EXene $SRCDIR eXene $ROOT/$VERSION-eXene.tar          unpack EXene $SRCDIR eXene $ROOT/$VERSION-eXene
405          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  
406        ;;        ;;
407        doc)        doc)
408          $CONFIGDIR/unpack.sh Doc $ROOT doc $ROOT/$VERSION-doc.tar          unpack Doc $ROOT doc $ROOT/$VERSION-doc
         if [ "$?" != "0" ]; then  
           exit $?  
         fi  
409          cd $ROOT/doc          cd $ROOT/doc
410          build $ROOT          build $ROOT
411        ;;        ;;
412        *)        *)
413          echo "!!! unknown target $i"          echo "!!! Unknown target $i."
414        ;;        ;;
415      esac      esac
   fi  
416  done  done
417    
418  if [ "$ENABLE_AUTOLOADING" = "TRUE" ]; then  #
419    CMD="CM.autoloading(SOME true); CM.clearAutoList();"  # Now go and stabilize all registered libraries...
420    if [ "$AUTOLOAD_SMLNJ_LIB" = "TRUE" ]; then  # This is done with library sources in their original locations inside
421      CMD="$CMD CM.autoload'(\"$LIBDIR/smlnj-lib.cm\");"  # $SRCDIR, so we must consult $LOCALPATHCONFIG.
422    fi  #
423    if [ "$AUTOLOAD_SMLNJ_UNIX" = "TRUE" ]; then  
424      CMD="$CMD CM.autoload'(\"$LIBDIR/unix-lib.cm\");"  echo Compiling library code.
425    fi  echo 'then OS.Process.success else OS.Process.failure);' >>$LIBLIST
426    if [ "$AUTOLOAD_SMLNJ_INET" = "TRUE" ]; then  if CM_LOCAL_PATHCONFIG=$LOCALPATHCONFIG $BINDIR/sml <$LIBLIST ; then
427      CMD="$CMD CM.autoload'(\"$LIBDIR/inet-lib.cm\");"      echo Libraries compiled successfully.
   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  
   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  
428    else    else
429      echo "!!! unable to build SML with autoloading"      echo "!!! Something went wrong when compiling the libraries."
430      exit 1      exit 1
431    fi    fi
432  fi  rm -f $LIBLIST $LOCALPATHCONFIG
433    
434    #
435    # Finally, move the libraries to their final locations...
436    #
437    
438    if [ -r $LIBMOVESCRIPT ] ; then
439        echo Moving libraries to $LIBDIR.
440        . $LIBMOVESCRIPT
441        rm -f $LIBMOVESCRIPT
442    fi

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

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