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

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

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