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

revision 573, Thu Mar 9 15:23:52 2000 UTC revision 833, Tue May 22 22:06:12 2001 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.customized ] ; then
18      echo "!!! File config/targets is missing."      . config/targets.customized
19    elif [ ! -r config/targets ]; then
20        echo "$this: !!! File config/targets is missing."
21      exit 1      exit 1
22  fi  else
23  . config/targets  . config/targets
24    fi
25    
26  #  #
27  # create the preloads.standard file  # create the preloads.standard file
28  #  #
29  if [ ! -r config/preloads ]; then  if [ ! -r config/preloads ]; then
30      echo "!!! File config/preloads is missing."      echo "$this: !!! File config/preloads is missing."
31      exit 1      exit 1
32  fi  fi
33  cp config/preloads preloads.standard  cp config/preloads preloads.standard
# Line 33  Line 38 
38  #  #
39  MAKE=make  MAKE=make
40    
41    #
42    # Make sure we don't have any unpleasant surprises due to the installing
43    # user's process environment:
44    #
45    unset CM_PATHCONFIG
46    
47  SHELL=/bin/sh  SHELL=/bin/sh
48  echo Using shell $SHELL.  echo $this: Using shell $SHELL.
49    
50  #  #
51  # set the SML root directory  # set the SML root directory
52  #  #
53  REAL_PWD=`pwd`  REAL_PWD=`pwd`
54  ROOT=${PWD:-$REAL_PWD}  ROOT=${PWD:-$REAL_PWD}
55  echo SML root is $ROOT.  echo $this: SML root is $ROOT.
56  echo Installation directory is ${INSTALLDIR:=$ROOT}.  echo $this: Installation directory is ${INSTALLDIR:=$ROOT}.
57    
58  #  #
59  # set the various directory and file pathname variables  # set the various directory and file pathname variables
# Line 54  Line 65 
65  SRCDIR=$ROOT/src                # where the source tree is rooted  SRCDIR=$ROOT/src                # where the source tree is rooted
66  LIBDIR=$INSTALLDIR/lib          # where libraries live  LIBDIR=$INSTALLDIR/lib          # where libraries live
67  LIBLIST=$ROOT/liblist           # list of commands to stabilize libraries  LIBLIST=$ROOT/liblist           # list of commands to stabilize libraries
68    LATESTANDALONES=$ROOT/latestandalones # standalone programs to be built late
69  LIBMOVESCRIPT=$ROOT/libmove     # a temporary script  LIBMOVESCRIPT=$ROOT/libmove     # a temporary script
70  LOCALPATHCONFIG=$INSTALLDIR/pathconfig # a temporary pathconfig file  LOCALPATHCONFIG=$INSTALLDIR/pathconfig # a temporary pathconfig file
71    
72  URLGETTER=unknown  URLGETTER=unknown
73    
74  #  #
75  # 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
76    # ml-makedepend live
77  #  #
78  TOOLDIR=$BINDIR  TOOLDIR=$BINDIR
79    
80  #  #
81    # A temporary file for post-editing the pathconfig file...
82    #
83    PCEDITTMP=$INSTALLDIR/pcedittmp.$$
84    
85    #
86  # files to be deleted after we are done...  # files to be deleted after we are done...
87  #  #
88  tmpfiles=""  tmpfiles=""
89  tmpfiles="$tmpfiles $ROOT/preloads.standard"  tmpfiles="$tmpfiles $ROOT/preloads.standard"
90  tmpfiles="$tmpfiles $LIBLIST"  tmpfiles="$tmpfiles $LIBLIST"
91    tmpfiles="$tmpfiles $LATESTANDALONES"
92  tmpfiles="$tmpfiles $LOCALPATHCONFIG"  tmpfiles="$tmpfiles $LOCALPATHCONFIG"
93  tmpfiles="$tmpfiles $LIBMOVESCRIPT"  tmpfiles="$tmpfiles $LIBMOVESCRIPT"
94    tmpfiles="$tmpfiles $PCEDITTMP"
95  #  #
96  # make sure we always clean up after ourselves...  # make sure we always clean up after ourselves...
97  #  #
# Line 90  Line 110 
110  # the release version that we are installing  # the release version that we are installing
111  #  #
112  VERSION=`cat $CONFIGDIR/version`  VERSION=`cat $CONFIGDIR/version`
113  echo Installing version $VERSION.  echo $this: Installing version $VERSION.
114    
115  #  #
116  # the URL for the (usually remote) source archive  # the URL for the (usually remote) source archive
117  #  #
118  SRCARCHIVEURL=`cat $CONFIGDIR/srcarchiveurl`  SRCARCHIVEURL=`cat $CONFIGDIR/srcarchiveurl`
119  echo URL of source archive is $SRCARCHIVEURL.  echo $this: URL of source archive is $SRCARCHIVEURL.
120    
121  #  #
122  # Function to make a directory (and advertise such action).  # Function to make a directory (and advertise such action).
123  #  #
124  makedir() {  makedir() {
125      if [ ! -d $1 ] ; then      if [ ! -d $1 ] ; then
126          echo Making directory $1          echo $this: Making directory $1
127          if mkdir $1 ; then          if mkdir $1 ; then
128              : everything is fine              : everything is fine
129          else          else
130              echo "!!! Unable to make directory $1!"              echo "$this: !!! Unable to make directory $1!"
131              exit 1              exit 1
132          fi          fi
133      fi      fi
# Line 120  Line 140 
140  #   $3 - remote directory  #   $3 - remote directory
141  #  #
142  askurl() {  askurl() {
143      echo Please, fetch $1 archive '('$VERSION-$2.'*)' from      echo "$this: Please, fetch $1 archive"
144      echo '  ' $3      echo ' ('$2.'*' or $VERSION-$2.'*)'
145        echo " from $3"
146      echo "and then re-run this script!"      echo "and then re-run this script!"
147      exit 1      exit 1
148  }  }
# Line 130  Line 151 
151  # Function for fetching source archives automatically using wget or lynx.  # Function for fetching source archives automatically using wget or lynx.
152  #   $1 - command to actually get the stuff  #   $1 - command to actually get the stuff
153  #   $2 - descriptive name  #   $2 - descriptive name
154  #   $3 - base name without extension, without version, and without dir  #   $3 - base name without extension and without dir
155  #   $4 - remote directory  #   $4 - remote directory
156  #  #
157  fetchurl() {  fetchurl() {
158      getter=$1 ; shift      getter=$1 ; shift
159      echo Fetching $1 from $2. Please stand by...      echo $this: Fetching $1 from $3. Please stand by...
160      fetched=no      fetched=no
161      for ext in tgz tar.gz tar.Z tz tar tar.bz2 ; do      for base in $2 $VERSION-$2 ; do
162          try=$VERSION-$2.$ext          for ext in tar.gz tgz tar.Z tz tar tar.bz2 ; do
163          echo Trying $try ...              try=$base.$ext
164                echo $this: Trying $try ...
165          if $getter $3 $try $ROOT/$try ; then          if $getter $3 $try $ROOT/$try ; then
166              fetched=yes              fetched=yes
167              echo Success.                  echo $this: Fetching $try was a success.
168              break                  break 2         # get out of both for-loops
169          else          else
170              rm -f $ROOT/$try              rm -f $ROOT/$try
171          fi          fi
172      done      done
173        done
174      if [ $fetched = no ] ; then      if [ $fetched = no ] ; then
175          echo No success.  You should try to do it manually now.          echo $this: Fetching $try was no success.
176            echo '  ' You should try to do it manually now.
177          askurl "$1" "$2" "$3"          askurl "$1" "$2" "$3"
178      fi      fi
179  }  }
# Line 182  Line 206 
206      fi      fi
207  }  }
208    
209    un_tar() {
210        echo "$this: Un-TAR-ing $1 archive."
211        tar -xf $2
212    }
213    
214    un_tar_Z() {
215        echo "$this: Un-COMPRESS-ing and un-TAR-ing $1 archive."
216        zcat $2 | tar -xf -
217    }
218    
219    un_tar_gz() {
220        echo "$this: Un-GZIP-ing and un-TAR-ing $1 archive."
221        gunzip -c $2 | tar -xf -
222    }
223    
224    un_tar_bz2() {
225        echo "$this: Un-BZIP2-ing and un-TAR-ing $1 archive."
226        bunzip2 -c $2 | tar -xf -
227    }
228    
229    unarchive() {
230        # $1: descriptive string, $2: archive, $3: unpacker
231        if [ -r $ROOT/$2 ] ; then
232            $3 "$1" $ROOT/$2
233        elif [ -r $ROOT/$VERSION-$2 ]; then
234            $3 "$1" $ROOT/$VERSION-$2
235        else
236            return 1
237        fi
238    }
239    
240  #  #
241  # Function to unpack a source archive.  # Function to unpack a source archive.
242  #  #
# Line 193  Line 248 
248  #     be used)  #     be used)
249  #  #
250  # fetch_n_unpack is the helper function that does the real work.  If  # fetch_n_unpack is the helper function that does the real work.  If
251  # on archive is found locally, it invokes $URLGETTER and tries again.  # no archive is found locally, it invokes $URLGETTER and tries again.
252  # The variable $tryfetch is used to make sure this happens only once.  # The variable $tryfetch is used to make sure this happens only once.
253  fetch_n_unpack() {  fetch_n_unpack() {
     larc=$ROOT/$VERSION-$4  
254      cd $2      cd $2
255      if [ -r $larc.tar.Z ] ; then      if unarchive "$1" $4.tar.gz un_tar_gz ||
256          echo "Un-compress-ing and un-tar-ing $1 archive."         unarchive "$1" $4.tgz un_tar_gz ||
257          zcat $larc.tar.Z | tar -xf -         unarchive "$1" $4.tar.Z un_tar_Z ||
258      elif [ -r $larc.tar ] ; then         unarchive "$1" $4.tar un_tar ||
259          echo "Un-tar-ing $1 archive."         unarchive "$1" $4.tar.bz1 un_tar_bz2 ||
260          tar -xf $larc.tar         unarchive "$1" $4.tz un_tar_Z
261      elif [ -r $larc.tar.gz ] ; then      then
262          echo "Un-gzip-ing and un-tar-ing $1 archive."          : we are done
         gunzip -c $larc.tar.gz | tar -xf -  
     elif [ -r $larc.tar.bz2 ] ; then  
         echo "Un-bzip2-ing and un-tar-ing $1 archive."  
         bunzip2 -c $larc.tar.bz2 | tar -xf -  
     elif [ -r $larc.tgz ] ; then  
         echo "Un-gzip-ing and un-tar-ing $1 archive."  
         gunzip -c $larc.tgz | tar -xf -  
     elif [ -r $larc.tz ] ; then  
         echo "Un-compress-ing and un-tar-ing $1 archive."  
         zcat $larc.tz | tar -xf -  
263      elif [ $tryfetch = yes ] ; then      elif [ $tryfetch = yes ] ; then
264          urlgetter          urlgetter
265          $URLGETTER "$1" $4 $SRCARCHIVEURL          $URLGETTER "$1" $4 $SRCARCHIVEURL
# Line 230  Line 274 
274  unpack() {  unpack() {
275      tryfetch=yes      tryfetch=yes
276      if [ -d $2/$3 ]; then      if [ -d $2/$3 ]; then
277          echo "The $1 tree already exists."          echo "$this: The $1 tree already exists."
278      else      else
279          fetch_n_unpack "$1" "$2" "$3" "$4"          fetch_n_unpack "$1" "$2" "$3" "$4"
280      fi      fi
281      if [ ! -d $2/$3 ]; then      if [ ! -d $2/$3 ]; then
282          echo "!!! Unable to unpack $1 archive."          echo "$this: !!! Unable to unpack $1 archive."
283          exit 1          exit 1
284      fi      fi
285  }  }
# Line 248  Line 292 
292      if [ -d $1 ] ; then      if [ -d $1 ] ; then
293          if [ ! -d $2 ] ; then          if [ ! -d $2 ] ; then
294              if [ -f $2 ] ; then              if [ -f $2 ] ; then
295                  echo install.sh: $2 exists as a non-directory.                  echo $this: $2 exists as a non-directory.
296                  exit 1                  exit 1
297              fi              fi
298              mkdir $2              mkdir $2
# Line 280  Line 324 
324          case $lib in          case $lib in
325          *.cm | *.cmi)          *.cm | *.cmi)
326              if [ $lib != $2 ] ; then              if [ $lib != $2 ] ; then
327                  echo "! Warning:" $lib specified relative to $2                  echo "$this: Warning:" $lib specified relative to $2
328              fi              fi
329              echo Moving library $lib to $LIBDIR              echo $this: Moving library $lib to $LIBDIR
330              makedir $LIBDIR/$2              makedir $LIBDIR/$2
331              makedir $LIBDIR/$2/CM              makedir $LIBDIR/$2/CM
332              makedir $LIBDIR/$2/CM/$ARCH-unix              makedir $LIBDIR/$2/CM/$ARCH-unix
# Line 308  Line 352 
352  reglib() {  reglib() {
353      if [ x$MOVE_LIBRARIES = xtrue ] ; then      if [ x$MOVE_LIBRARIES = xtrue ] ; then
354          FINALLOCATION=$LIBDIR/$1          FINALLOCATION=$LIBDIR/$1
355            FINALCONFIGPATH=$1
356      else      else
357          FINALLOCATION=$SRCDIR/$2          FINALLOCATION=$SRCDIR/$2
358            FINALCONFIGPATH=$FINALLOCATION
359      fi      fi
360      if [ -d $FINALLOCATION/CM/$ARCH-unix ] ; then      if [ -d $FINALLOCATION/CM/$ARCH-unix ] ; then
361          echo "Library $1 already exists in $FINALLOCATION."          echo "$this: Library $1 already exists in $FINALLOCATION."
362      else      else
363          echo "Scheduling library $1 to be built in $FINALLOCATION."          echo "$this: Scheduling library $1 to be built in $FINALLOCATION."
364          echo "andalso CM.stabilize false \"$1\"" >>$LIBLIST          echo "  andalso CM.stabilize false \"\$/$1\"" >>$LIBLIST
365          echo $1 $SRCDIR/$2 >>$LOCALPATHCONFIG          echo $1 $SRCDIR/$2 >>$LOCALPATHCONFIG
366          if [ x$MOVE_LIBRARIES = xtrue ] ; then          if [ x$MOVE_LIBRARIES = xtrue ] ; then
367              echo movelibs $SRCDIR/$2 $1 >>$LIBMOVESCRIPT              echo movelibs $SRCDIR/$2 $1 >>$LIBMOVESCRIPT
368          fi          fi
         echo $1 $FINALLOCATION >>$CM_PATHCONFIG_DEFAULT  
369      fi      fi
370        echo $1 $FINALCONFIGPATH >>$CM_PATHCONFIG_DEFAULT
371  }  }
372    
373  #  #
# Line 341  Line 387 
387          TARGETLOC=$TARGET          TARGETLOC=$TARGET
388      fi      fi
389      if [ -r $HEAPDIR/$TARGET ] ; then      if [ -r $HEAPDIR/$TARGET ] ; then
390          echo Target $TARGET already exists.          echo $this: Target $TARGET already exists.
391      else      else
392          echo Building $TARGET.          echo $this: Building $TARGET.
393          unpack $2 $SRCDIR $1 $1          unpack $2 $SRCDIR $1 $1
394          cd $SRCDIR/$1          cd $SRCDIR/$1
395          ./build          # build it, but make sure we don't pick up some (unrelated)
396            # local path configuration...
397            CM_LOCAL_PATHCONFIG=/dev/null ./build
398          if [ -r $TARGETLOC ] ; then          if [ -r $TARGETLOC ] ; then
399              mv $TARGETLOC $HEAPDIR/$TARGET              mv $TARGETLOC $HEAPDIR/$TARGET
400              if [ ! -f $BINDIR/$1 ] ; then              if [ ! -f $BINDIR/$1 ] ; then
# Line 354  Line 402 
402                  ln -s .run-sml $1                  ln -s .run-sml $1
403              fi              fi
404          else          else
405              echo "!!! Build of $TARGET failed."              echo "$this: !!! Build of $TARGET failed."
406          fi          fi
407      fi      fi
408  }  }
# Line 362  Line 410 
410  #  #
411  # create the various sub directories  # create the various sub directories
412  #  #
413  for dir in $BINDIR $HEAPDIR $RUNDIR $LIBDIR $SRCDIR  for dir in $BINDIR $HEAPDIR $RUNDIR $LIBDIR $SRCDIR ; do
 do  
