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

revision 537, Fri Feb 18 17:20:16 2000 UTC revision 691, Tue Jul 25 07:20:24 2000 UTC
# Line 9  Line 9 
9  # by M.Blume (2/2000).  # by M.Blume (2/2000).
10  #  #
11    
12    this=$0
13    
14  #  #
15  # get the target list  # get the target list
16  #  #
17  if [ ! -r config/targets ]; then  if [ ! -r config/targets ]; then
18      echo "!!! File config/targets is missing."      echo "$this: !!! File config/targets is missing."
19      exit 1      exit 1
20  fi  fi
21  . config/targets  . config/targets
# Line 22  Line 24 
24  # create the preloads.standard file  # create the preloads.standard file
25  #  #
26  if [ ! -r config/preloads ]; then  if [ ! -r config/preloads ]; then
27      echo "!!! File config/preloads is missing."      echo "$this: !!! File config/preloads is missing."
28      exit 1      exit 1
29  fi  fi
30  cp config/preloads preloads.standard  cp config/preloads preloads.standard
# Line 34  Line 36 
36  MAKE=make  MAKE=make
37    
38  SHELL=/bin/sh  SHELL=/bin/sh
39  echo Using shell $SHELL.  echo $this: Using shell $SHELL.
40    
41  #  #
42  # set the SML root directory  # set the SML root directory
43  #  #
44  REAL_PWD=`pwd`  REAL_PWD=`pwd`
45  ROOT=${PWD:-$REAL_PWD}  ROOT=${PWD:-$REAL_PWD}
46  echo SML root is $ROOT.  echo $this: SML root is $ROOT.
47  echo Installation directory is ${INSTALLDIR:=$ROOT}.  echo $this: Installation directory is ${INSTALLDIR:=$ROOT}.
48    
49  #  #
50  # set the various directory and file pathname variables  # set the various directory and file pathname variables
# Line 57  Line 59 
59  LIBMOVESCRIPT=$ROOT/libmove     # a temporary script  LIBMOVESCRIPT=$ROOT/libmove     # a temporary script
60  LOCALPATHCONFIG=$INSTALLDIR/pathconfig # a temporary pathconfig file  LOCALPATHCONFIG=$INSTALLDIR/pathconfig # a temporary pathconfig file
61    
62    URLGETTER=unknown
63    
64  #  #
65  # the path to the dir where ml-yacc, ml-burg, ml-lex, and ml-build live  # the path to the dir where ml-yacc, ml-burg, ml-lex, ml-build, and
66    # ml-makedepend live
67  #  #
68  TOOLDIR=$BINDIR  TOOLDIR=$BINDIR
69    
70  #  #
71    # A temporary file for post-editing the pathconfig file...
72    #
73    PCEDITTMP=/usr/tmp/pcedittmp.$$
74    
75    #
76    # files to be deleted after we are done...
77    #
78    tmpfiles=""
79    tmpfiles="$tmpfiles $ROOT/preloads.standard"
80    tmpfiles="$tmpfiles $LIBLIST"
81    tmpfiles="$tmpfiles $LOCALPATHCONFIG"
82    tmpfiles="$tmpfiles $LIBMOVESCRIPT"
83    tmpfiles="$tmpfiles $PCEDITTMP"
84    #
85    # make sure we always clean up after ourselves...
86    #
87    trap 'rm -f $tmpfiles' 0 1 2 3 15
88    
89    
90    #
91  # set the CM configuration variables (these are environment variables  # set the CM configuration variables (these are environment variables
92  # that will be queried by the bootstrap code)  # that will be queried by the bootstrap code)
93  # Especially important is CM_PATHCONFIG_DEFAULT.  # Especially important is CM_PATHCONFIG_DEFAULT.
# Line 74  Line 99 
99  # the release version that we are installing  # the release version that we are installing
100  #  #
101  VERSION=`cat $CONFIGDIR/version`  VERSION=`cat $CONFIGDIR/version`
102  echo Installing version $VERSION.  echo $this: Installing version $VERSION.
103    
104    #
105    # the URL for the (usually remote) source archive
106    #
107    SRCARCHIVEURL=`cat $CONFIGDIR/srcarchiveurl`
108    echo $this: URL of source archive is $SRCARCHIVEURL.
109    
110  #  #
111  # Function to make a directory (and advertise such action).  # Function to make a directory (and advertise such action).
112  #  #
113  makedir() {  makedir() {
114      if [ ! -d $1 ] ; then      if [ ! -d $1 ] ; then
115          echo Making directory $1          echo $this: Making directory $1
116          if mkdir $1 ; then          if mkdir $1 ; then
117              : everything is fine              : everything is fine
118          else          else
119              echo "!!! Unable to make directory $1!"              echo "$this: !!! Unable to make directory $1!"
120                exit 1
121            fi
122        fi
123    }
124    
125    #
126    # Function for asking user to fetch source archive.
127    #   $1 - descriptive name
128    #   $2 - base name without extension, without version, and without dir
129    #   $3 - remote directory
130    #
131    askurl() {
132        echo "$this: Please, fetch $1 archive"
133        echo ' ('$2.'*' or $VERSION-$2.'*)'
134        echo " from $3"
135        echo " and then re-run this script!"
136              exit 1              exit 1
137    }
138    
139    #
140    # Function for fetching source archives automatically using wget or lynx.
141    #   $1 - command to actually get the stuff
142    #   $2 - descriptive name
143    #   $3 - base name without extension and without dir
144    #   $4 - remote directory
145    #
146    fetchurl() {
147        getter=$1 ; shift
148        echo $this: Fetching $1 from $3. Please stand by...
149        fetched=no
150        for base in $2 $VERSION-$2 ; do
151            for ext in tar.gz tgz tar.Z tz tar tar.bz2 ; do
152                try=$base.$ext
153                echo $this: Trying $try ...
154                if $getter $3 $try $ROOT/$try ; then
155                    fetched=yes
156                    echo $this: Fetching $try was a success.
157                    break 2         # get out of both for-loops
158                else
159                    rm -f $ROOT/$try
160                fi
161            done
162        done
163        if [ $fetched = no ] ; then
164            echo $this: Fetching $try was no success.
165            echo '  ' You should try to do it manually now.
166            askurl "$1" "$2" "$3"
167        fi
168    }
169    
170    usewget() {
171        wget -nv -O $3 $1/$2
172    }
173    
174    uselynx() {
175        lynx -source $1/$2 >$3
176    }
177    
178    testurlgetter() {
179        (exec >/dev/null 2>&1 ; exec $*)
180    }
181    
182    #
183    # Function to check whether wget or lynx is available.
184    # Set URLGETTER accordingly.
185    #
186    urlgetter() {
187        if [ "$URLGETTER" = unknown ] ; then
188            if testurlgetter wget --help ; then
189                URLGETTER="fetchurl usewget"
190            elif testurlgetter lynx -help ; then
191                URLGETTER="fetchurl uselynx"
192            else
193                URLGETTER="askurl"
194            fi
195          fi          fi
196    }
197    
198    un_tar() {
199        echo "$this: Un-TAR-ing $1 archive."
200        tar -xf $2
201    }
202    
203    un_tar_Z() {
204        echo "$this: Un-COMPRESS-ing and un-TAR-ing $1 archive."
205        zcat $2 | tar -xf -
206    }
207    
208    un_tar_gz() {
209        echo "$this: Un-GZIP-ing and un-TAR-ing $1 archive."
210        gunzip -c $2 | tar -xf -
211    }
212    
213    un_tar_bz2() {
214        echo "$this: Un-BZIP2-ing and un-TAR-ing $1 archive."
215        bunzip2 -c $2 | tar -xf -
216    }
217    
218    unarchive() {
219        # $1: descriptive string, $2: archive, $3: unpacker
220        if [ -r $ROOT/$2 ] ; then
221            $3 "$1" $ROOT/$2
222        elif [ -r $ROOT/$VERSION-$2 ]; then
223            $3 "$1" $ROOT/$VERSION-$2
224        else
225            return 1
226      fi      fi
227  }  }
228    
# Line 100  Line 235 
235  # $4: the basename of the source archive (the script will check several  # $4: the basename of the source archive (the script will check several
236  #     different suffixes to determine what kind of de-compression is to  #     different suffixes to determine what kind of de-compression is to
237  #     be used)  #     be used)
238    #
239    # fetch_n_unpack is the helper function that does the real work.  If
240    # no archive is found locally, it invokes $URLGETTER and tries again.
241    # The variable $tryfetch is used to make sure this happens only once.
242    fetch_n_unpack() {
243        cd $2
244        if unarchive "$1" $4.tar.gz un_tar_gz ||
245           unarchive "$1" $4.tgz un_tar_gz ||
246           unarchive "$1" $4.tar.Z un_tar_Z ||
247           unarchive "$1" $4.tar un_tar ||
248           unarchive "$1" $4.tar.bz1 un_tar_bz2 ||
249           unarchive "$1" $4.tz un_tar_Z
250        then
251            : we are done
252        elif [ $tryfetch = yes ] ; then
253            urlgetter
254            $URLGETTER "$1" $4 $SRCARCHIVEURL
255            tryfetch=no
256            fetch_n_unpack "$1" "$2" "$3" "$4"
257        fi
258    }
259    
260    #
261    # The main "unpack" driver function that invokes the above helper.
262    #
263  unpack() {  unpack() {
264        tryfetch=yes
265      if [ -d $2/$3 ]; then      if [ -d $2/$3 ]; then
266          echo "The $1 source tree already exists."          echo "$this: The $1 tree already exists."
267      else      else
268          echo "Unpacking $1 source archive."          fetch_n_unpack "$1" "$2" "$3" "$4"
         cd $2  
         if [ -r $4.tar.Z ] ; then  
             zcat $4.tar.Z | tar -xf -  
         elif [ -r $4.tar ] ; then  
             tar -xf $4.tar  
         elif [ -r $4.tar.gz ] ; then  
             gunzip -c $4.tar.gz | tar -xf -  
         elif [ -r $4.tar.bz2 ] ; then  
             bunzip2 -c $4.tar.bz2 | tar -xf -  
         elif [ -r $4.tgz ] ; then  
             gunzip -c $4.tgz | tar -xf -  
         elif [ -r $4.tz ] ; then  
             zcat $4.tz | tar -xf -  
         else  
             echo "!!! The $1 source archive is missing."  
             exit 1  
269          fi          fi
270          if [ ! -d $2/$3 ]; then          if [ ! -d $2/$3 ]; then
271              echo "!!! Unable to unpack $1 source archive."          echo "$this: !!! Unable to unpack $1 archive."
272              exit 1              exit 1
273          fi          fi
274    }
275    
276    # A function to move all stable library files to a parallel directory
277    # hierarchy.
278    # The first argument must be a simple path (no / inside), and
279    # the second argument must be an absolute path.
280    move() {
281        if [ -d $1 ] ; then
282            if [ ! -d $2 ] ; then
283                if [ -f $2 ] ; then
284                    echo $this: $2 exists as a non-directory.
285                    exit 1
286                fi
287                mkdir $2
288            fi
289            cd $1
290            for i in * ; do
291                move $i $2/$i
292            done
293            cd ..
294        elif [ -f $1 ] ; then
295            rm -f $2
296            mv $1 $2
297      fi      fi
298  }  }
299    
# Line 145  Line 313 
313          case $lib in          case $lib in
314          *.cm | *.cmi)          *.cm | *.cmi)
315              if [ $lib != $2 ] ; then              if [ $lib != $2 ] ; then
316                  echo "! Warning:" $lib specified relative to $2                  echo "$this: Warning:" $lib specified relative to $2
317              fi              fi
318              echo Moving library $lib to $LIBDIR              echo $this: Moving library $lib to $LIBDIR
319              makedir $LIBDIR/$2              makedir $LIBDIR/$2
320              makedir $LIBDIR/$2/CM              makedir $LIBDIR/$2/CM
321              makedir $LIBDIR/$2/CM/$ARCH-unix              makedir $LIBDIR/$2/CM/$ARCH-unix
# Line 173  Line 341 
341  reglib() {  reglib() {
342      if [ x$MOVE_LIBRARIES = xtrue ] ; then      if [ x$MOVE_LIBRARIES = xtrue ] ; then
343          FINALLOCATION=$LIBDIR/$1          FINALLOCATION=$LIBDIR/$1
344            FINALCONFIGPATH=$1
345      else      else
346          FINALLOCATION=$SRCDIR/$2          FINALLOCATION=$SRCDIR/$2
347            FINALCONFIGPATH=$FINALLOCATION
348      fi      fi
349      if [ -d $FINALLOCATION/CM/$ARCH-unix ] ; then      if [ -d $FINALLOCATION/CM/$ARCH-unix ] ; then
350          echo "Library $1 already exists in $FINALLOCATION."          echo "$this: Library $1 already exists in $FINALLOCATION."
351      else      else
352          echo "Scheduling library $1 to be built in $FINALLOCATION."          echo "$this: Scheduling library $1 to be built in $FINALLOCATION."
353          echo "andalso CM.stabilize false \"$1\"" >>$LIBLIST          echo "  andalso CM.stabilize false \"\$/$1\"" >>$LIBLIST
354          echo $1 $SRCDIR/$2 >>$LOCALPATHCONFIG          echo $1 $SRCDIR/$2 >>$LOCALPATHCONFIG
355          if [ x$MOVE_LIBRARIES = xtrue ] ; then          if [ x$MOVE_LIBRARIES = xtrue ] ; then
356              echo movelibs $SRCDIR/$2 $1 >>$LIBMOVESCRIPT              echo movelibs $SRCDIR/$2 $1 >>$LIBMOVESCRIPT
357          fi          fi
         echo $1 $FINALLOCATION >>$CM_PATHCONFIG_DEFAULT  
358      fi      fi
359        echo $1 $FINALCONFIGPATH >>$CM_PATHCONFIG_DEFAULT
360  }  }
361    
362  #  #
# Line 206  Line 376 
376          TARGETLOC=$TARGET          TARGETLOC=$TARGET
377      fi      fi
378      if [ -r $HEAPDIR/$TARGET ] ; then      if [ -r $HEAPDIR/$TARGET ] ; then
379          echo Target $TARGET already exists.          echo $this: Target $TARGET already exists.
380      else      else
381          echo Building $TARGET.          echo $this: Building $TARGET.
382          unpack $2 $SRCDIR $1 $ROOT/$VERSION-$1          unpack $2 $SRCDIR $1 $1
383          cd $SRCDIR/$1          cd $SRCDIR/$1
384          ./build          ./build
385          if [ -r $TARGETLOC ] ; then          if [ -r $TARGETLOC ] ; then
# Line 219  Line 389 
389                  ln -s .run-sml $1                  ln -s .run-sml $1
390              fi              fi
391          else          else
392              echo "!!! Build of $TARGET failed."              echo "$this: !!! Build of $TARGET failed."
393          fi          fi
394      fi      fi
395  }  }
# Line 227  Line 397 
397  #  #
398  # create the various sub directories  # create the various sub directories
399  #  #
400  for dir in $BINDIR $HEAPDIR $RUNDIR $LIBDIR $SRCDIR  for dir in $BINDIR $HEAPDIR $RUNDIR $LIBDIR $SRCDIR ; do
 do  
