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

Diff of /config/trunk/install.sh

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

revision 631, Fri Apr 28 08:30:52 2000 UTC revision 1038, Mon Jan 28 00:18:03 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    
72  URLGETTER=unknown  URLGETTER=unknown
73    
74  #  #
75  # the path to the dir where ml-yacc, ml-burg, ml-lex, and ml-build live  # The path to the dir where ml-yacc, ml-burg, ml-lex, ml-build, and
76    # ml-makedepend live.  This path will be interpreted relative to $LIBDIR.
77  #  #
78  TOOLDIR=$BINDIR  TOOLDIR=../bin
79    
80  #  #
81  # A temporary file for post-editing the pathconfig file...  # A temporary file for post-editing the pathconfig file...
82  #  #
83  PCEDITTMP=/usr/tmp/pcedittmp.$$  PCEDITTMP=$INSTALLDIR/pcedittmp.$$
84    
85  #  #
86  # files to be deleted after we are done...  # files to be deleted after we are done...
# Line 77  Line 88 
88  tmpfiles=""  tmpfiles=""
89  tmpfiles="$tmpfiles $ROOT/preloads.standard"  tmpfiles="$tmpfiles $ROOT/preloads.standard"
90  tmpfiles="$tmpfiles $LIBLIST"  tmpfiles="$tmpfiles $LIBLIST"
91    tmpfiles="$tmpfiles $LATESTANDALONES"
92  tmpfiles="$tmpfiles $LOCALPATHCONFIG"  tmpfiles="$tmpfiles $LOCALPATHCONFIG"
93  tmpfiles="$tmpfiles $LIBMOVESCRIPT"  tmpfiles="$tmpfiles $LIBMOVESCRIPT"
94  tmpfiles="$tmpfiles $PCEDITTMP"  tmpfiles="$tmpfiles $PCEDITTMP"
# Line 107  Line 119 
119  echo $this: URL of source archive is $SRCARCHIVEURL.  echo $this: URL of source archive is $SRCARCHIVEURL.
120    
121  #  #
122  # Function to make a directory (and advertise such action).  # Function to make a directory including its ancestors.
123  #  #
124  makedir() {  makedir() {
125      if [ ! -d $1 ] ; then      if [ x$1 = x ] ; then
126          echo $this: Making directory $1          :
127        elif [ -d $1 ] ; then
128            :
129        else
130            makedir `dirname $1`
131            echo "$this: Making directory $1"
132          if mkdir $1 ; then          if mkdir $1 ; then
133              : everything is fine              :
134          else          else
135              echo "$this: !!! Unable to make directory $1!"              echo "$this: !!! Unable to make directory $1!"
136              exit 1              exit 1
# Line 174  Line 191 
191      lynx -source $1/$2 >$3      lynx -source $1/$2 >$3
192  }  }
193    
194    usecurl() {
195        curl -s $1/$2 >$3
196    }
197    
198  testurlgetter() {  testurlgetter() {
199      (exec >/dev/null 2>&1 ; exec $*)      (exec >/dev/null 2>&1 ; exec $*)
200  }  }
# Line 186  Line 207 
207      if [ "$URLGETTER" = unknown ] ; then      if [ "$URLGETTER" = unknown ] ; then
208          if testurlgetter wget --help ; then          if testurlgetter wget --help ; then
209              URLGETTER="fetchurl usewget"              URLGETTER="fetchurl usewget"
210            elif testurlgetter curl --help ; then
211                URLGETTER="fetchurl usecurl"
212          elif testurlgetter lynx -help ; then          elif testurlgetter lynx -help ; then
213              URLGETTER="fetchurl uselynx"              URLGETTER="fetchurl uselynx"
214          else          else
# Line 296  Line 319 
319      fi      fi
320  }  }
321    
322  #  # move stable library file from $1 to $2
323  # Move the stable archive of a library whose description file was $1/$2 to  movelib()
324  # $LIBDIR/$2/CM/$ARCH-unix/$2 so that it appears as if the description file  {
325  # had been at $LIBDIR/$2/$2      SOURCE=$1
326  #      TARGET=$2
327  # (This script will also move all other libraries that show up in      TARGETDIR=`dirname ${TARGET}`
328  #  $1/CM/$ARCH-unix because in the case of the boot directory this indicates      if [ ! -d ${TARGETDIR} ] ; then
329  #  that some library did not have its own path anchor but was specified          makedir ${TARGETDIR}
330  #  relative to $1/$2. Still, don't rely on this to be robust -- rather make      fi
331  #  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  
332  }  }
333    
334  # A shell function that registers a library for being built.  # A shell function that registers a library for being built.
335  # This function takes two arguments: 1. a name under which the library  # This function takes 3 arguments:
336  # is to be known later (something.cm) and 2. the path relative to $SRCDIR  #   $1 = controlling anchor
337  # that leads to the library's .cm file.  The library's .cm file must be the  #   $2 = name relative to controlling anchor
338  # same as $1.  #   $3 = dir (relative to ${SRCDIR}) corresponding to $1
339  #  #
340  # 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
341  # 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
342  # 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
343  # the end by putting a "movelibs" line into $LIBMOVESCRIPT.  # the end by putting a "movelib" line into $LIBMOVESCRIPT.
   
