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/releases/release-110.63/install.sh
ViewVC logotype

Diff of /config/releases/release-110.63/install.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 489, Tue Nov 23 12:55:00 1999 UTC revision 829, Mon May 14 15:30:56 2001 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    # by M.Blume (2/2000).
10    #
11    
12  #set -x  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
22    
23  #  #
24  # some OSs have make in strange places  # create the preloads.standard file
25  #  #
26  MAKE=make  if [ ! -r config/preloads ]; then
27        echo "$this: !!! File config/preloads is missing."
28        exit 1
29    fi
30    cp config/preloads preloads.standard
31    
32  #  #
33  # check for ksh  # Some OSs have make in strange places, but most of the time it is
34    # simply on the PATH:
35    #
36    MAKE=make
37    
38  #  #
39  # ksh causes some people problems so we will always use /bin/sh  # Make sure we don't have any unpleasant surprises due to the installing
40    # user's process environment:
41  #  #
42  #echo "checking for ksh"  unset CM_PATHCONFIG
43  #if [ -x /bin/ksh ]; then  
 #  SHELL=/bin/ksh  
 #elif [ -x /usr/local/bin/ksh ]; then  
 #  SHELL=/usr/local/bin/ksh  
 #else  
44    SHELL=/bin/sh    SHELL=/bin/sh
45  #fi  echo $this: Using shell $SHELL.
 echo 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 55  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 paths to ml-yacc, ml-burg, and ml-lex; needed to configure CM  # the path to the dir where ml-yacc, ml-burg, ml-lex, ml-build, and
73    # ml-makedepend live
74  #  #
75  YACCPATH=$BINDIR/ml-yacc  TOOLDIR=$BINDIR
76  LEXPATH=$BINDIR/ml-lex  
77  BURGPATH=$BINDIR/ml-burg  #
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...
84    #
85    tmpfiles=""
86    tmpfiles="$tmpfiles $ROOT/preloads.standard"
87    tmpfiles="$tmpfiles $LIBLIST"
88    tmpfiles="$tmpfiles $LATESTANDALONES"
89    tmpfiles="$tmpfiles $LOCALPATHCONFIG"
90    tmpfiles="$tmpfiles $LIBMOVESCRIPT"
91    tmpfiles="$tmpfiles $PCEDITTMP"
92    #
93    # make sure we always clean up after ourselves...
94    #
95    trap 'rm -f $tmpfiles' 0 1 2 3 15
96    
97    
98  #  #
99  # set the CM configuration variables (these are environment variables  # set the CM configuration variables (these are environment variables
100  # that will be queried by the bootstrap code)  # that will be queried by the bootstrap code)
101  # Especially important is CM_PATHCONFIG_DEFAULT.  # Especially important is CM_PATHCONFIG_DEFAULT.
102  #  #
 CM_YACC_DEFAULT=$YACCPATH  
 CM_LEX_DEFAULT=$LEXPATH  
 CM_BURG_DEFAULT=$BURGPATH  
