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

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

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