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

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

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

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