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 569, Tue Mar 7 04:01:07 2000 UTC revision 829, Mon May 14 15:30:56 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 ]; 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 33  Line 35 
35  #  #
36  MAKE=make  MAKE=make
37    
38    #
39    # Make sure we don't have any unpleasant surprises due to the installing
40    # user's process environment:
41    #
42    unset CM_PATHCONFIG
43    
44  SHELL=/bin/sh  SHELL=/bin/sh
45  echo Using shell $SHELL.  echo $this: Using shell $SHELL.
46    
47  #  #
48  # set the SML root directory  # set the SML root directory
49  #  #
50  REAL_PWD=`pwd`  REAL_PWD=`pwd`
51  ROOT=${PWD:-$REAL_PWD}  ROOT=${PWD:-$REAL_PWD}
52  echo SML root is $ROOT.  echo $this: SML root is $ROOT.
53  echo Installation directory is ${INSTALLDIR:=$ROOT}.  echo $this: Installation directory is ${INSTALLDIR:=$ROOT}.
54    
55  #  #
56  # set the various directory and file pathname variables  # set the various directory and file pathname variables
# Line 54  Line 62 
62  SRCDIR=$ROOT/src                # where the source tree is rooted  SRCDIR=$ROOT/src                # where the source tree is rooted
63  LIBDIR=$INSTALLDIR/lib          # where libraries live  LIBDIR=$INSTALLDIR/lib          # where libraries live
64  LIBLIST=$ROOT/liblist           # list of commands to stabilize libraries  LIBLIST=$ROOT/liblist           # list of commands to stabilize libraries
65    LATESTANDALONES=$ROOT/latestandalones # standalone programs to be built late
66  LIBMOVESCRIPT=$ROOT/libmove     # a temporary script  LIBMOVESCRIPT=$ROOT/libmove     # a temporary script
67  LOCALPATHCONFIG=$INSTALLDIR/pathconfig # a temporary pathconfig file  LOCALPATHCONFIG=$INSTALLDIR/pathconfig # a temporary pathconfig file
68    
69    URLGETTER=unknown
70    
71  #  #
72  # 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
73    # ml-makedepend live
74  #  #
75  TOOLDIR=$BINDIR  TOOLDIR=$BINDIR
76    
77  #  #
78    # A temporary file for post-editing the pathconfig file...
79    #
80    PCEDITTMP=$INSTALLDIR/pcedittmp.$$
81    
82    #
83  # files to be deleted after we are done...  # files to be deleted after we are done...
84  #  #
85  tmpfiles=""  tmpfiles=""
86  tmpfiles="$tmpfiles $ROOT/preloads.standard"  tmpfiles="$tmpfiles $ROOT/preloads.standard"
87  tmpfiles="$tmpfiles $LIBLIST"  tmpfiles="$tmpfiles $LIBLIST"
88    tmpfiles="$tmpfiles $LATESTANDALONES"
89  tmpfiles="$tmpfiles $LOCALPATHCONFIG"  tmpfiles="$tmpfiles $LOCALPATHCONFIG"
90  tmpfiles="$tmpfiles $LIBMOVESCRIPT"  tmpfiles="$tmpfiles $LIBMOVESCRIPT"
91    tmpfiles="$tmpfiles $PCEDITTMP"
92  #  #
93  # make sure we always clean up after ourselves...  # make sure we always clean up after ourselves...
94  #  #
# Line 88  Line 107 
107  # the release version that we are installing  # the release version that we are installing
108  #  #
109  VERSION=`cat $CONFIGDIR/version`  VERSION=`cat $CONFIGDIR/version`
110  echo Installing version $VERSION.  echo $this: Installing version $VERSION.
111    
112    #
113    # the URL for the (usually remote) source archive
114    #
115    SRCARCHIVEURL=`cat $CONFIGDIR/srcarchiveurl`
116    echo $this: URL of source archive is $SRCARCHIVEURL.
117    
118  #  #
119  # Function to make a directory (and advertise such action).  # Function to make a directory (and advertise such action).
120  #  #
121  makedir() {  makedir() {
122      if [ ! -d $1 ] ; then      if [ ! -d $1 ] ; then
123          echo Making directory $1          echo $this: Making directory $1
124          if mkdir $1 ; then          if mkdir $1 ; then
125              : everything is fine              : everything is fine
126          else          else
127              echo "!!! Unable to make directory $1!"              echo "$this: !!! Unable to make directory $1!"
128              exit 1              exit 1
129          fi          fi
130      fi      fi
131  }  }
132    
133  #  #
134    # Function for asking user to fetch source archive.
135    #   $1 - descriptive name
136    #   $2 - base name without extension, without version, and without dir
137    #   $3 - remote directory
138    #
139    askurl() {
140        echo "$this: Please, fetch $1 archive"
141        echo ' ('$2.'*' or $VERSION-$2.'*)'
142        echo " from $3"
143        echo " and then re-run this script!"
144        exit 1
145    }
146    
147    #
148    # Function for fetching source archives automatically using wget or lynx.
149    #   $1 - command to actually get the stuff
150    #   $2 - descriptive name
151    #   $3 - base name without extension and without dir
152    #   $4 - remote directory
153    #
154    fetchurl() {
155        getter=$1 ; shift
156        echo $this: Fetching $1 from $3. Please stand by...
157        fetched=no
158        for base in $2 $VERSION-$2 ; do
159            for ext in tar.gz tgz tar.Z tz tar tar.bz2 ; do
160                try=$base.$ext
161                echo $this: Trying $try ...
162                if $getter $3 $try $ROOT/$try ; then
163                    fetched=yes
164                    echo $this: Fetching $try was a success.
165                    break 2         # get out of both for-loops
166                else
167                    rm -f $ROOT/$try
168                fi
169            done
170        done
171        if [ $fetched = no ] ; then
172            echo $this: Fetching $try was no success.
173            echo '  ' You should try to do it manually now.
174            askurl "$1" "$2" "$3"
175        fi
176    }
177    
178    usewget() {
179        wget -nv -O $3 $1/$2
180    }
181    
182    uselynx() {
183        lynx -source $1/$2 >$3
184    }
185    
186    testurlgetter() {
187        (exec >/dev/null 2>&1 ; exec $*)
188    }
189    
190    #
191    # Function to check whether wget or lynx is available.
192    # Set URLGETTER accordingly.
193    #
194    urlgetter() {
195        if [ "$URLGETTER" = unknown ] ; then
196            if testurlgetter wget --help ; then
197                URLGETTER="fetchurl usewget"
198            elif testurlgetter lynx -help ; then
199                URLGETTER="fetchurl uselynx"
200            else
201                URLGETTER="askurl"
202            fi
203        fi
204    }
205    
206    un_tar() {
207        echo "$this: Un-TAR-ing $1 archive."
208        tar -xf $2
209    }
210    
211    un_tar_Z() {
212        echo "$this: Un-COMPRESS-ing and un-TAR-ing $1 archive."
213        zcat $2 | tar -xf -
214    }
215    
216    un_tar_gz() {
217        echo "$this: Un-GZIP-ing and un-TAR-ing $1 archive."
218        gunzip -c $2 | tar -xf -
219    }
220    
221    un_tar_bz2() {
222        echo "$this: Un-BZIP2-ing and un-TAR-ing $1 archive."
223        bunzip2 -c $2 | tar -xf -
224    }
225    
226    unarchive() {
227        # $1: descriptive string, $2: archive, $3: unpacker
228        if [ -r $ROOT/$2 ] ; then
229            $3 "$1" $ROOT/$2
230        elif [ -r $ROOT/$VERSION-$2 ]; then
231            $3 "$1" $ROOT/$VERSION-$2
232        else
233            return 1
234        fi
235    }
236    
237    #
238  # Function to unpack a source archive.  # Function to unpack a source archive.
239  #  #
240  # $1: descriptive name of the sources to be unpacked  # $1: descriptive name of the sources to be unpacked
# Line 114  Line 243 
243  # $4: the basename of the source archive (the script will check several  # $4: the basename of the source archive (the script will check several
244  #     different suffixes to determine what kind of de-compression is to  #     different suffixes to determine what kind of de-compression is to
245  #     be used)  #     be used)
246    #
247    # fetch_n_unpack is the helper function that does the real work.  If
248    # no archive is found locally, it invokes $URLGETTER and tries again.
249    # The variable $tryfetch is used to make sure this happens only once.
250    fetch_n_unpack() {
251        cd $2
252        if unarchive "$1" $4.tar.gz un_tar_gz ||
253           unarchive "$1" $4.tgz un_tar_gz ||
254           unarchive "$1" $4.tar.Z un_tar_Z ||
255           unarchive "$1" $4.tar un_tar ||
256           unarchive "$1" $4.tar.bz1 un_tar_bz2 ||
257           unarchive "$1" $4.tz un_tar_Z
258        then
259            : we are done
260        elif [ $tryfetch = yes ] ; then
261            urlgetter
262            $URLGETTER "$1" $4 $SRCARCHIVEURL
263            tryfetch=no
264            fetch_n_unpack "$1" "$2" "$3" "$4"
265        fi
266    }
267    
268    #
269    # The main "unpack" driver function that invokes the above helper.
270    #
271  unpack() {  unpack() {
272        tryfetch=yes
273      if [ -d $2/$3 ]; then      if [ -d $2/$3 ]; then
274          echo "The $1 source tree already exists."          echo "$this: The $1 tree already exists."
275      else      else
276          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  
277          fi          fi
278          if [ ! -d $2/$3 ]; then          if [ ! -d $2/$3 ]; then
279              echo "!!! Unable to unpack $1 source archive."          echo "$this: !!! Unable to unpack $1 archive."
280              exit 1              exit 1
281          fi          fi
282    }
283    
284    # A function to move all stable library files to a parallel directory
285    # hierarchy.
286    # The first argument must be a simple path (no / inside), and
287    # the second argument must be an absolute path.
288    move() {
289        if [ -d $1 ] ; then
290            if [ ! -d $2 ] ; then
291                if [ -f $2 ] ; then
292                    echo $this: $2 exists as a non-directory.
293                    exit 1
294                fi
295                mkdir $2
296            fi
297            cd $1
298            for i in * ; do
299                move $i $2/$i
300            done
301            cd ..
302        elif [ -f $1 ] ; then
303            rm -f $2
304            mv $1 $2
305      fi      fi
306  }  }
307    
# Line 159  Line 321 
321          case $lib in          case $lib in
322          *.cm | *.cmi)          *.cm | *.cmi)
323              if [ $lib != $2 ] ; then              if [ $lib != $2 ] ; then
324                  echo "! Warning:" $lib specified relative to $2                  echo "$this: Warning:" $lib specified relative to $2
325              fi              fi
326              echo Moving library $lib to $LIBDIR              echo $this: Moving library $lib to $LIBDIR
327              makedir $LIBDIR/$2              makedir $LIBDIR/$2
328              makedir $LIBDIR/$2/CM              makedir $LIBDIR/$2/CM
329              makedir $LIBDIR/$2/CM/$ARCH-unix              makedir $LIBDIR/$2/CM/$ARCH-unix
# Line 187  Line 349 
349  reglib() {  reglib() {
350      if [ x$MOVE_LIBRARIES = xtrue ] ; then      if [ x$MOVE_LIBRARIES = xtrue ] ; then
351          FINALLOCATION=$LIBDIR/$1          FINALLOCATION=$LIBDIR/$1
352            FINALCONFIGPATH=$1
353      else      else
354          FINALLOCATION=$SRCDIR/$2          FINALLOCATION=$SRCDIR/$2
355            FINALCONFIGPATH=$FINALLOCATION
356      fi      fi
357      if [ -d $FINALLOCATION/CM/$ARCH-unix ] ; then      if [ -d $FINALLOCATION/CM/$ARCH-unix ] ; then
358          echo "Library $1 already exists in $FINALLOCATION."          echo "$this: Library $1 already exists in $FINALLOCATION."
359      else      else
360          echo "Scheduling library $1 to be built in $FINALLOCATION."          echo "$this: Scheduling library $1 to be built in $FINALLOCATION."
361          echo "andalso CM.stabilize false \"$1\"" >>$LIBLIST          echo "  andalso CM.stabilize false \"\$/$1\"" >>$LIBLIST
362          echo $1 $SRCDIR/$2 >>$LOCALPATHCONFIG          echo $1 $SRCDIR/$2 >>$LOCALPATHCONFIG
363          if [ x$MOVE_LIBRARIES = xtrue ] ; then          if [ x$MOVE_LIBRARIES = xtrue ] ; then
364              echo movelibs $SRCDIR/$2 $1 >>$LIBMOVESCRIPT              echo movelibs $SRCDIR/$2 $1 >>$LIBMOVESCRIPT
365          fi          fi
         echo $1 $FINALLOCATION >>$CM_PATHCONFIG_DEFAULT  
366      fi      fi
367        echo $1 $FINALCONFIGPATH >>$CM_PATHCONFIG_DEFAULT
368  }  }
369    
370  #  #
# Line 220  Line 384 
384          TARGETLOC=$TARGET          TARGETLOC=$TARGET
385      fi      fi
386      if [ -r $HEAPDIR/$TARGET ] ; then      if [ -r $HEAPDIR/$TARGET ] ; then
387          echo Target $TARGET already exists.          echo $this: Target $TARGET already exists.
388      else      else
389          echo Building $TARGET.          echo $this: Building $TARGET.
390          unpack $2 $SRCDIR $1 $ROOT/$VERSION-$1          unpack $2 $SRCDIR $1 $1
391          cd $SRCDIR/$1          cd $SRCDIR/$1
392          ./build          # build it, but make sure we don't pick up some (unrelated)
393            # local path configuration...
394            CM_LOCAL_PATHCONFIG=/dev/null ./build
395          if [ -r $TARGETLOC ] ; then          if [ -r $TARGETLOC ] ; then
396              mv $TARGETLOC $HEAPDIR/$TARGET              mv $TARGETLOC $HEAPDIR/$TARGET
397              if [ ! -f $BINDIR/$1 ] ; then              if [ ! -f $BINDIR/$1 ] ; then
# Line 233  Line 399 
399                  ln -s .run-sml $1                  ln -s .run-sml $1
400              fi              fi
401          else          else
402              echo "!!! Build of $TARGET failed."              echo "$this: !!! Build of $TARGET failed."
403          fi          fi
404      fi      fi
405  }  }
# Line 241  Line 407 
407  #  #
408  # create the various sub directories  # create the various sub directories
409  #  #
410  for dir in $BINDIR $HEAPDIR $RUNDIR $LIBDIR $SRCDIR  for dir in $BINDIR $HEAPDIR $RUNDIR $LIBDIR $SRCDIR ; do
 do  