103  CM_PATHCONFIG_DEFAULT=$LIBDIR/pathconfig  CM_PATHCONFIG_DEFAULT=$LIBDIR/pathconfig
104  export CM_YACC_DEFAULT CM_LEX_DEFAULT CM_BURG_DEFAULT CM_PATHCONFIG_DEFAULT  export CM_PATHCONFIG_DEFAULT
105    
106  #  #
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
129            fi
130        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              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          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      fi
235  }  }
236    
# Line 106  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  unpack() {  #
247      if [ ! -d $2/$3 ]; then  # fetch_n_unpack is the helper function that does the real work.  If
248          echo Unpacking $1 source files.  # 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          cd $2
252          if [ -r $4.tar.Z ] ; then      if unarchive "$1" $4.tar.gz un_tar_gz ||
253              zcat $4.tar.Z | tar -xf -         unarchive "$1" $4.tgz un_tar_gz ||
254          elif [ -r $4.tar ] ; then         unarchive "$1" $4.tar.Z un_tar_Z ||
255              tar -xf $4.tar         unarchive "$1" $4.tar un_tar ||
256          elif [ -r $4.tar.gz ] ; then         unarchive "$1" $4.tar.bz1 un_tar_bz2 ||
257              gunzip -c $4.tar.gz | tar -xf -         unarchive "$1" $4.tz un_tar_Z
258          elif [ -r $4.tar.bz2 ] ; then      then
259              bunzip2 -c $4.tar.bz2 | tar -xf -          : we are done
260          elif [ -r $4.tgz ] ; then      elif [ $tryfetch = yes ] ; then
261              gunzip -c $4.tgz | tar -xf -          urlgetter
262          elif [ -r $4.tz ] ; then          $URLGETTER "$1" $4 $SRCARCHIVEURL
263              zcat $4.tz | tar -xf -          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() {
272        tryfetch=yes
273        if [ -d $2/$3 ]; then
274            echo "$this: The $1 tree already exists."
275          else          else
276              echo "!!! The $1 source files are missing."          fetch_n_unpack "$1" "$2" "$3" "$4"
             exit 1  
277          fi          fi
278          if [ ! -d $2/$3 ]; then          if [ ! -d $2/$3 ]; then
279              echo "!!! Unable to unpack $1 source files."          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 147  Line 319 
319  movelibs() {  movelibs() {
320      for lib in `/bin/ls $1/CM/$ARCH-unix` ; do      for lib in `/bin/ls $1/CM/$ARCH-unix` ; do
321          case $lib in          case $lib in
322          *.cm)          *.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 177  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 210  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 223  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 231  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    
   
414  #  #
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 | sed -e "s,@SHELL@,$SHELL,g" > $BINDIR/.arch-n-opsys      cat $CONFIGDIR/_arch-n-opsys \
421        | 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 for some reason."          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    
439  if [ -x $BINDIR/.run-sml ]; then  #
440    echo Script $BINDIR/.run-sml already exists.  # Function to install a "driver" script...
441  else  #   This takes care of patching the source of the script with the SHELL,
442    cat $CONFIGDIR/_run-sml | \  #   BINDIR, and VERSION variables to use.
443      sed -e "s,@SHELL@,$SHELL,g" -e "s,@BINDIR@,$BINDIR," -e "s,@VERSION@,$VERSION," \  #
444      > $BINDIR/.run-sml  installdriver() {
445    chmod 555 $BINDIR/.run-sml      dsrc=$1
446    if [ ! -x $BINDIR/.run-sml ]; then      ddst=$2
447      echo "!!! Installation of $BINDIR/.run-sml failed for some reason."  # We install the driver unconditionally. (It would be better to test
448    # for an outdated driver script, but not all "test" commands understand
449    # the -nt comparison operator....)
450    #   if [ -x $BINDIR/$ddst ]; then
451    #       echo $this: Script $BINDIR/$ddst already exists.
452    #   else
453            rm -f $BINDIR/$ddst
454            cat $CONFIGDIR/$dsrc | \
455            sed -e "s,@SHELL@,$SHELL,g" \
456                -e "s,@BINDIR@,$BINDIR," \
457                -e "s,@VERSION@,$VERSION," \
458                > $BINDIR/$ddst
459            chmod 555 $BINDIR/$ddst
460            if [ ! -x $BINDIR/$ddst ]; then
461                echo "$this: !!! Installation of $BINDIR/${ddst} failed."
462      exit 1      exit 1
463    fi    fi
464  fi  #   fi
465    }
466    
467    installdriver _run-sml .run-sml
468    installdriver _link-sml .link-sml
469    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
474  #  #
475  case $ARCH in  case $ARCH in
476    mips*) ALLOC=1M ;;      mips*)
477            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 288  Line 491 
491      ALLOC=512k      ALLOC=512k
492    ;;    ;;
493  esac  esac
494    
495  case $OPSYS in  case $OPSYS in
496    solaris)    solaris)
497      MAKE=/usr/ccs/bin/make      MAKE=/usr/ccs/bin/make
# Line 295  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 305  Line 509 
509  #  #
510  # the name of the bin files directory  # the name of the bin files directory
511  #  #
512  BOOT_FILES=comp.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 $this: Run-time system already exists.
521    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 329  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      cd $ROOT/$BOOT_FILES
543    if $RUNDIR/run.$ARCH-$OPSYS @SMLheap=sml \      if $BINDIR/.link-sml @SMLheap=$ROOT/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC
         @SMLboot=$ROOT/$BOOT_FILES @SMLrtpid=`cat $BOOT_FILES/RTPID` \  
         @SMLalloc=$ALLOC  
544    then    then
545            cd $ROOT
546      if [ -r sml.$HEAP_SUFFIX ]; then      if [ -r sml.$HEAP_SUFFIX ]; then
547          mv sml.$HEAP_SUFFIX $HEAPDIR          mv sml.$HEAP_SUFFIX $HEAPDIR
548          cd $BINDIR          cd $BINDIR
549          ln -s .run-sml sml          ln -s .run-sml sml
   
550          #          #
551          # Now move all stable libraries to #LIBDIR and generate          # Now move all stable libraries to #LIBDIR and generate
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 370  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 comp-lib 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)
596          standalone ml-yacc ML-Yacc src          standalone ml-yacc ML-Yacc src
597            echo ml-yacc $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
598          ;;          ;;
599        ml-lex)        ml-lex)
600          standalone ml-lex ML-Lex          standalone ml-lex ML-Lex
601            echo ml-lex $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
602          ;;          ;;
603        ml-burg)        ml-burg)
604          standalone ml-burg ML-Burg          standalone ml-burg ML-Burg
605            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...
616              #reglib smlnj-lib.cm smlnj-lib/Util              #reglib smlnj-lib.cm smlnj-lib/Util
617            # ... and don't make the HTML library ...
618                #reglib html-lib.cm smlnj-lib/HTML
619            # ... and don't make the PP library ...
620                #reglib pp-lib.cm smlnj-lib/PP
621          # make the Unix library          # make the Unix library
622              reglib unix-lib.cm smlnj-lib/Unix              reglib unix-lib.cm smlnj-lib/Unix
623          # make the INet library          # make the INet library
624              reglib inet-lib.cm smlnj-lib/INet              reglib inet-lib.cm smlnj-lib/INet
         # make the HTML library  
             reglib html-lib.cm smlnj-lib/HTML  
         # make the PP library  
             reglib pp-lib.cm smlnj-lib/PP  
625          # make the RegExp library          # make the RegExp library
626              reglib regexp-lib.cm smlnj-lib/RegExp              reglib regexp-lib.cm smlnj-lib/RegExp
627          # make the Reactive library          # make the Reactive library
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 444  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
 rm -f $LIBLIST $LOCALPATHCONFIG  
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
     rm -f $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

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

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