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

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

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

revision 577, Fri Mar 10 08:07:18 2000 UTC revision 814, Tue May 1 15:44:45 2001 UTC
# Line 62  Line 62 
62  URLGETTER=unknown  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=$INSTALLDIR/pcedittmp.$$
74    
75    #
76  # files to be deleted after we are done...  # files to be deleted after we are done...
77  #  #
78  tmpfiles=""  tmpfiles=""
# Line 74  Line 80 
80  tmpfiles="$tmpfiles $LIBLIST"  tmpfiles="$tmpfiles $LIBLIST"
81  tmpfiles="$tmpfiles $LOCALPATHCONFIG"  tmpfiles="$tmpfiles $LOCALPATHCONFIG"
82  tmpfiles="$tmpfiles $LIBMOVESCRIPT"  tmpfiles="$tmpfiles $LIBMOVESCRIPT"
83    tmpfiles="$tmpfiles $PCEDITTMP"
84  #  #
85  # make sure we always clean up after ourselves...  # make sure we always clean up after ourselves...
86  #  #
# Line 122  Line 129 
129  #   $3 - remote directory  #   $3 - remote directory
130  #  #
131  askurl() {  askurl() {
132      echo $this: Please, fetch $1 archive '('$VERSION-$2.'*)' from      echo "$this: Please, fetch $1 archive"
133      echo '  ' $3      echo ' ('$2.'*' or $VERSION-$2.'*)'
134        echo " from $3"
135      echo "and then re-run this script!"      echo "and then re-run this script!"
136      exit 1      exit 1
137  }  }
# Line 132  Line 140 
140  # Function for fetching source archives automatically using wget or lynx.  # Function for fetching source archives automatically using wget or lynx.
141  #   $1 - command to actually get the stuff  #   $1 - command to actually get the stuff
142  #   $2 - descriptive name  #   $2 - descriptive name
143  #   $3 - base name without extension, without version, and without dir  #   $3 - base name without extension and without dir
144  #   $4 - remote directory  #   $4 - remote directory
145  #  #
146  fetchurl() {  fetchurl() {
147      getter=$1 ; shift      getter=$1 ; shift
148      echo $this: Fetching $1 from $2. Please stand by...      echo $this: Fetching $1 from $3. Please stand by...
149      fetched=no      fetched=no
150      for ext in tgz tar.gz tar.Z tz tar tar.bz2 ; do      for base in $2 $VERSION-$2 ; do
151          try=$VERSION-$2.$ext          for ext in tar.gz tgz tar.Z tz tar tar.bz2 ; do
152                try=$base.$ext
153          echo $this: Trying $try ...          echo $this: Trying $try ...
154          if $getter $3 $try $ROOT/$try ; then          if $getter $3 $try $ROOT/$try ; then
155              fetched=yes              fetched=yes
156              echo $this: Fetching $try was a success.              echo $this: Fetching $try was a success.
157              break                  break 2         # get out of both for-loops
158          else          else
159              rm -f $ROOT/$try              rm -f $ROOT/$try
160          fi          fi
161      done      done
162        done
163      if [ $fetched = no ] ; then      if [ $fetched = no ] ; then
164          echo $this: Fetching $try was no success.          echo $this: Fetching $try was no success.
165          echo '  ' You should try to do it manually now.          echo '  ' You should try to do it manually now.
# Line 185  Line 195 
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
227    }
228    
229  #  #
230  # Function to unpack a source archive.  # Function to unpack a source archive.
231  #  #
# Line 196  Line 237 
237  #     be used)  #     be used)
238  #  #
239  # 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
240  # on archive is found locally, it invokes $URLGETTER and tries again.  # no archive is found locally, it invokes $URLGETTER and tries again.
241  # The variable $tryfetch is used to make sure this happens only once.  # The variable $tryfetch is used to make sure this happens only once.
242  fetch_n_unpack() {  fetch_n_unpack() {
     larc=$ROOT/$VERSION-$4  
243      cd $2      cd $2
244      if [ -r $larc.tar.Z ] ; then      if unarchive "$1" $4.tar.gz un_tar_gz ||
245          echo "$this: Un-compress-ing and un-tar-ing $1 archive."         unarchive "$1" $4.tgz un_tar_gz ||
246          zcat $larc.tar.Z | tar -xf -         unarchive "$1" $4.tar.Z un_tar_Z ||
247      elif [ -r $larc.tar ] ; then         unarchive "$1" $4.tar un_tar ||
248          echo "$this: Un-tar-ing $1 archive."         unarchive "$1" $4.tar.bz1 un_tar_bz2 ||
249          tar -xf $larc.tar         unarchive "$1" $4.tz un_tar_Z
250      elif [ -r $larc.tar.gz ] ; then      then
251          echo "$this: 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 "$this: Un-bzip2-ing and un-tar-ing $1 archive."  
         bunzip2 -c $larc.tar.bz2 | tar -xf -  
     elif [ -r $larc.tgz ] ; then  
         echo "$this: Un-gzip-ing and un-tar-ing $1 archive."  
         gunzip -c $larc.tgz | tar -xf -  
     elif [ -r $larc.tz ] ; then  
         echo "$this: Un-compress-ing and un-tar-ing $1 archive."  
         zcat $larc.tz | tar -xf -  
252      elif [ $tryfetch = yes ] ; then      elif [ $tryfetch = yes ] ; then
253          urlgetter          urlgetter
254          $URLGETTER "$1" $4 $SRCARCHIVEURL          $URLGETTER "$1" $4 $SRCARCHIVEURL
# Line 311  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 "$this: Library $1 already exists in $FINALLOCATION."          echo "$this: Library $1 already exists in $FINALLOCATION."
351      else      else
352          echo "$this: 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 365  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 426  Line 457 
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 435  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 462  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
504    
505  #  #
506  # build the run-time system  # build the run-time system
# Line 476  Line 514 
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 "$this: !!! Run-time system build failed for some reason."          echo "$this: !!! Run-time system build failed for some reason."
520          exit 1          exit 1
# Line 490  Line 528 
528  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then
529      echo $this: 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 $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 529  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
# Line 607  Line 645 
645  #  #
646    
647  echo $this: 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 $this: Libraries compiled successfully.      echo $this: Libraries compiled successfully.
651  else  else
# Line 616  Line 654 
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
# Line 624  Line 662 
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.577  
changed lines
  Added in v.814

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