411      makedir $dir      makedir $dir
412  done  done
413    
# Line 250  Line 415 
415  # 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
416  #  #
417  if [ -x $BINDIR/.arch-n-opsys ]; then  if [ -x $BINDIR/.arch-n-opsys ]; then
418      echo Script $BINDIR/.arch-n-opsys already exists.      echo $this: Script $BINDIR/.arch-n-opsys already exists.
419  else  else
420      cat $CONFIGDIR/_arch-n-opsys \      cat $CONFIGDIR/_arch-n-opsys \
421      | sed -e "s,@SHELL@,$SHELL,g" > $BINDIR/.arch-n-opsys      | sed -e "s,@SHELL@,$SHELL,g" > $BINDIR/.arch-n-opsys
422      chmod 555 $BINDIR/.arch-n-opsys      chmod 555 $BINDIR/.arch-n-opsys
423      if [ ! -x $BINDIR/.arch-n-opsys ]; then      if [ ! -x $BINDIR/.arch-n-opsys ]; then
424          echo "!!! Installation of $BINDIR/.arch-n-opsys failed."          echo "$this: !!! Installation of $BINDIR/.arch-n-opsys failed."
425          exit 1          exit 1
426      fi      fi
427  fi  fi
428    
429  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`
430  if [ "$?" != "0" ]; then  if [ "$?" != "0" ]; then
431      echo "!!! Script $BINDIR/.arch-n-opsys fails on this machine."      echo "$this: !!! Script $BINDIR/.arch-n-opsys fails on this machine."
432      echo "!!! You must patch this by hand and repeat the installation."      echo "$this: !!! You must patch this by hand and repeat the installation."
433      exit 2      exit 2
434  else  else
435      echo Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.      echo $this: Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.
436  fi  fi
437  eval $ARCH_N_OPSYS  eval $ARCH_N_OPSYS
438    
# Line 283  Line 448 
448  # for an outdated driver script, but not all "test" commands understand  # for an outdated driver script, but not all "test" commands understand
449  # the -nt comparison operator....)  # the -nt comparison operator....)
450  #   if [ -x $BINDIR/$ddst ]; then  #   if [ -x $BINDIR/$ddst ]; then
451  #       echo Script $BINDIR/$ddst already exists.  #       echo $this: Script $BINDIR/$ddst already exists.
452  #   else  #   else
453          rm -f $BINDIR/$ddst          rm -f $BINDIR/$ddst
454          cat $CONFIGDIR/$dsrc | \          cat $CONFIGDIR/$dsrc | \
# Line 293  Line 458 
458              > $BINDIR/$ddst              > $BINDIR/$ddst
459          chmod 555 $BINDIR/$ddst          chmod 555 $BINDIR/$ddst
460          if [ ! -x $BINDIR/$ddst ]; then          if [ ! -x $BINDIR/$ddst ]; then
461              echo "!!! Installation of $BINDIR/${ddst} failed."              echo "$this: !!! Installation of $BINDIR/${ddst} failed."
462              exit 1              exit 1
463          fi          fi
464  #   fi  #   fi
# Line 302  Line 467 
467  installdriver _run-sml .run-sml  installdriver _run-sml .run-sml
468  installdriver _link-sml .link-sml  installdriver _link-sml .link-sml
469  installdriver _ml-build ml-build  installdriver _ml-build ml-build
470    installdriver _ml-makedepend ml-makedepend
471    
472  #  #
473  # set some architecture dependent run-time system flags  # set some architecture dependent run-time system flags
# Line 311  Line 477 
477          ALLOC=1M          ALLOC=1M
478          ;;          ;;
479      x86)      x86)
480            # The following is the _wrong_ value for many popular x86 chips
481            # (i.e., Celerons).  However, the optimal value for those is 32k,
482            # and such a small value is not enough for the runtime system's boot
483            # code.  Therefore, we use 256k here and re-set it to the proper
484            # value in .run-sml.
485          ALLOC=256k          ALLOC=256k
486          ;;          ;;
487      alpha32)      alpha32)
# Line 328  Line 499 
499      linux)      linux)
500          EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`          EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`
501          if [ "$?" != "0" ]; then          if [ "$?" != "0" ]; then
502              echo "!!! Problems checking for underscores in global names."              echo "$this: !!! Problems checking for underscores in asm names."
503              exit 1              exit 1
504          fi          fi
505          EXTRA_DEFS="XDEFS=$EXTRA_DEFS"          EXTRA_DEFS="XDEFS=$EXTRA_DEFS"
# Line 338  Line 509 
509  #  #
510  # the name of the bin files directory  # the name of the bin files directory
511  #  #
512  BOOT_FILES=sml.boot.$ARCH-unix  BOOT_ARCHIVE=boot.$ARCH-unix
513    BOOT_FILES=sml.$BOOT_ARCHIVE
514    
515  #  #
516  # build the run-time system  # build the run-time system
517  #  #
518  unpack "run-time" $SRCDIR runtime $ROOT/$VERSION-runtime  unpack "run-time" $SRCDIR runtime runtime
519  if [ -x $RUNDIR/run.$ARCH-$OPSYS ]; then  if [ -x $RUNDIR/run.$ARCH-$OPSYS ]; then
520      echo Run-time system already exists.      echo $this: Run-time system already exists.
521  else  else
522      cd $SRCDIR/runtime/objs      cd $SRCDIR/runtime/objs
523      echo Compiling the run-time system.      echo $this: Compiling the run-time system.
524      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
525      if [ -x run.$ARCH-$OPSYS ]; then      if [ -x run.$ARCH-$OPSYS ]; then
526          mv run.$ARCH-$OPSYS $RUNDIR          mv run.$ARCH-$OPSYS $RUNDIR
527          # $MAKE MAKE=$MAKE clean          $MAKE MAKE=$MAKE clean
528      else      else
529          echo "!!! Run-time system build failed for some reason."          echo "$this: !!! Run-time system build failed for some reason."
530          exit 1          exit 1
531      fi      fi
532  fi  fi
# Line 364  Line 536 
536  # boot the base SML system  # boot the base SML system
537  #  #
538  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then
539      echo Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.      echo $this: Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.
540  else  else
541      unpack bin $ROOT $BOOT_FILES $ROOT/$VERSION-$BOOT_FILES      unpack bin $ROOT $BOOT_FILES $BOOT_ARCHIVE
542      cd $ROOT/$BOOT_FILES      cd $ROOT/$BOOT_FILES
543      if $BINDIR/.link-sml @SMLheap=$ROOT/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC      if $BINDIR/.link-sml @SMLheap=$ROOT/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC
544      then      then
# Line 380  Line 552 
552              # the pathconfig file.              # the pathconfig file.
553              #              #
554              cd $ROOT/$BOOT_FILES              cd $ROOT/$BOOT_FILES
555              for lib in *.cm ; do              for anchor in * ; do
556                  echo $lib $LIBDIR/$lib >>$CM_PATHCONFIG_DEFAULT                  if [ -d $anchor ] ; then
557                  movelibs $ROOT/$BOOT_FILES/$lib $lib                      echo $anchor $anchor >>$CM_PATHCONFIG_DEFAULT
558                        move $anchor $LIBDIR/$anchor
559                    fi
560              done              done
561              cd $ROOT              cd $ROOT
562              # rm -rf $BOOT_FILES              # $BOOT_FILES is now only an empty skeleton, let's get rid of it.
563                rm -rf $BOOT_FILES
564    
565          else          else
566              echo "!!! Boot code did not produce heap image (sml.$HEAP_SUFFIX)."              echo "$this !!! No heap image generated (sml.$HEAP_SUFFIX)."
567              exit 1              exit 1
568          fi          fi
569      else      else
570          echo "!!! Boot code failed, no heap image built (sml.$HEAP_SUFFIX)."          echo "$this !!! Boot code failed, no heap image (sml.$HEAP_SUFFIX)."
571          exit 1          exit 1
572      fi      fi
573  fi  fi
# Line 402  Line 577 
577  #  #
578  cd $ROOT  cd $ROOT
579  rm -f $LOCALPATHCONFIG $LIBLIST  rm -f $LOCALPATHCONFIG $LIBLIST
580  echo 'OS.Process.exit (if true' >$LIBLIST  echo 'ignore (OS.Process.exit (if true' >$LIBLIST
581    
582  #  #
583  # now build (or prepare to build) the individual targets  # now build (or prepare to build) the individual targets
584  #  #
585  cd $SRCDIR  cd $SRCDIR
586  echo Installing other targets.  echo $this: Installing other targets.
587  for i in $TARGETS ; do  for i in $TARGETS ; do
588      case $i in      case $i in
589        src-smlnj)        src-smlnj)
590          for src in compiler cm MLRISC smlnj-lib ml-yacc system          for src in compiler cm MLRISC smlnj-lib ml-yacc system
591          do          do
592              unpack $src $ROOT/src $src $ROOT/$VERSION-$src              unpack $src $ROOT/src $src $src
593          done          done
594          ;;          ;;
595        ml-yacc)        ml-yacc)
# Line 429  Line 604 
604          standalone ml-burg ML-Burg          standalone ml-burg ML-Burg
605          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
606          ;;          ;;
607          ml-nlffigen)
608            echo standalone ml-nlffigen ML-NLFFI-Gen >>$LATESTANDALONES
609            echo ml-nlffigen $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
610            ;;
611        smlnj-lib)        smlnj-lib)
612          unpack "SML/NJ Library" $SRCDIR smlnj-lib $ROOT/$VERSION-smlnj-lib          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib
613    
614          # 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
615          # 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 628 
628              reglib reactive-lib.cm smlnj-lib/Reactive              reglib reactive-lib.cm smlnj-lib/Reactive
629          ;;          ;;
630        cml)        cml)
631          unpack CML $SRCDIR cml $ROOT/$VERSION-cml          unpack CML $SRCDIR cml cml
632          reglib core-cml.cm cml/src/core-cml          reglib core-cml.cm cml/src/core-cml
633          reglib cml.cm cml/src          reglib cml.cm cml/src
634          reglib cml-basis.cm cml          reglib cml-basis.cm cml
635          ;;          ;;
636        cml-lib)        cml-lib)
637          unpack CML $SRCDIR cml $ROOT/$VERSION-cml          unpack CML $SRCDIR cml cml
638          reglib cml-lib.cm cml/cml-lib          reglib cml-lib.cm cml/cml-lib
639          ;;          ;;
640        eXene)        eXene)
641          unpack EXene $SRCDIR eXene $ROOT/$VERSION-eXene          unpack EXene $SRCDIR eXene eXene
642          reglib eXene.cm eXene          reglib eXene.cm eXene
643          ;;          ;;
644          ckit)
645            unpack "C-Kit" $ROOT ckit ckit
646            reglib ckit-lib.cm ../ckit/src
647            ;;
648          ml-nlffi-lib)
649            unpack "NLFFI Library" $SRCDIR ml-nlffi-lib ml-nlffi-lib
650            reglib memory.cm ml-nlffi-lib/memory
651            reglib c-int.cm ml-nlffi-lib/internals
652            reglib c.cm ml-nlffi-lib
653            ;;
654        doc)        doc)
655          unpack Doc $ROOT doc $ROOT/$VERSION-doc          unpack Doc $ROOT doc doc
656          cd $ROOT/doc          cd $ROOT/doc
657          build $ROOT          build $ROOT
658          ;;          ;;
659        *)        *)
660          echo "!!! Unknown target $i."          echo "$this: !!! Unknown target $i."
661          ;;          ;;
662      esac      esac
663  done  done
# Line 479  Line 668 
668  # $SRCDIR, so we must consult $LOCALPATHCONFIG.  # $SRCDIR, so we must consult $LOCALPATHCONFIG.
669  #  #
670    
671  echo Compiling library code.  echo $this: Compiling library code.
672  echo 'then OS.Process.success else OS.Process.failure);' >>$LIBLIST  echo 'then OS.Process.success else OS.Process.failure));' >>$LIBLIST
673  if CM_LOCAL_PATHCONFIG=$LOCALPATHCONFIG $BINDIR/sml <$LIBLIST ; then  if CM_LOCAL_PATHCONFIG=$LOCALPATHCONFIG $BINDIR/sml <$LIBLIST ; then
674      echo Libraries compiled successfully.      echo $this: Libraries compiled successfully.
675  else  else
676      echo "!!! Something went wrong when compiling the libraries."      echo "$this: !!! Something went wrong when compiling the libraries."
677      exit 1      exit 1
678  fi  fi
679    
680  #  #
681  # Finally, move the libraries to their final locations...  # Move the libraries to their final locations...
682  #  #
683    
684  if [ -r $LIBMOVESCRIPT ] ; then  if [ -r $LIBMOVESCRIPT ] ; then
685      echo Moving libraries to $LIBDIR.      echo $this: Moving libraries to $LIBDIR.
686      . $LIBMOVESCRIPT      . $LIBMOVESCRIPT
687  fi  fi
688    
689    #
690    # Build "late" standalone programs (i.e., those that must be built
691    # after libraries are already in place):
692    #
693    
694    if [ -r $LATESTANDALONES ] ; then
695        echo $this: Building late standalone programs.
696        . $LATESTANDALONES
697    fi
698    
699    #
700    # Finally, remove duplicate entries from pathconfig file...
701    #
702    if [ -f $CM_PATHCONFIG_DEFAULT ] ; then
703        cp $CM_PATHCONFIG_DEFAULT $PCEDITTMP
704        rm -f $CM_PATHCONFIG_DEFAULT
705        awk <$PCEDITTMP 'NF == 2 { mapping[$1] = $2 }
706    NF != 2 { print $0 }
707    END { for (i in mapping) print i, mapping[i] }' \
708          | sort >$CM_PATHCONFIG_DEFAULT
709    fi
710    
711  exit 0  exit 0

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

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