Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/config/install.sh
ViewVC logotype

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

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

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

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

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