414      makedir $dir      makedir $dir
415  done  done
416    
# Line 371  Line 418 
418  # 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
419  #  #
420  if [ -x $BINDIR/.arch-n-opsys ]; then  if [ -x $BINDIR/.arch-n-opsys ]; then
421      echo Script $BINDIR/.arch-n-opsys already exists.      echo $this: Script $BINDIR/.arch-n-opsys already exists.
422  else  else
423      cat $CONFIGDIR/_arch-n-opsys \      cat $CONFIGDIR/_arch-n-opsys \
424      | sed -e "s,@SHELL@,$SHELL,g" > $BINDIR/.arch-n-opsys      | sed -e "s,@SHELL@,$SHELL,g" > $BINDIR/.arch-n-opsys
425      chmod 555 $BINDIR/.arch-n-opsys      chmod 555 $BINDIR/.arch-n-opsys
426      if [ ! -x $BINDIR/.arch-n-opsys ]; then      if [ ! -x $BINDIR/.arch-n-opsys ]; then
427          echo "!!! Installation of $BINDIR/.arch-n-opsys failed."          echo "$this: !!! Installation of $BINDIR/.arch-n-opsys failed."
428          exit 1          exit 1
429      fi      fi
430  fi  fi
431    
432  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`
433  if [ "$?" != "0" ]; then  if [ "$?" != "0" ]; then
434      echo "!!! Script $BINDIR/.arch-n-opsys fails on this machine."      echo "$this: !!! Script $BINDIR/.arch-n-opsys fails on this machine."
435      echo "!!! You must patch this by hand and repeat the installation."      echo "$this: !!! You must patch this by hand and repeat the installation."
436      exit 2      exit 2
437  else  else
438      echo Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.      echo $this: Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.
439  fi  fi
440  eval $ARCH_N_OPSYS  eval $ARCH_N_OPSYS
441    
# Line 404  Line 451 
451  # for an outdated driver script, but not all "test" commands understand  # for an outdated driver script, but not all "test" commands understand
452  # the -nt comparison operator....)  # the -nt comparison operator....)
453  #   if [ -x $BINDIR/$ddst ]; then  #   if [ -x $BINDIR/$ddst ]; then
454  #       echo Script $BINDIR/$ddst already exists.  #       echo $this: Script $BINDIR/$ddst already exists.
455  #   else  #   else
456          rm -f $BINDIR/$ddst          rm -f $BINDIR/$ddst
457          cat $CONFIGDIR/$dsrc | \          cat $CONFIGDIR/$dsrc | \
# Line 414  Line 461 
461              > $BINDIR/$ddst              > $BINDIR/$ddst
462          chmod 555 $BINDIR/$ddst          chmod 555 $BINDIR/$ddst
463          if [ ! -x $BINDIR/$ddst ]; then          if [ ! -x $BINDIR/$ddst ]; then
464              echo "!!! Installation of $BINDIR/${ddst} failed."              echo "$this: !!! Installation of $BINDIR/${ddst} failed."
465              exit 1              exit 1
466          fi          fi
467  #   fi  #   fi
# Line 423  Line 470 
470  installdriver _run-sml .run-sml  installdriver _run-sml .run-sml
471  installdriver _link-sml .link-sml  installdriver _link-sml .link-sml
472  installdriver _ml-build ml-build  installdriver _ml-build ml-build
473    installdriver _ml-makedepend ml-makedepend
474    
475  #  #
476  # set some architecture dependent run-time system flags  # set some architecture dependent run-time system flags
# Line 432  Line 480 
480          ALLOC=1M          ALLOC=1M
481          ;;          ;;
482      x86)      x86)
483            # The following is the _wrong_ value for many popular x86 chips
484            # (i.e., Celerons).  However, the optimal value for those is 32k,
485            # and such a small value is not enough for the runtime system's boot
486            # code.  Therefore, we use 256k here and re-set it to the proper
487            # value in .run-sml.
488          ALLOC=256k          ALLOC=256k
489          ;;          ;;
490      alpha32)      alpha32)
# Line 449  Line 502 
502      linux)      linux)
503          EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`          EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`
504          if [ "$?" != "0" ]; then          if [ "$?" != "0" ]; then
505              echo "!!! Problems checking for underscores in global names."              echo "$this: !!! Problems checking for underscores in asm names."
506              exit 1              exit 1
507          fi          fi
508          EXTRA_DEFS="XDEFS=$EXTRA_DEFS"          EXTRA_DEFS="XDEFS=$EXTRA_DEFS"
# Line 459  Line 512 
512  #  #
513  # the name of the bin files directory  # the name of the bin files directory
514  #  #
515  BOOT_FILES=sml.boot.$ARCH-unix  BOOT_ARCHIVE=boot.$ARCH-unix
516    BOOT_FILES=sml.$BOOT_ARCHIVE
517    
518  #  #
519  # build the run-time system  # build the run-time system
520  #  #
521  unpack "run-time" $SRCDIR runtime runtime  unpack "run-time" $SRCDIR runtime runtime
522  if [ -x $RUNDIR/run.$ARCH-$OPSYS ]; then  if [ -x $RUNDIR/run.$ARCH-$OPSYS ]; then
523      echo Run-time system already exists.      echo $this: Run-time system already exists.
524  else  else
525      cd $SRCDIR/runtime/objs      cd $SRCDIR/runtime/objs
526      echo Compiling the run-time system.      echo $this: Compiling the run-time system.
527      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
528      if [ -x run.$ARCH-$OPSYS ]; then      if [ -x run.$ARCH-$OPSYS ]; then
529          mv run.$ARCH-$OPSYS $RUNDIR          mv run.$ARCH-$OPSYS $RUNDIR
530          # $MAKE MAKE=$MAKE clean          $MAKE MAKE=$MAKE clean
531      else      else
532          echo "!!! Run-time system build failed for some reason."          echo "$this: !!! Run-time system build failed for some reason."
533          exit 1          exit 1
534      fi      fi
535  fi  fi
# Line 485  Line 539 
539  # boot the base SML system  # boot the base SML system
540  #  #
541  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then
542      echo Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.      echo $this: Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.
543  else  else
544      unpack bin $ROOT $BOOT_FILES $BOOT_FILES      unpack bin $ROOT $BOOT_FILES $BOOT_ARCHIVE
545      cd $ROOT/$BOOT_FILES      cd $ROOT/$BOOT_FILES
546      if $BINDIR/.link-sml @SMLheap=$ROOT/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC      if $BINDIR/.link-sml @SMLheap=$ROOT/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC
547      then      then
# Line 512  Line 566 
566              rm -rf $BOOT_FILES              rm -rf $BOOT_FILES
567    
568          else          else
569              echo "!!! Boot code did not produce heap image (sml.$HEAP_SUFFIX)."              echo "$this !!! No heap image generated (sml.$HEAP_SUFFIX)."
570              exit 1              exit 1
571          fi          fi
572      else      else
573          echo "!!! Boot code failed, no heap image built (sml.$HEAP_SUFFIX)."          echo "$this !!! Boot code failed, no heap image (sml.$HEAP_SUFFIX)."
574          exit 1          exit 1
575      fi      fi
576  fi  fi
# Line 526  Line 580 
580  #  #
581  cd $ROOT  cd $ROOT
582  rm -f $LOCALPATHCONFIG $LIBLIST  rm -f $LOCALPATHCONFIG $LIBLIST
583  echo 'OS.Process.exit (if true' >$LIBLIST  echo 'ignore (OS.Process.exit (if true' >$LIBLIST
584    
585  #  #
586  # now build (or prepare to build) the individual targets  # now build (or prepare to build) the individual targets
587  #  #
588  cd $SRCDIR  cd $SRCDIR
589  echo Installing other targets.  echo $this: Installing other targets.
590  for i in $TARGETS ; do  for i in $TARGETS ; do
591      case $i in      case $i in
592        src-smlnj)        src-smlnj)
# Line 553  Line 607 
607          standalone ml-burg ML-Burg          standalone ml-burg ML-Burg
608          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
609          ;;          ;;
610          ml-nlffigen)
611            echo standalone ml-nlffigen ML-NLFFI-Gen >>$LATESTANDALONES
612            echo ml-nlffigen $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
613            ;;
614        smlnj-lib)        smlnj-lib)
615          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib
616    
# Line 586  Line 644 
644          unpack EXene $SRCDIR eXene eXene          unpack EXene $SRCDIR eXene eXene
645          reglib eXene.cm eXene          reglib eXene.cm eXene
646          ;;          ;;
647          ckit)
648            unpack "C-Kit" $ROOT ckit ckit
649            reglib ckit-lib.cm ../ckit/src
650            ;;
651          ml-nlffi-lib)
652            unpack "NLFFI Library" $SRCDIR ml-nlffi-lib ml-nlffi-lib
653            reglib memory.cm ml-nlffi-lib/memory
654            reglib c-int.cm ml-nlffi-lib/internals
655            reglib c.cm ml-nlffi-lib
656            ;;
657        doc)        doc)
658          unpack Doc $ROOT doc doc          unpack Doc $ROOT doc doc
659          cd $ROOT/doc          cd $ROOT/doc
660          build $ROOT          build $ROOT
661          ;;          ;;
662        *)        *)
663          echo "!!! Unknown target $i."          echo "$this: !!! Unknown target $i."
664          ;;          ;;
665      esac      esac
666  done  done
# Line 603  Line 671 
671  # $SRCDIR, so we must consult $LOCALPATHCONFIG.  # $SRCDIR, so we must consult $LOCALPATHCONFIG.
672  #  #
673    
674  echo Compiling library code.  echo $this: Compiling library code.
675  echo 'then OS.Process.success else OS.Process.failure);' >>$LIBLIST  echo 'then OS.Process.success else OS.Process.failure));' >>$LIBLIST
676  if CM_LOCAL_PATHCONFIG=$LOCALPATHCONFIG $BINDIR/sml <$LIBLIST ; then  if CM_LOCAL_PATHCONFIG=$LOCALPATHCONFIG $BINDIR/sml <$LIBLIST ; then
677      echo Libraries compiled successfully.      echo $this: Libraries compiled successfully.
678  else  else
679      echo "!!! Something went wrong when compiling the libraries."      echo "$this: !!! Something went wrong when compiling the libraries."
680      exit 1      exit 1
681  fi  fi
682    
683  #  #
684  # Finally, move the libraries to their final locations...  # Move the libraries to their final locations...
685  #  #
686    
687  if [ -r $LIBMOVESCRIPT ] ; then  if [ -r $LIBMOVESCRIPT ] ; then
688      echo Moving libraries to $LIBDIR.      echo $this: Moving libraries to $LIBDIR.
689      . $LIBMOVESCRIPT      . $LIBMOVESCRIPT
690  fi  fi
691    
692    #
693    # Build "late" standalone programs (i.e., those that must be built
694    # after libraries are already in place):
695    #
696    
697    if [ -r $LATESTANDALONES ] ; then
698        echo $this: Building late standalone programs.
699        . $LATESTANDALONES
700    fi
701    
702    #
703    # Finally, remove duplicate entries from pathconfig file...
704    #
705    if [ -f $CM_PATHCONFIG_DEFAULT ] ; then
706        cp $CM_PATHCONFIG_DEFAULT $PCEDITTMP
707        rm -f $CM_PATHCONFIG_DEFAULT
708        awk <$PCEDITTMP 'NF == 2 { mapping[$1] = $2 }
709    NF != 2 { print $0 }
710    END { for (i in mapping) print i, mapping[i] }' \
711          | sort >$CM_PATHCONFIG_DEFAULT
712    fi
713    
714  exit 0  exit 0

Legend:
Removed from v.573  
changed lines
  Added in v.833

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