344  reglib() {  reglib() {
345        ANCHOR=$1
346        RELNAME=$2
347        LIBNAME='$'${ANCHOR}/${RELNAME}
348        ADIR=${SRCDIR}/$3
349        RELDIR=`dirname $RELNAME`
350        RELBASE=`basename $RELNAME`
351        if [ x$RELDIR = x. ] ; then
352            RELDIR=
353        else
354            RELDIR=/$RELDIR
355        fi
356        RELLOC=${RELDIR}/CM/${ARCH}-unix/${RELBASE}
357        SRCFINALLOC=${ADIR}${RELLOC}
358      if [ x$MOVE_LIBRARIES = xtrue ] ; then      if [ x$MOVE_LIBRARIES = xtrue ] ; then
359          FINALLOCATION=$LIBDIR/$1          FINALLOC=${LIBDIR}/${ANCHOR}${RELLOC}
360          FINALCONFIGPATH=$1          FINALCONFIGPATH=${ANCHOR}
361      else      else
362          FINALLOCATION=$SRCDIR/$2          FINALLOC=${SRCFINALLOC}
363          FINALCONFIGPATH=$FINALLOCATION          FINALCONFIGPATH=${ADIR}
364      fi      fi
365      if [ -d $FINALLOCATION/CM/$ARCH-unix ] ; then  
366          echo "$this: Library $1 already exists in $FINALLOCATION."      if [ -f ${FINALLOC} ] ; then
367            echo "$this: Library ${LIBNAME} already exists in ${FINALLOC}"
368      else      else
369          echo "$this: Scheduling library $1 to be built in $FINALLOCATION."          echo "$this: Scheduling library ${LIBNAME} to be built as ${FINALLOC}."
370          echo "  andalso CM.stabilize false \"$1\"" >>$LIBLIST          echo "  andalso CM.stabilize false \"${LIBNAME}\"" >>${LIBLIST}
371          echo $1 $SRCDIR/$2 >>$LOCALPATHCONFIG          echo ${ANCHOR} ${ADIR} >>${LOCALPATHCONFIG}
372          if [ x$MOVE_LIBRARIES = xtrue ] ; then          if [ x$MOVE_LIBRARIES = xtrue ] ; then
373              echo movelibs $SRCDIR/$2 $1 >>$LIBMOVESCRIPT              echo movelib ${SRCFINALLOC} ${FINALLOC} >>${LIBMOVESCRIPT}
374          fi          fi
375      fi      fi
376      echo $1 $FINALCONFIGPATH >>$CM_PATHCONFIG_DEFAULT      echo ${ANCHOR} ${FINALCONFIGPATH} >>${CM_PATHCONFIG_DEFAULT}
377  }  }
378    
379  #  #
380  # 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
381  # 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
382  # 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
383  # argument is a descriptive name for the program (passed on to "unpack").  # argument is a descriptive name for the program (passed on to "unpack").
384  # The optional third argument specifies the path relative to $SRCDIR/$1  # The optional third argument specifies the path relative to $SRCDIR/$4/$1
385  # 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.
386    # The fourth argument, if missing, defaults to "."
387  #  #
388    
389  standalone() {  standalone() {
# Line 374  Line 393 
393      else      else
394          TARGETLOC=$TARGET          TARGETLOC=$TARGET
395      fi      fi
396        if [ $# = 4 ] ; then
397             MYSRCDIR=$SRCDIR/$4
398        else
399             MYSRCDIR=$SRCDIR
400        fi
401      if [ -r $HEAPDIR/$TARGET ] ; then      if [ -r $HEAPDIR/$TARGET ] ; then
402          echo $this: Target $TARGET already exists.          echo $this: Target $TARGET already exists.
403      else      else
404          echo $this: Building $TARGET.          echo $this: Building $TARGET.
405          unpack $2 $SRCDIR $1 $1          unpack $2 $MYSRCDIR $1 $1
406          cd $SRCDIR/$1          cd $MYSRCDIR/$1
407          ./build          # build it, but make sure we don't pick up some (unrelated)
408            # local path configuration...
409            CM_LOCAL_PATHCONFIG=/dev/null ./build
410          if [ -r $TARGETLOC ] ; then          if [ -r $TARGETLOC ] ; then
411              mv $TARGETLOC $HEAPDIR/$TARGET              mv $TARGETLOC $HEAPDIR/$TARGET
412              if [ ! -f $BINDIR/$1 ] ; then              if [ ! -f $BINDIR/$1 ] ; then
# Line 456  Line 482 
482  installdriver _run-sml .run-sml  installdriver _run-sml .run-sml
483  installdriver _link-sml .link-sml  installdriver _link-sml .link-sml
484  installdriver _ml-build ml-build  installdriver _ml-build ml-build
485    installdriver _ml-makedepend ml-makedepend
486    
487  #  #
488  # set some architecture dependent run-time system flags  # set some architecture dependent run-time system flags
# Line 512  Line 539 
539      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
540      if [ -x run.$ARCH-$OPSYS ]; then      if [ -x run.$ARCH-$OPSYS ]; then
541          mv run.$ARCH-$OPSYS $RUNDIR          mv run.$ARCH-$OPSYS $RUNDIR
542          # $MAKE MAKE=$MAKE clean          $MAKE MAKE=$MAKE clean
543      else      else
544          echo "$this: !!! Run-time system build failed for some reason."          echo "$this: !!! Run-time system build failed for some reason."
545          exit 1          exit 1
# Line 592  Line 619 
619          standalone ml-burg ML-Burg          standalone ml-burg ML-Burg
620          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
621          ;;          ;;
622          ml-nlffigen)
623            echo standalone ml-nlffigen ML-NLFFI-Gen >>$LATESTANDALONES
624            echo ml-nlffigen $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
625            ;;
626        smlnj-lib)        smlnj-lib)
627          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib
628    
629          # 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
630          # installed when making the base system.  In other words, don't do...          # installed when making the base system.  In other words, don't do...
631              #reglib smlnj-lib.cm smlnj-lib/Util              #reglib smlnj-lib.cm smlnj-lib.cm smlnj-lib/Util
632          # ... and don't make the HTML library ...          # ... and don't make the HTML library ...
633              #reglib html-lib.cm smlnj-lib/HTML              #reglib html-lib.cm html-lib.cm smlnj-lib/HTML
634          # ... and don't make the PP library ...          # ... and don't make the PP library ...
635              #reglib pp-lib.cm smlnj-lib/PP              #reglib pp-lib.cm pp-lib.cm smlnj-lib/PP
636          # make the Unix library          # make the Unix library
637              reglib unix-lib.cm smlnj-lib/Unix              reglib unix-lib.cm unix-lib.cm smlnj-lib/Unix
638          # make the INet library          # make the INet library
639              reglib inet-lib.cm smlnj-lib/INet              reglib inet-lib.cm inet-lib.cm smlnj-lib/INet
640          # make the RegExp library          # make the RegExp library
641              reglib regexp-lib.cm smlnj-lib/RegExp              reglib regexp-lib.cm regexp-lib.cm smlnj-lib/RegExp
642          # make the Reactive library          # make the Reactive library
643              reglib reactive-lib.cm smlnj-lib/Reactive              reglib reactive-lib.cm reactive-lib.cm smlnj-lib/Reactive
644          ;;          ;;
645        cml)        cml)
646          unpack CML $SRCDIR cml cml          unpack CML $SRCDIR cml cml
647          reglib core-cml.cm cml/src/core-cml          reglib cml core-cml.cm cml/src
648          reglib cml.cm cml/src          reglib cml cml-internal.cm cml/src
649          reglib cml-basis.cm cml          reglib cml cml.cm cml/src
650            reglib cml basis.cm cml/src
651          ;;          ;;
652        cml-lib)        cml-lib)
653          unpack CML $SRCDIR cml cml          unpack CML $SRCDIR cml cml
654          reglib cml-lib.cm cml/cml-lib          reglib cml-lib trace-cml.cm cml/cml-lib/cm
655            reglib cml-lib smlnj-lib.cm cml/cml-lib/cm
656          ;;          ;;
657        eXene)        eXene)
658          unpack EXene $SRCDIR eXene eXene          unpack EXene $SRCDIR eXene eXene
659          reglib eXene.cm eXene          reglib eXene.cm eXene.cm eXene
660            ;;
661          ckit)
662            unpack "C-Kit" $ROOT ckit ckit
663            reglib ckit-lib.cm ckit-lib.cm ../ckit/src
664            ;;
665          ml-nlffi-lib)
666            unpack "NLFFI Library" $SRCDIR ml-nlffi-lib ml-nlffi-lib
667            reglib memory.cm memory.cm ml-nlffi-lib/memory
668            reglib c-int.cm c-int.cm ml-nlffi-lib/internals
669            reglib c.cm c.cm ml-nlffi-lib
670            ;;
671          pgraph-util)
672            unpack "CM source code" $SRCDIR cm cm
673            reglib pgraph-util.cm pgraph-util.cm cm/pgraph
674            ;;
675          mlrisc-tools)
676            unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC
677            reglib mlrisc-tools pp.cm MLRISC/Tools
678            reglib mlrisc-tools source-map.cm MLRISC/Tools
679            reglib mlrisc-tools sml-ast.cm MLRISC/Tools
680            reglib mlrisc-tools prec-parser.cm MLRISC/Tools
681            reglib mlrisc-tools parser.cm MLRISC/Tools
682            reglib mlrisc-tools match-compiler.cm MLRISC/Tools
683            ;;
684          nowhere)
685            echo standalone nowhere NoWhere . MLRISC/Tools >>$LATESTANDALONES
686            echo nowhere $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
687          ;;          ;;
688        doc)        doc)
689          unpack Doc $ROOT doc doc          unpack Doc $ROOT doc doc
# Line 661  Line 721 
721  fi  fi
722    
723  #  #
724    # Build "late" standalone programs (i.e., those that must be built
725    # after libraries are already in place):
726    #
727    
728    if [ -r $LATESTANDALONES ] ; then
729        echo $this: Building late standalone programs.
730        . $LATESTANDALONES
731    fi
732    
733    #
734  # Finally, remove duplicate entries from pathconfig file...  # Finally, remove duplicate entries from pathconfig file...
735  #  #
736  if [ -f $CM_PATHCONFIG_DEFAULT ] ; then  if [ -f $CM_PATHCONFIG_DEFAULT ] ; then

Legend:
Removed from v.631  
changed lines
  Added in v.1038

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