401      makedir $dir      makedir $dir
402  done  done
403    
# Line 236  Line 405 
405  # 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
406  #  #
407  if [ -x $BINDIR/.arch-n-opsys ]; then  if [ -x $BINDIR/.arch-n-opsys ]; then
408      echo Script $BINDIR/.arch-n-opsys already exists.      echo $this: Script $BINDIR/.arch-n-opsys already exists.
409  else  else
410      cat $CONFIGDIR/_arch-n-opsys \      cat $CONFIGDIR/_arch-n-opsys \
411      | sed -e "s,@SHELL@,$SHELL,g" > $BINDIR/.arch-n-opsys      | sed -e "s,@SHELL@,$SHELL,g" > $BINDIR/.arch-n-opsys
412      chmod 555 $BINDIR/.arch-n-opsys      chmod 555 $BINDIR/.arch-n-opsys
413      if [ ! -x $BINDIR/.arch-n-opsys ]; then      if [ ! -x $BINDIR/.arch-n-opsys ]; then
414          echo "!!! Installation of $BINDIR/.arch-n-opsys failed."          echo "$this: !!! Installation of $BINDIR/.arch-n-opsys failed."
415          exit 1          exit 1
416      fi      fi
417  fi  fi
418    
419  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`
420  if [ "$?" != "0" ]; then  if [ "$?" != "0" ]; then
421      echo "!!! Script $BINDIR/.arch-n-opsys fails on this machine."      echo "$this: !!! Script $BINDIR/.arch-n-opsys fails on this machine."
422      echo "!!! You must patch this by hand and repeat the installation."      echo "$this: !!! You must patch this by hand and repeat the installation."
423      exit 2      exit 2
424  else  else
425      echo Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.      echo $this: Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.
426  fi  fi
427  eval $ARCH_N_OPSYS  eval $ARCH_N_OPSYS
428    
# Line 265  Line 434 
434  installdriver() {  installdriver() {
435      dsrc=$1      dsrc=$1
436      ddst=$2      ddst=$2
437      if [ -x $BINDIR/$ddst ]; then  # We install the driver unconditionally. (It would be better to test
438          echo Script $BINDIR/$ddst already exists.  # for an outdated driver script, but not all "test" commands understand
439      else  # the -nt comparison operator....)
440    #   if [ -x $BINDIR/$ddst ]; then
441    #       echo $this: Script $BINDIR/$ddst already exists.
442    #   else
443            rm -f $BINDIR/$ddst
444          cat $CONFIGDIR/$dsrc | \          cat $CONFIGDIR/$dsrc | \
445          sed -e "s,@SHELL@,$SHELL,g" \          sed -e "s,@SHELL@,$SHELL,g" \
446              -e "s,@BINDIR@,$BINDIR," \              -e "s,@BINDIR@,$BINDIR," \
# Line 275  Line 448 
448              > $BINDIR/$ddst              > $BINDIR/$ddst
449          chmod 555 $BINDIR/$ddst          chmod 555 $BINDIR/$ddst
450          if [ ! -x $BINDIR/$ddst ]; then          if [ ! -x $BINDIR/$ddst ]; then
451              echo "!!! Installation of $BINDIR/${ddst} failed."              echo "$this: !!! Installation of $BINDIR/${ddst} failed."
452              exit 1              exit 1
453          fi          fi
454      fi  #   fi
455  }  }
456    
457  installdriver _run-sml .run-sml  installdriver _run-sml .run-sml
458  installdriver _link-sml .link-sml  installdriver _link-sml .link-sml
459  installdriver _ml-build ml-build  installdriver _ml-build ml-build
460    installdriver _ml-makedepend ml-makedepend
461    
462  #  #
463  # set some architecture dependent run-time system flags  # set some architecture dependent run-time system flags
# Line 293  Line 467 
467          ALLOC=1M          ALLOC=1M
468          ;;          ;;
469      x86)      x86)
470            # The following is the _wrong_ value for many popular x86 chips
471            # (i.e., Celerons).  However, the optimal value for those is 32k,
472            # and such a small value is not enough for the runtime system's boot
473            # code.  Therefore, we use 256k here and re-set it to the proper
474            # value in .run-sml.
475          ALLOC=256k          ALLOC=256k
476          ;;          ;;
477      alpha32)      alpha32)
# Line 310  Line 489 
489      linux)      linux)
490          EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`          EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`
491          if [ "$?" != "0" ]; then          if [ "$?" != "0" ]; then
492              echo "!!! Problems checking for underscores in global names."              echo "$this: !!! Problems checking for underscores in asm names."
493              exit 1              exit 1
494          fi          fi
495          EXTRA_DEFS="XDEFS=$EXTRA_DEFS"          EXTRA_DEFS="XDEFS=$EXTRA_DEFS"
# Line 320  Line 499 
499  #  #
500  # the name of the bin files directory  # the name of the bin files directory
501  #  #
502  BOOT_FILES=sml.boot.$ARCH-unix  BOOT_ARCHIVE=boot.$ARCH-unix
503    BOOT_FILES=sml.$BOOT_ARCHIVE
 #  
 # files to be deleted after we are done...  
 #  
 tmpfiles=""  
 tmpfiles="$tmpfiles $ROOT/preloads.standard"  
 tmpfiles="$tmpfiles $ROOT/$LIBLIST"  
 tmpfiles="$tmpfiles $ROOT/$LOCALPATHCONFIG"  
 tmpfiles="$tmpfiles $ROOT/$LIBMOVESCRIPT"  
 #  
 # also remove the boot dir because it won't have anything interesting in  
 # it after we are successful...  
 #  
 tmpfiles="$tmpfiles $ROOT/$BOOT_FILES"  
 #  
 # make sure we always clean up after ourselves...  
 #  
 trap 'rm -rf $tmpfiles' 0 1 2 3 15  
504    
505  #  #
506  # build the run-time system  # build the run-time system
507  #  #
508  unpack "run-time" $SRCDIR runtime $ROOT/$VERSION-runtime  unpack "run-time" $SRCDIR runtime runtime
509  if [ -x $RUNDIR/run.$ARCH-$OPSYS ]; then  if [ -x $RUNDIR/run.$ARCH-$OPSYS ]; then
510      echo Run-time system already exists.      echo $this: Run-time system already exists.
511  else  else
512      cd $SRCDIR/runtime/objs      cd $SRCDIR/runtime/objs
513      echo Compiling the run-time system.      echo $this: Compiling the run-time system.
514      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
515      if [ -x run.$ARCH-$OPSYS ]; then      if [ -x run.$ARCH-$OPSYS ]; then
516          mv run.$ARCH-$OPSYS $RUNDIR          mv run.$ARCH-$OPSYS $RUNDIR
517          # $MAKE MAKE=$MAKE clean          # $MAKE MAKE=$MAKE clean
518      else      else
519          echo "!!! Run-time system build failed for some reason."          echo "$this: !!! Run-time system build failed for some reason."
520          exit 1          exit 1
521      fi      fi
522  fi  fi
# Line 364  Line 526 
526  # boot the base SML system  # boot the base SML system
527  #  #
528  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then
529      echo Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.      echo $this: Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.
530  else  else
531      unpack bin $ROOT $BOOT_FILES $ROOT/$VERSION-$BOOT_FILES      unpack bin $ROOT $BOOT_FILES $BOOT_ARCHIVE
532      cd $ROOT/$BOOT_FILES      cd $ROOT/$BOOT_FILES
533      if $BINDIR/.link-sml @SMLheap=$ROOT/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC      if $BINDIR/.link-sml @SMLheap=$ROOT/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC
534      then      then
# Line 380  Line 542 
542              # the pathconfig file.              # the pathconfig file.
543              #              #
544              cd $ROOT/$BOOT_FILES              cd $ROOT/$BOOT_FILES
545              for lib in *.cm ; do              for anchor in * ; do
546                  echo $lib $LIBDIR/$lib >>$CM_PATHCONFIG_DEFAULT                  if [ -d $anchor ] ; then
547                  movelibs $ROOT/$BOOT_FILES/$lib $lib                      echo $anchor $anchor >>$CM_PATHCONFIG_DEFAULT
548                        move $anchor $LIBDIR/$anchor
549                    fi
550              done              done
551              cd $ROOT              cd $ROOT
552              # rm -rf $BOOT_FILES              # $BOOT_FILES is now only an empty skeleton, let's get rid of it.
553                rm -rf $BOOT_FILES
554    
555          else          else
556              echo "!!! Boot code did not produce heap image (sml.$HEAP_SUFFIX)."              echo "$this !!! No heap image generated (sml.$HEAP_SUFFIX)."
557              exit 1              exit 1
558          fi          fi
559      else      else
560          echo "!!! Boot code failed, no heap image built (sml.$HEAP_SUFFIX)."          echo "$this !!! Boot code failed, no heap image (sml.$HEAP_SUFFIX)."
561          exit 1          exit 1
562      fi      fi
563  fi  fi
# Line 402  Line 567 
567  #  #
568  cd $ROOT  cd $ROOT
569  rm -f $LOCALPATHCONFIG $LIBLIST  rm -f $LOCALPATHCONFIG $LIBLIST
570  echo 'OS.Process.exit (if true' >$LIBLIST  echo 'ignore (OS.Process.exit (if true' >$LIBLIST
571    
572  #  #
573  # now build (or prepare to build) the individual targets  # now build (or prepare to build) the individual targets
574  #  #
575  cd $SRCDIR  cd $SRCDIR
576  echo Installing other targets.  echo $this: Installing other targets.
577  for i in $TARGETS ; do  for i in $TARGETS ; do
578      case $i in      case $i in
579        src-smlnj)        src-smlnj)
580          for src in compiler cm MLRISC smlnj-lib ml-yacc system          for src in compiler cm MLRISC smlnj-lib ml-yacc system
581          do          do
582              unpack $src $ROOT/src $src $ROOT/$VERSION-$src              unpack $src $ROOT/src $src $src
583          done          done
584          ;;          ;;
585        ml-yacc)        ml-yacc)
# Line 430  Line 595 
595          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
596          ;;          ;;
597        smlnj-lib)        smlnj-lib)
598          unpack "SML/NJ Library" $SRCDIR smlnj-lib $ROOT/$VERSION-smlnj-lib          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib
599    
600          # Don't make the Util library -- it came pre-made and has been          # Don't make the Util library -- it came pre-made and has been
601          # installed when making the base system.  In other words, don't do...          # installed when making the base system.  In other words, don't do...
# Line 449  Line 614 
614              reglib reactive-lib.cm smlnj-lib/Reactive              reglib reactive-lib.cm smlnj-lib/Reactive
615          ;;          ;;
616        cml)        cml)
617          unpack CML $SRCDIR cml $ROOT/$VERSION-cml          unpack CML $SRCDIR cml cml
618          reglib core-cml.cm cml/src/core-cml          reglib core-cml.cm cml/src/core-cml
619          reglib cml.cm cml/src          reglib cml.cm cml/src
620          reglib cml-basis.cm cml          reglib cml-basis.cm cml
621          ;;          ;;
622        cml-lib)        cml-lib)
623          unpack CML $SRCDIR cml $ROOT/$VERSION-cml          unpack CML $SRCDIR cml cml
624          reglib cml-lib.cm cml/cml-lib          reglib cml-lib.cm cml/cml-lib
625          ;;          ;;
626        eXene)        eXene)
627          unpack EXene $SRCDIR eXene $ROOT/$VERSION-eXene          unpack EXene $SRCDIR eXene eXene
628          reglib eXene.cm eXene          reglib eXene.cm eXene
629          ;;          ;;
630        doc)        doc)
631          unpack Doc $ROOT doc $ROOT/$VERSION-doc          unpack Doc $ROOT doc doc
632          cd $ROOT/doc          cd $ROOT/doc
633          build $ROOT          build $ROOT
634          ;;          ;;
635        *)        *)
636          echo "!!! Unknown target $i."          echo "$this: !!! Unknown target $i."
637          ;;          ;;
638      esac      esac
639  done  done
# Line 479  Line 644 
644  # $SRCDIR, so we must consult $LOCALPATHCONFIG.  # $SRCDIR, so we must consult $LOCALPATHCONFIG.
645  #  #
646    
647  echo Compiling library code.  echo $this: Compiling library code.
648  echo 'then OS.Process.success else OS.Process.failure);' >>$LIBLIST  echo 'then OS.Process.success else OS.Process.failure));' >>$LIBLIST
649  if CM_LOCAL_PATHCONFIG=$LOCALPATHCONFIG $BINDIR/sml <$LIBLIST ; then  if CM_LOCAL_PATHCONFIG=$LOCALPATHCONFIG $BINDIR/sml <$LIBLIST ; then
650      echo Libraries compiled successfully.      echo $this: Libraries compiled successfully.
651  else  else
652      echo "!!! Something went wrong when compiling the libraries."      echo "$this: !!! Something went wrong when compiling the libraries."
653      exit 1      exit 1
654  fi  fi
655    
656  #  #
657  # Finally, move the libraries to their final locations...  # Move the libraries to their final locations...
658  #  #
659    
660  if [ -r $LIBMOVESCRIPT ] ; then  if [ -r $LIBMOVESCRIPT ] ; then
661      echo Moving libraries to $LIBDIR.      echo $this: Moving libraries to $LIBDIR.
662      . $LIBMOVESCRIPT      . $LIBMOVESCRIPT
663  fi  fi
664    
665    #
666    # Finally, remove duplicate entries from pathconfig file...
667    #
668    if [ -f $CM_PATHCONFIG_DEFAULT ] ; then
669        cp $CM_PATHCONFIG_DEFAULT $PCEDITTMP
670        rm -f $CM_PATHCONFIG_DEFAULT
671        awk <$PCEDITTMP 'NF == 2 { mapping[$1] = $2 }
672    NF != 2 { print $0 }
673    END { for (i in mapping) print i, mapping[i] }' \
674          | sort >$CM_PATHCONFIG_DEFAULT
675    fi
676    
677  exit 0  exit 0

Legend:
Removed from v.537  
changed lines
  Added in v.691

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