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 1058, Fri Feb 8 20:02:56 2002 UTC revision 1310, Tue Mar 11 23:54:58 2003 UTC
# Line 43  Line 43 
43   ml-burg \   ml-burg \
44   ml-nlffigen \   ml-nlffigen \
45   smlnj-lib \   smlnj-lib \
46     mlrisc \
47   cml \   cml \
48   cml-lib \   cml-lib \
49   eXene \   eXene \
# Line 84  Line 85 
85  isnotin() {  isnotin() {
86      tested_x=$1      tested_x=$1
87      shift      shift
88      for set_y ; do      for set_y in "$@" ; do
89          if [ ${tested_x} = ${set_y} ] ; then          if [ ${tested_x} = ${set_y} ] ; then
90              return 1              return 1
91          fi          fi
# Line 95  Line 96 
96  require() {  require() {
97      require_who=$1      require_who=$1
98      shift      shift
99      for required_x ; do      if isnotin ${require_who} ${TARGETS} ; then
100            :
101        else
102            for required_x in "$@" ; do
103          if isnotin ${required_x} ${TARGETS} ; then          if isnotin ${required_x} ${TARGETS} ; then
104              echo "Including ${required_x} (needed by ${require_who})."              echo "Including ${required_x} (needed by ${require_who})."
105              request ${required_x}              request ${required_x}
106              CHANGED=true              CHANGED=true
107          fi          fi
108      done      done
109        fi
110  }  }
111    
112  onepass() {  onepass() {
# Line 145  Line 150 
150  #  #
151  MAKE=make  MAKE=make
152    
 #  
 # Make sure we don't have any unpleasant surprises due to the installing  
 # user's process environment:  
 #  
 unset CM_PATHCONFIG  
   
153  SHELL=/bin/sh  SHELL=/bin/sh
154  vsay $this: Using shell $SHELL.  vsay $this: Using shell $SHELL.
155    
# Line 206  Line 205 
205  #  #
206  # set the CM configuration variables (these are environment variables  # set the CM configuration variables (these are environment variables
207  # that will be queried by the bootstrap code)  # that will be queried by the bootstrap code)
208  # Especially important is CM_PATHCONFIG_DEFAULT.  # Especially important is CM_PATHCONFIG.
209  #  #
210  CM_PATHCONFIG_DEFAULT=$LIBDIR/pathconfig  CM_PATHCONFIG=$LIBDIR/pathconfig
211  export CM_PATHCONFIG_DEFAULT  export CM_PATHCONFIG
212    
213  #  #
214  # the release version that we are installing  # the release version that we are installing
# Line 270  Line 269 
269      vsay $this: Fetching $1 from $3. Please stand by...      vsay $this: Fetching $1 from $3. Please stand by...
270      fetched=no      fetched=no
271      for base in $2 $VERSION-$2 ; do      for base in $2 $VERSION-$2 ; do
272          for ext in tar.gz tgz tar.Z tz tar tar.bz2 ; do          for ext in tgz tar.gz tar.Z tz tar tar.bz2 ; do
273              try=$base.$ext              try=$base.$ext
274              vsay $this: Trying $try ...              vsay $this: Trying $try ...
275              if $getter $3/$try $ROOT/$try ; then              if $getter $3/$try $ROOT/$try ; then
# Line 395  Line 394 
394  # The variable $tryfetch is used to make sure this happens only once.  # The variable $tryfetch is used to make sure this happens only once.
395  fetch_n_unpack() {  fetch_n_unpack() {
396      cd $2      cd $2
397      if unarchive "$1" $4.tar.gz un_tar_gz ||      if unarchive "$1" $4.tgz un_tar_gz ||
398         unarchive "$1" $4.tgz un_tar_gz ||         unarchive "$1" $4.tar.gz un_tar_gz ||
399         unarchive "$1" $4.tar.Z un_tar_Z ||         unarchive "$1" $4.tar.Z un_tar_Z ||
400         unarchive "$1" $4.tar un_tar ||         unarchive "$1" $4.tar un_tar ||
401         unarchive "$1" $4.tar.bz2 un_tar_bz2 ||         unarchive "$1" $4.tar.bz2 un_tar_bz2 ||
# Line 476  Line 475 
475      RELNAME=$2      RELNAME=$2
476      LIBNAME='$'${ANCHOR}/${RELNAME}      LIBNAME='$'${ANCHOR}/${RELNAME}
477      ADIR=${SRCDIR}/$3      ADIR=${SRCDIR}/$3
478        if [ $# -gt 3 ] ; then
479            FINALANCHOR=$4
480        else
481            FINALANCHOR=$ANCHOR
482        fi
483      RELDIR=`dirname $RELNAME`      RELDIR=`dirname $RELNAME`
484      RELBASE=`basename $RELNAME`      RELBASE=`basename $RELNAME`
485      if [ x$RELDIR = x. ] ; then      if [ x$RELDIR = x. ] ; then
# Line 486  Line 490 
490      RELLOC=${RELDIR}/CM/${ARCH}-unix/${RELBASE}      RELLOC=${RELDIR}/CM/${ARCH}-unix/${RELBASE}
491      SRCFINALLOC=${ADIR}${RELLOC}      SRCFINALLOC=${ADIR}${RELLOC}
492      if [ x$MOVE_LIBRARIES = xtrue ] ; then      if [ x$MOVE_LIBRARIES = xtrue ] ; then
493          FINALLOC=${LIBDIR}/${ANCHOR}${RELLOC}          FINALLOC=${LIBDIR}/${FINALANCHOR}${RELLOC}
494          FINALCONFIGPATH=${ANCHOR}          FINALCONFIGPATH=${FINALANCHOR}
495      else      else
496          FINALLOC=${SRCFINALLOC}          FINALLOC=${SRCFINALLOC}
497          FINALCONFIGPATH=${ADIR}          FINALCONFIGPATH=${ADIR}
# Line 503  Line 507 
507              echo movelib ${SRCFINALLOC} ${FINALLOC} >>${LIBMOVESCRIPT}              echo movelib ${SRCFINALLOC} ${FINALLOC} >>${LIBMOVESCRIPT}
508          fi          fi
509      fi      fi
510      echo ${ANCHOR} ${FINALCONFIGPATH} >>${CM_PATHCONFIG_DEFAULT}      echo ${FINALANCHOR} ${FINALCONFIGPATH} >>${CM_PATHCONFIG}
511    }
512    
513    #
514    # Function for adding anchor bindings to LOCALPATHCONFIG
515    #
516    # $1 - anchor name
517    # $2 - directory relative to ROOT corresponding to $1
518    localanchor() {
519        echo $1 ${ROOT}/$2 >>${LOCALPATHCONFIG}
520  }  }
521    
522  #  #
# Line 559  Line 572 
572  done  done
573    
574  #  #
 # install the script that tests the architecture, and make sure that it works  
 #  
 if [ -x $BINDIR/.arch-n-opsys ]; then  
     vsay $this: Script $BINDIR/.arch-n-opsys already exists.  
 else  
     cat $CONFIGDIR/_arch-n-opsys \  
     | sed -e "s,@SHELL@,$SHELL,g" > $BINDIR/.arch-n-opsys  
     chmod 555 $BINDIR/.arch-n-opsys  
     if [ ! -x $BINDIR/.arch-n-opsys ]; then  
         complain "$this: !!! Installation of $BINDIR/.arch-n-opsys failed."  
     fi  
 fi  
   
 ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`  
 if [ "$?" != "0" ]; then  
     echo "$this: !!! Script $BINDIR/.arch-n-opsys fails on this machine."  
     echo "$this: !!! You must patch this by hand and repeat the installation."  
     exit 2  
 else  
     vsay $this: Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.  
 fi  
 eval $ARCH_N_OPSYS  
   
 #  
575  # Function to install a "driver" script...  # Function to install a "driver" script...
576  #   This takes care of patching the source of the script with the SHELL,  #   This takes care of patching the source of the script with the SHELL,
577  #   BINDIR, and VERSION variables to use.  #   BINDIR, and VERSION variables to use.
# Line 609  Line 598 
598  #   fi  #   fi
599  }  }
600    
601    #
602    # install the script that tests architecture and os...
603    #
604    installdriver _arch-n-opsys .arch-n-opsys
605    
606    #
607    # run it to figure out what architecture and os we are using, define
608    # corresponding variables...
609    #
610    ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`
611    if [ "$?" != "0" ]; then
612        echo "$this: !!! Script $BINDIR/.arch-n-opsys fails on this machine."
613        echo "$this: !!! You must patch this by hand and repeat the installation."
614        exit 2
615    else
616        vsay $this: Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.
617    fi
618    eval $ARCH_N_OPSYS
619    
620    #
621    # now install all the other driver scripts...
622    #
623  installdriver _run-sml .run-sml  installdriver _run-sml .run-sml
624  installdriver _link-sml .link-sml  installdriver _link-sml .link-sml
625  installdriver _ml-build ml-build  installdriver _ml-build ml-build
# Line 697  Line 708 
708              cd $ROOT/$BOOT_FILES              cd $ROOT/$BOOT_FILES
709              for anchor in * ; do              for anchor in * ; do
710                  if [ -d $anchor ] ; then                  if [ -d $anchor ] ; then
711                      echo $anchor $anchor >>$CM_PATHCONFIG_DEFAULT                      echo $anchor $anchor >>$CM_PATHCONFIG
712                      move $anchor $LIBDIR/$anchor                      move $anchor $LIBDIR/$anchor
713                  fi                  fi
714              done              done
# Line 735  Line 746 
746          ;;          ;;
747        ml-yacc)        ml-yacc)
748          standalone ml-yacc ML-Yacc src          standalone ml-yacc ML-Yacc src
749          echo ml-yacc $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-yacc $TOOLDIR >>$CM_PATHCONFIG
750          ;;          ;;
751        ml-lex)        ml-lex)
752          standalone ml-lex ML-Lex          standalone ml-lex ML-Lex
753          echo ml-lex $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-lex $TOOLDIR >>$CM_PATHCONFIG
754          ;;          ;;
755        ml-burg)        ml-burg)
756          standalone ml-burg ML-Burg          standalone ml-burg ML-Burg
757          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG
758          ;;          ;;
759        ml-nlffigen)        ml-nlffigen)
760          echo standalone ml-nlffigen ML-NLFFI-Gen >>$LATESTANDALONES          echo standalone ml-nlffigen ML-NLFFI-Gen >>$LATESTANDALONES
761          echo ml-nlffigen $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-nlffigen $TOOLDIR >>$CM_PATHCONFIG
762          ;;          ;;
763        smlnj-lib)        smlnj-lib)
764          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib
# Line 759  Line 770 
770              #reglib html-lib.cm html-lib.cm smlnj-lib/HTML              #reglib html-lib.cm html-lib.cm smlnj-lib/HTML
771          # ... and don't make the PP library ...          # ... and don't make the PP library ...
772              #reglib pp-lib.cm pp-lib.cm smlnj-lib/PP              #reglib pp-lib.cm pp-lib.cm smlnj-lib/PP
773            # ... and don't make the controls library ...
774                #reglib controls-lib.cm controls-lib.cm smlnj-lib/Controls
775          # make the Unix library          # make the Unix library
776              reglib unix-lib.cm unix-lib.cm smlnj-lib/Unix              reglib unix-lib.cm unix-lib.cm smlnj-lib/Unix
777          # make the INet library          # make the INet library
# Line 792  Line 805 
805          ;;          ;;
806        ml-nlffi-lib)        ml-nlffi-lib)
807          unpack "NLFFI Library" $SRCDIR ml-nlffi-lib ml-nlffi-lib          unpack "NLFFI Library" $SRCDIR ml-nlffi-lib ml-nlffi-lib
808          reglib memory.cm memory.cm ml-nlffi-lib/memory          reglib c memory/memory.cm ml-nlffi-lib
809          reglib c-int.cm c-int.cm ml-nlffi-lib/internals          reglib c internals/c-int.cm ml-nlffi-lib
810          reglib c.cm c.cm ml-nlffi-lib          reglib c c.cm ml-nlffi-lib
811          ;;          ;;
812        pgraph-util)        pgraph-util)
813          unpack "CM source code" $SRCDIR cm cm          unpack "CM source code" $SRCDIR cm cm
814          reglib pgraph-util.cm pgraph-util.cm cm/pgraph          reglib pgraph-util.cm pgraph-util.cm cm/pgraph
815          ;;          ;;
816          mlrisc)
817            unpack "MLRISC Library" $SRCDIR MLRISC MLRISC
818            localanchor Control.cm lib/SMLNJ-MLRISC
819            localanchor Lib.cm lib/SMLNJ-MLRISC
820            localanchor Visual.cm lib/SMLNJ-MLRISC
821            localanchor MLRISC.cm lib/SMLNJ-MLRISC
822            localanchor MLTREE.cm lib/SMLNJ-MLRISC
823            localanchor Graphs.cm lib/SMLNJ-MLRISC
824            localanchor IA32.cm lib/SMLNJ-MLRISC
825            localanchor Peephole.cm src/MLRISC/cm
826            reglib OTHER-MLRISC RA.cm MLRISC/cm SMLNJ-MLRISC
827            reglib OTHER-MLRISC Peephole.cm MLRISC/cm SMLNJ-MLRISC
828            reglib OTHER-MLRISC IA32-Peephole.cm MLRISC/cm SMLNJ-MLRISC
829            ;;
830        mlrisc-tools)        mlrisc-tools)
831          unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC          unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC
832          reglib mlrisc-tools pp.cm MLRISC/Tools          reglib mlrisc-tools pp.cm MLRISC/Tools
# Line 812  Line 839 
839        nowhere)        nowhere)
840          unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC          unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC
841          echo standalone nowhere NoWhere . MLRISC/Tools >>$LATESTANDALONES          echo standalone nowhere NoWhere . MLRISC/Tools >>$LATESTANDALONES
842          echo nowhere $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo nowhere $TOOLDIR >>$CM_PATHCONFIG
843          ;;          ;;
844        doc)        doc)
845          echo Package doc is currently unavailable.          echo Package doc is currently unavailable.
# Line 862  Line 889 
889  #  #
890  # Finally, remove duplicate entries from pathconfig file...  # Finally, remove duplicate entries from pathconfig file...
891  #  #
892  if [ -f $CM_PATHCONFIG_DEFAULT ] ; then  if [ -f $CM_PATHCONFIG ] ; then
893      cp $CM_PATHCONFIG_DEFAULT $PCEDITTMP      cp $CM_PATHCONFIG $PCEDITTMP
894      rm -f $CM_PATHCONFIG_DEFAULT      rm -f $CM_PATHCONFIG
895      awk <$PCEDITTMP 'NF == 2 { mapping[$1] = $2 }      awk <$PCEDITTMP 'NF == 2 { mapping[$1] = $2 }
896  NF != 2 { print $0 }  NF != 2 { print $0 }
897  END { for (i in mapping) print i, mapping[i] }' \  END { for (i in mapping) print i, mapping[i] }' \
898        | sort >$CM_PATHCONFIG_DEFAULT        | sort >$CM_PATHCONFIG
899  fi  fi
900    
901  exit 0  exit 0

Legend:
Removed from v.1058  
changed lines
  Added in v.1310

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