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

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

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

revision 615, Wed Apr 12 04:52:09 2000 UTC revision 844, Wed Jun 20 20:39:15 2001 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
77  #  #
78  TOOLDIR=$BINDIR  TOOLDIR=$BINDIR
79    
80  #  #
81    # A temporary file for post-editing the pathconfig file...
82    #
83    PCEDITTMP=$INSTALLDIR/pcedittmp.$$
84    
85    #
86  # files to be deleted after we are done...  # files to be deleted after we are done...
87  #  #
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"
95  #  #
96  # make sure we always clean up after ourselves...  # make sure we always clean up after ourselves...
97  #  #
# Line 101  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 290  Line 313 
313      fi      fi
314  }  }
315    
316  #  # move stable library file from $1 to $2
317  # Move the stable archive of a library whose description file was $1/$2 to  movelib()
318  # $LIBDIR/$2/CM/$ARCH-unix/$2 so that it appears as if the description file  {
319  # had been at $LIBDIR/$2/$2      SOURCE=$1
320  #      TARGET=$2
321  # (This script will also move all other libraries that show up in      TARGETDIR=`dirname ${TARGET}`
322  #  $1/CM/$ARCH-unix because in the case of the boot directory this indicates      if [ ! -d ${TARGETDIR} ] ; then
323  #  that some library did not have its own path anchor but was specified          makedir ${TARGETDIR}
324  #  relative to $1/$2. Still, don't rely on this to be robust -- rather make      fi
325  #  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  
326  }  }
327    
328  # A shell function that registers a library for being built.  # A shell function that registers a library for being built.
329  # This function takes two arguments: 1. a name under which the library  # This function takes 3 arguments:
330  # is to be known later (something.cm) and 2. the path relative to $SRCDIR  #   $1 = controlling anchor
331  # that leads to the library's .cm file.  The library's .cm file must be the  #   $2 = name relative to controlling anchor
332  # same as $1.  #   $3 = dir (relative to ${SRCDIR}) corresponding to $1
333  #  #
334  # 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
335  # 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
336  # 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
337  # the end by putting a "movelibs" line into $LIBMOVESCRIPT.  # the end by putting a "movelib" line into $LIBMOVESCRIPT.
   
