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 814, Tue May 1 15:44:45 2001 UTC revision 1047, Tue Jan 29 21:31:50 2002 UTC
# Line 14  Line 14 
14  #  #
15  # get the target list  # get the target list
16  #  #
17  if [ ! -r config/targets ]; then  if [ -r config/targets.customized ] ; then
18        . config/targets.customized
19    elif [ ! -r config/targets ]; then
20      echo "$this: !!! File config/targets is missing."      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
# Line 35  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 $this: Using shell $SHELL.  echo $this: Using shell $SHELL.
49    
# Line 56  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    
 URLGETTER=unknown  
   
72  #  #
73  # the path to the dir where ml-yacc, ml-burg, ml-lex, ml-build, and  # The path to the dir where ml-yacc, ml-burg, ml-lex, ml-build, and
74  # ml-makedepend live  # ml-makedepend live.  This path will be interpreted relative to $LIBDIR.
75  #  #
76  TOOLDIR=$BINDIR  TOOLDIR=../bin
77    
78  #  #
79  # A temporary file for post-editing the pathconfig file...  # A temporary file for post-editing the pathconfig file...
# Line 78  Line 86 
86  tmpfiles=""  tmpfiles=""
87  tmpfiles="$tmpfiles $ROOT/preloads.standard"  tmpfiles="$tmpfiles $ROOT/preloads.standard"
88  tmpfiles="$tmpfiles $LIBLIST"  tmpfiles="$tmpfiles $LIBLIST"
89    tmpfiles="$tmpfiles $LATESTANDALONES"
90  tmpfiles="$tmpfiles $LOCALPATHCONFIG"  tmpfiles="$tmpfiles $LOCALPATHCONFIG"
91  tmpfiles="$tmpfiles $LIBMOVESCRIPT"  tmpfiles="$tmpfiles $LIBMOVESCRIPT"
92  tmpfiles="$tmpfiles $PCEDITTMP"  tmpfiles="$tmpfiles $PCEDITTMP"
# Line 108  Line 117 
117  echo $this: URL of source archive is $SRCARCHIVEURL.  echo $this: URL of source archive is $SRCARCHIVEURL.
118    
119  #  #
120  # Function to make a directory (and advertise such action).  # Function to make a directory including its ancestors.
121  #  #
122  makedir() {  makedir() {
123      if [ ! -d $1 ] ; then      if [ x$1 = x ] ; then
124          echo $this: Making directory $1          :
125        elif [ -d $1 ] ; then
126            :
127        else
128            makedir `dirname $1`
129            echo "$this: Making directory $1"
130          if mkdir $1 ; then          if mkdir $1 ; then
131              : everything is fine              :
132          else          else
133              echo "$this: !!! Unable to make directory $1!"              echo "$this: !!! Unable to make directory $1!"
134              exit 1              exit 1
# Line 151  Line 165 
165          for ext in tar.gz tgz tar.Z tz tar tar.bz2 ; do          for ext in tar.gz tgz tar.Z tz tar tar.bz2 ; do
166              try=$base.$ext              try=$base.$ext
167              echo $this: Trying $try ...              echo $this: Trying $try ...
168              if $getter $3 $try $ROOT/$try ; then              if $getter $3/$try $ROOT/$try ; then
169                  fetched=yes                  fetched=yes
170                  echo $this: Fetching $try was a success.                  echo $this: Fetching $try was a success.
171                  break 2         # get out of both for-loops                  break 2         # get out of both for-loops
# Line 167  Line 181 
181      fi      fi
182  }  }
183    
184    # wrapper for wget
185  usewget() {  usewget() {
186      wget -nv -O $3 $1/$2      wget -nv -O $2 $1
187  }  }
188    
189    # wrapper for lynx
190  uselynx() {  uselynx() {
191      lynx -source $1/$2 >$3      lynx -source $1 >$2
192    }
193    
194    # wrapper for curl
195    usecurl() {
196        curl -s $1 >$2
197  }  }
198    
199  testurlgetter() {  testurlgetter() {
# Line 181  Line 202 
202    
203  #  #
204  # Function to check whether wget or lynx is available.  # Function to check whether wget or lynx is available.
205  # Set URLGETTER accordingly.  # Set URLGETTER accordingly.  URLGETTER can be set externally
206    # to either 'wget' or 'curl' or 'lynx' -- in which case the
207    # corresponding command will be used (properly wrapped).  Any
208    # other external setting will be passed directly to fetchurl (without
209    # wrapping -- meaning it must take precisely two argumets: source and
210    # destination, in that order).
211  #  #
212  urlgetter() {  urlgetter() {
213      if [ "$URLGETTER" = unknown ] ; then      case ${URLGETTER:-unknown} in
214            fetchurl*)
215                ;;
216            unknown)
217                # automatically figure out which wrapper to use
218          if testurlgetter wget --help ; then          if testurlgetter wget --help ; then
219              URLGETTER="fetchurl usewget"              URLGETTER="fetchurl usewget"
220                elif testurlgetter curl -s -O file:///dev/null -o /dev/null ; then
221                    URLGETTER="fetchurl usecurl"
222          elif testurlgetter lynx -help ; then          elif testurlgetter lynx -help ; then
223              URLGETTER="fetchurl uselynx"              URLGETTER="fetchurl uselynx"
224          else          else
225              URLGETTER="askurl"              URLGETTER="askurl"
226          fi          fi
227      fi              ;;
228            wget|curl|lynx)
229                # special getters we know how to wrap
230                URLGETTER="fetchurl use${URLGETTER}"
231                ;;
232            *)
233                # other -- must be able to work without wrapper
234                URLGETTER="fetchurl ${URLGETTER}"
235                ;;
236        esac
237  }  }
238    
239    # wrapper for tar
240  un_tar() {  un_tar() {
241      echo "$this: Un-TAR-ing $1 archive."      echo "$this: Un-TAR-ing $1 archive."
242      tar -xf $2      tar -xf $2
243  }  }
244    
245    # wrapper for zcat followed by tar
246  un_tar_Z() {  un_tar_Z() {
247      echo "$this: Un-COMPRESS-ing and un-TAR-ing $1 archive."      echo "$this: Un-COMPRESS-ing and un-TAR-ing $1 archive."
248      zcat $2 | tar -xf -      zcat $2 | tar -xf -
249  }  }
250    
251    # wrapper for gunzip followed by tar
252  un_tar_gz() {  un_tar_gz() {
253      echo "$this: Un-GZIP-ing and un-TAR-ing $1 archive."      echo "$this: Un-GZIP-ing and un-TAR-ing $1 archive."
254      gunzip -c $2 | tar -xf -      gunzip -c $2 | tar -xf -
255  }  }
256    
257    # wrapper for bunzip2 followed by tar
258  un_tar_bz2() {  un_tar_bz2() {
259      echo "$this: Un-BZIP2-ing and un-TAR-ing $1 archive."      echo "$this: Un-BZIP2-ing and un-TAR-ing $1 archive."
260      bunzip2 -c $2 | tar -xf -      bunzip2 -c $2 | tar -xf -
261  }  }
262    
263    # unarchive archive without and with version number attached
264  unarchive() {  unarchive() {
265      # $1: descriptive string, $2: archive, $3: unpacker      # $1: descriptive string, $2: archive, $3: unpacker
266      if [ -r $ROOT/$2 ] ; then      if [ -r $ROOT/$2 ] ; then
# Line 297  Line 343 
343      fi      fi
344  }  }
345    
346  #  # move stable library file from $1 to $2
347  # Move the stable archive of a library whose description file was $1/$2 to  movelib()
348  # $LIBDIR/$2/CM/$ARCH-unix/$2 so that it appears as if the description file  {
349  # had been at $LIBDIR/$2/$2      SOURCE=$1
350  #      TARGET=$2
351  # (This script will also move all other libraries that show up in      TARGETDIR=`dirname ${TARGET}`
352  #  $1/CM/$ARCH-unix because in the case of the boot directory this indicates      if [ ! -d ${TARGETDIR} ] ; then
353  #  that some library did not have its own path anchor but was specified          makedir ${TARGETDIR}
354  #  relative to $1/$2. Still, don't rely on this to be robust -- rather make      fi
355  #  separate anchors for every library!)      mv ${SOURCE} ${TARGET}
 #  
 movelibs() {  
     for lib in `/bin/ls $1/CM/$ARCH-unix` ; do  
         case $lib in  
         *.cm | *.cmi)  
             if [ $lib != $2 ] ; then  
                 echo "$this: Warning:" $lib specified relative to $2  
             fi  
             echo $this: Moving library $lib to $LIBDIR  
             makedir $LIBDIR/$2  
             makedir $LIBDIR/$2/CM  
             makedir $LIBDIR/$2/CM/$ARCH-unix  
             mv $1/CM/$ARCH-unix/$lib $LIBDIR/$2/CM/$ARCH-unix/$lib  
             ;;  
         *)  
             ;;  
         esac  
      done  
356  }  }
357    
358  # A shell function that registers a library for being built.  # A shell function that registers a library for being built.
359  # This function takes two arguments: 1. a name under which the library  # This function takes 3 arguments:
360  # is to be known later (something.cm) and 2. the path relative to $SRCDIR  #   $1 = controlling anchor
361  # that leads to the library's .cm file.  The library's .cm file must be the  #   $2 = name relative to controlling anchor
362  # same as $1.  #   $3 = dir (relative to ${SRCDIR}) corresponding to $1
363  #  #
364  # This works by adding ML code to file $LIBLIST.  The code in this file  # This works by adding ML code to file $LIBLIST.  The code in this file
365  # will be executed near the end of this script.  If $MOVE_LIBRARIES is  # will be executed near the end of this script.  If $MOVE_LIBRARIES is
366  # set to true, then reglib will also register a "movelibs" to be executed at  # set to true, then reglib will also register a "movelib" to be executed at
367  # the end by putting a "movelibs" line into $LIBMOVESCRIPT.  # the end by putting a "movelib" line into $LIBMOVESCRIPT.
   
368  reglib() {  reglib() {
369        ANCHOR=$1
370        RELNAME=$2
371        LIBNAME='$'${ANCHOR}/${RELNAME}
372        ADIR=${SRCDIR}/$3
373        RELDIR=`dirname $RELNAME`
374        RELBASE=`basename $RELNAME`
375        if [ x$RELDIR = x. ] ; then
376            RELDIR=
377        else
378            RELDIR=/$RELDIR
379        fi
380        RELLOC=${RELDIR}/CM/${ARCH}-unix/${RELBASE}
381        SRCFINALLOC=${ADIR}${RELLOC}
382      if [ x$MOVE_LIBRARIES = xtrue ] ; then      if [ x$MOVE_LIBRARIES = xtrue ] ; then
383          FINALLOCATION=$LIBDIR/$1          FINALLOC=${LIBDIR}/${ANCHOR}${RELLOC}
384          FINALCONFIGPATH=$1          FINALCONFIGPATH=${ANCHOR}
385      else      else
386          FINALLOCATION=$SRCDIR/$2          FINALLOC=${SRCFINALLOC}
387          FINALCONFIGPATH=$FINALLOCATION          FINALCONFIGPATH=${ADIR}
388      fi      fi
389      if [ -d $FINALLOCATION/CM/$ARCH-unix ] ; then  
390          echo "$this: Library $1 already exists in $FINALLOCATION."      if [ -f ${FINALLOC} ] ; then
391            echo "$this: Library ${LIBNAME} already exists in ${FINALLOC}"
392      else      else
393          echo "$this: Scheduling library $1 to be built in $FINALLOCATION."          echo "$this: Scheduling library ${LIBNAME} to be built as ${FINALLOC}."
394          echo "  andalso CM.stabilize false \"\$/$1\"" >>$LIBLIST          echo "  andalso CM.stabilize false \"${LIBNAME}\"" >>${LIBLIST}
395          echo $1 $SRCDIR/$2 >>$LOCALPATHCONFIG          echo ${ANCHOR} ${ADIR} >>${LOCALPATHCONFIG}
396          if [ x$MOVE_LIBRARIES = xtrue ] ; then          if [ x$MOVE_LIBRARIES = xtrue ] ; then
397              echo movelibs $SRCDIR/$2 $1 >>$LIBMOVESCRIPT              echo movelib ${SRCFINALLOC} ${FINALLOC} >>${LIBMOVESCRIPT}
398          fi          fi
399      fi      fi
400      echo $1 $FINALCONFIGPATH >>$CM_PATHCONFIG_DEFAULT      echo ${ANCHOR} ${FINALCONFIGPATH} >>${CM_PATHCONFIG_DEFAULT}
401  }  }
402    
403  #  #
404  # Function to build a standalone program such as ml-yacc.  The function takes  # Function to build a standalone program such as ml-yacc.  The function takes
405  # 2 or 3 arguments.  First the name of the program which at the same time  # 2 or 3 or 4 arguments.  First the name of the program which at the same time
406  # is the directory name under $SRCDIR where the sources reside.  The second  # is the directory name under $SRCDIR/$4 where the sources reside.  The second
407  # argument is a descriptive name for the program (passed on to "unpack").  # argument is a descriptive name for the program (passed on to "unpack").
408  # The optional third argument specifies the path relative to $SRCDIR/$1  # The optional third argument specifies the path relative to $SRCDIR/$4/$1
409  # of the directory where the program's heap image is to be found.  # of the directory where the program's heap image is to be found.
410    # The fourth argument, if missing, defaults to "."
411  #  #
412    
413  standalone() {  standalone() {
# Line 375  Line 417 
417      else      else
418          TARGETLOC=$TARGET          TARGETLOC=$TARGET
419      fi      fi
420        if [ $# = 4 ] ; then
421             MYSRCDIR=$SRCDIR/$4
422        else
423             MYSRCDIR=$SRCDIR
424        fi
425      if [ -r $HEAPDIR/$TARGET ] ; then      if [ -r $HEAPDIR/$TARGET ] ; then
426          echo $this: Target $TARGET already exists.          echo $this: Target $TARGET already exists.
427      else      else
428          echo $this: Building $TARGET.          echo $this: Building $TARGET.
429          unpack $2 $SRCDIR $1 $1          unpack $2 $MYSRCDIR $1 $1
430          cd $SRCDIR/$1          cd $MYSRCDIR/$1
431          ./build          # build it, but make sure we don't pick up some (unrelated)
432            # local path configuration...
433            CM_LOCAL_PATHCONFIG=/dev/null ./build
434          if [ -r $TARGETLOC ] ; then          if [ -r $TARGETLOC ] ; then
435              mv $TARGETLOC $HEAPDIR/$TARGET              mv $TARGETLOC $HEAPDIR/$TARGET
436              if [ ! -f $BINDIR/$1 ] ; then              if [ ! -f $BINDIR/$1 ] ; then
# Line 594  Line 643 
643          standalone ml-burg ML-Burg          standalone ml-burg ML-Burg
644          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
645          ;;          ;;
646          ml-nlffigen)
647            echo standalone ml-nlffigen ML-NLFFI-Gen >>$LATESTANDALONES
648            echo ml-nlffigen $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
649            ;;
650        smlnj-lib)        smlnj-lib)
651          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib
652    
653          # 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
654          # installed when making the base system.  In other words, don't do...          # installed when making the base system.  In other words, don't do...
655              #reglib smlnj-lib.cm smlnj-lib/Util              #reglib smlnj-lib.cm smlnj-lib.cm smlnj-lib/Util
656          # ... and don't make the HTML library ...          # ... and don't make the HTML library ...
657              #reglib html-lib.cm smlnj-lib/HTML              #reglib html-lib.cm html-lib.cm smlnj-lib/HTML
658          # ... and don't make the PP library ...          # ... and don't make the PP library ...
659              #reglib pp-lib.cm smlnj-lib/PP              #reglib pp-lib.cm pp-lib.cm smlnj-lib/PP
660          # make the Unix library          # make the Unix library
661              reglib unix-lib.cm smlnj-lib/Unix              reglib unix-lib.cm unix-lib.cm smlnj-lib/Unix
662          # make the INet library          # make the INet library
663              reglib inet-lib.cm smlnj-lib/INet              reglib inet-lib.cm inet-lib.cm smlnj-lib/INet
664          # make the RegExp library          # make the RegExp library
665              reglib regexp-lib.cm smlnj-lib/RegExp              reglib regexp-lib.cm regexp-lib.cm smlnj-lib/RegExp
666          # make the Reactive library          # make the Reactive library
667              reglib reactive-lib.cm smlnj-lib/Reactive              reglib reactive-lib.cm reactive-lib.cm smlnj-lib/Reactive
668          ;;          ;;
669        cml)        cml)
670          unpack CML $SRCDIR cml cml          unpack CML $SRCDIR cml cml
671          reglib core-cml.cm cml/src/core-cml          reglib cml core-cml.cm cml/src
672          reglib cml.cm cml/src          reglib cml cml-internal.cm cml/src
673          reglib cml-basis.cm cml          reglib cml cml.cm cml/src
674            reglib cml basis.cm cml/src
675          ;;          ;;
676        cml-lib)        cml-lib)
677          unpack CML $SRCDIR cml cml          unpack CML $SRCDIR cml cml
678          reglib cml-lib.cm cml/cml-lib          reglib cml-lib trace-cml.cm cml/cml-lib/cm
679            reglib cml-lib smlnj-lib.cm cml/cml-lib/cm
680          ;;          ;;
681        eXene)        eXene)
682          unpack EXene $SRCDIR eXene eXene          unpack EXene $SRCDIR eXene eXene
683          reglib eXene.cm eXene          reglib eXene.cm eXene.cm eXene
684            ;;
685          ckit)
686            unpack "C-Kit" $ROOT ckit ckit
687            reglib ckit-lib.cm ckit-lib.cm ../ckit/src
688            ;;
689          ml-nlffi-lib)
690            unpack "NLFFI Library" $SRCDIR ml-nlffi-lib ml-nlffi-lib
691            reglib memory.cm memory.cm ml-nlffi-lib/memory
692            reglib c-int.cm c-int.cm ml-nlffi-lib/internals
693            reglib c.cm c.cm ml-nlffi-lib
694            ;;
695          pgraph-util)
696            unpack "CM source code" $SRCDIR cm cm
697            reglib pgraph-util.cm pgraph-util.cm cm/pgraph
698            ;;
699          mlrisc-tools)
700            unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC
701            reglib mlrisc-tools pp.cm MLRISC/Tools
702            reglib mlrisc-tools source-map.cm MLRISC/Tools
703            reglib mlrisc-tools sml-ast.cm MLRISC/Tools
704            reglib mlrisc-tools prec-parser.cm MLRISC/Tools
705            reglib mlrisc-tools parser.cm MLRISC/Tools
706            reglib mlrisc-tools match-compiler.cm MLRISC/Tools
707            ;;
708          nowhere)
709            unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC
710            echo standalone nowhere NoWhere . MLRISC/Tools >>$LATESTANDALONES
711            echo nowhere $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
712          ;;          ;;
713        doc)        doc)
714          unpack Doc $ROOT doc doc          unpack Doc $ROOT doc doc
# Line 663  Line 746 
746  fi  fi
747    
748  #  #
749    # Build "late" standalone programs (i.e., those that must be built
750    # after libraries are already in place):
751    #
752    
753    if [ -r $LATESTANDALONES ] ; then
754        echo $this: Building late standalone programs.
755        . $LATESTANDALONES
756    fi
757    
758    #
759  # Finally, remove duplicate entries from pathconfig file...  # Finally, remove duplicate entries from pathconfig file...
760  #  #
761  if [ -f $CM_PATHCONFIG_DEFAULT ] ; then  if [ -f $CM_PATHCONFIG_DEFAULT ] ; then

Legend:
Removed from v.814  
changed lines
  Added in v.1047

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