338  reglib() {  reglib() {
339        ANCHOR=$1
340        RELNAME=$2
341        LIBNAME='$'${ANCHOR}/${RELNAME}
342        ADIR=${SRCDIR}/$3
343        RELDIR=`dirname $RELNAME`
344        RELBASE=`basename $RELNAME`
345        if [ x$RELDIR = x. ] ; then
346            RELDIR=
347        else
348            RELDIR=/$RELDIR
349        fi
350        RELLOC=${RELDIR}/CM/${ARCH}-unix/${RELBASE}
351        SRCFINALLOC=${ADIR}${RELLOC}
352      if [ x$MOVE_LIBRARIES = xtrue ] ; then      if [ x$MOVE_LIBRARIES = xtrue ] ; then
353          FINALLOCATION=$LIBDIR/$1          FINALLOC=${LIBDIR}/${ANCHOR}${RELLOC}
354            FINALCONFIGPATH=${ANCHOR}
355      else      else
356          FINALLOCATION=$SRCDIR/$2          FINALLOC=${SRCFINALLOC}
357            FINALCONFIGPATH=${ADIR}
358      fi      fi
359      if [ -d $FINALLOCATION/CM/$ARCH-unix ] ; then  
360          echo "$this: Library $1 already exists in $FINALLOCATION."      if [ -f ${FINALLOC} ] ; then
361            echo "$this: Library ${LIBNAME} already exists in ${FINALLOC}"
362      else      else
363          echo "$this: Scheduling library $1 to be built in $FINALLOCATION."          echo "$this: Scheduling library ${LIBNAME} to be built as ${FINALLOC}."
364          echo "  andalso CM.stabilize false \"$1\"" >>$LIBLIST          echo "  andalso CM.stabilize false \"${LIBNAME}\"" >>${LIBLIST}
365          echo $1 $SRCDIR/$2 >>$LOCALPATHCONFIG          echo ${ANCHOR} ${ADIR} >>${LOCALPATHCONFIG}
366          if [ x$MOVE_LIBRARIES = xtrue ] ; then          if [ x$MOVE_LIBRARIES = xtrue ] ; then
367              echo movelibs $SRCDIR/$2 $1 >>$LIBMOVESCRIPT              echo movelib ${SRCFINALLOC} ${FINALLOC} >>${LIBMOVESCRIPT}
368          fi          fi
         echo $1 $FINALLOCATION >>$CM_PATHCONFIG_DEFAULT  
369      fi      fi
370        echo ${ANCHOR} ${FINALCONFIGPATH} >>${CM_PATHCONFIG_DEFAULT}
371  }  }
372    
373  #  #
# Line 372  Line 392 
392          echo $this: Building $TARGET.          echo $this: Building $TARGET.
393          unpack $2 $SRCDIR $1 $1          unpack $2 $SRCDIR $1 $1
394          cd $SRCDIR/$1          cd $SRCDIR/$1
395          ./build          # build it, but make sure we don't pick up some (unrelated)
396            # local path configuration...
397            CM_LOCAL_PATHCONFIG=/dev/null ./build
398          if [ -r $TARGETLOC ] ; then          if [ -r $TARGETLOC ] ; then
399              mv $TARGETLOC $HEAPDIR/$TARGET              mv $TARGETLOC $HEAPDIR/$TARGET
400              if [ ! -f $BINDIR/$1 ] ; then              if [ ! -f $BINDIR/$1 ] ; then
# Line 448  Line 470 
470  installdriver _run-sml .run-sml  installdriver _run-sml .run-sml
471  installdriver _link-sml .link-sml  installdriver _link-sml .link-sml
472  installdriver _ml-build ml-build  installdriver _ml-build ml-build
473    installdriver _ml-makedepend ml-makedepend
474    
475  #  #
476  # set some architecture dependent run-time system flags  # set some architecture dependent run-time system flags
# Line 504  Line 527 
527      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
528      if [ -x run.$ARCH-$OPSYS ]; then      if [ -x run.$ARCH-$OPSYS ]; then
529          mv run.$ARCH-$OPSYS $RUNDIR          mv run.$ARCH-$OPSYS $RUNDIR
530          # $MAKE MAKE=$MAKE clean          $MAKE MAKE=$MAKE clean
531      else      else
532          echo "$this: !!! Run-time system build failed for some reason."          echo "$this: !!! Run-time system build failed for some reason."
533          exit 1          exit 1
# Line 584  Line 607 
607          standalone ml-burg ML-Burg          standalone ml-burg ML-Burg
608          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
609          ;;          ;;
610          ml-nlffigen)
611            echo standalone ml-nlffigen ML-NLFFI-Gen >>$LATESTANDALONES
612            echo ml-nlffigen $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
613            ;;
614        smlnj-lib)        smlnj-lib)
615          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib
616    
617          # 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
618          # installed when making the base system.  In other words, don't do...          # installed when making the base system.  In other words, don't do...
619              #reglib smlnj-lib.cm smlnj-lib/Util              #reglib smlnj-lib.cm smlnj-lib.cm smlnj-lib/Util
620          # ... and don't make the HTML library ...          # ... and don't make the HTML library ...
621              #reglib html-lib.cm smlnj-lib/HTML              #reglib html-lib.cm html-lib.cm smlnj-lib/HTML
622          # ... and don't make the PP library ...          # ... and don't make the PP library ...
623              #reglib pp-lib.cm smlnj-lib/PP              #reglib pp-lib.cm pp-lib.cm smlnj-lib/PP
624          # make the Unix library          # make the Unix library
625              reglib unix-lib.cm smlnj-lib/Unix              reglib unix-lib.cm unix-lib.cm smlnj-lib/Unix
626          # make the INet library          # make the INet library
627              reglib inet-lib.cm smlnj-lib/INet              reglib inet-lib.cm inet-lib.cm smlnj-lib/INet
628          # make the RegExp library          # make the RegExp library
629              reglib regexp-lib.cm smlnj-lib/RegExp              reglib regexp-lib.cm regexp-lib.cm smlnj-lib/RegExp
630          # make the Reactive library          # make the Reactive library
631              reglib reactive-lib.cm smlnj-lib/Reactive              reglib reactive-lib.cm reactive-lib.cm smlnj-lib/Reactive
632          ;;          ;;
633        cml)        cml)
634          unpack CML $SRCDIR cml cml          unpack CML $SRCDIR cml cml
635          reglib core-cml.cm cml/src/core-cml          reglib cml core-cml.cm cml/src
636          reglib cml.cm cml/src          reglib cml cml-internal.cm cml/src
637          reglib cml-basis.cm cml          reglib cml cml.cm cml/src
638            reglib cml basis.cm cml/src
639          ;;          ;;
640        cml-lib)        cml-lib)
641          unpack CML $SRCDIR cml cml          unpack CML $SRCDIR cml cml
642          reglib cml-lib.cm cml/cml-lib          reglib cml-lib trace-cml.cm cml/cml-lib/cm
643            reglib cml-lib smlnj-lib.cm cml/cml-lib/cm ????
644          ;;          ;;
645        eXene)        eXene)
646          unpack EXene $SRCDIR eXene eXene          unpack EXene $SRCDIR eXene eXene
647          reglib eXene.cm eXene          reglib eXene.cm eXene.cm eXene
648            ;;
649          ckit)
650            unpack "C-Kit" $ROOT ckit ckit
651            reglib ckit-lib.cm ckit-lib.cm ../ckit/src
652            ;;
653          ml-nlffi-lib)
654            unpack "NLFFI Library" $SRCDIR ml-nlffi-lib ml-nlffi-lib
655            reglib memory.cm memory.cm ml-nlffi-lib/memory
656            reglib c-int.cm c-int.cm ml-nlffi-lib/internals
657            reglib c.cm c.cm ml-nlffi-lib
658          ;;          ;;
659        doc)        doc)
660          unpack Doc $ROOT doc doc          unpack Doc $ROOT doc doc
# Line 644  Line 683 
683  fi  fi
684    
685  #  #
686  # Finally, move the libraries to their final locations...  # Move the libraries to their final locations...
687  #  #
688    
689  if [ -r $LIBMOVESCRIPT ] ; then  if [ -r $LIBMOVESCRIPT ] ; then
# Line 652  Line 691 
691      . $LIBMOVESCRIPT      . $LIBMOVESCRIPT
692  fi  fi
693    
694    #
695    # Build "late" standalone programs (i.e., those that must be built
696    # after libraries are already in place):
697    #
698    
699    if [ -r $LATESTANDALONES ] ; then
700        echo $this: Building late standalone programs.
701        . $LATESTANDALONES
702    fi
703    
704    #
705    # Finally, remove duplicate entries from pathconfig file...
706    #
707    if [ -f $CM_PATHCONFIG_DEFAULT ] ; then
708        cp $CM_PATHCONFIG_DEFAULT $PCEDITTMP
709        rm -f $CM_PATHCONFIG_DEFAULT
710        awk <$PCEDITTMP 'NF == 2 { mapping[$1] = $2 }
711    NF != 2 { print $0 }
712    END { for (i in mapping) print i, mapping[i] }' \
713          | sort >$CM_PATHCONFIG_DEFAULT
714    fi
715    
716  exit 0  exit 0

Legend:
Removed from v.615  
changed lines
  Added in v.844

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