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 833, Tue May 22 22:06:12 2001 UTC revision 1282, Thu Oct 17 13:07:53 2002 UTC
# Line 9  Line 9 
9  # by M.Blume (2/2000).  # by M.Blume (2/2000).
10  #  #
11    
12    if [ x${INSTALL_QUIETLY} = xtrue ] ; then
13        export CM_VERBOSE=false
14    fi
15    
16    vsay() {
17        if [ x${INSTALL_DEBUG} = xtrue ] ; then
18            echo "$@"
19        elif [ x${INSTALL_QUIETLY} = xtrue ] ; then
20            :
21        else
22            echo "$@"
23        fi
24    }
25    
26    dsay() {
27        if [ x${INSTALL_DEBUG} = xtrue ] ; then
28            echo "$@"
29        fi
30    }
31    
32    complain() {
33        echo "$@"
34        exit 1
35    }
36    
37    # The following variable holds the name of all possible targets.
38    # The names must occur in the order in which targets are to be built.
39    ALLTARGETS=\
40    "src-smlnj \
41     ml-yacc \
42     ml-lex \
43     ml-burg \
44     ml-nlffigen \
45     smlnj-lib \
46     cml \
47     cml-lib \
48     eXene \
49     ckit \
50     ml-nlffi-lib \
51     pgraph-util \
52     mlrisc-tools \
53     nowhere \
54     doc"
55    
56  this=$0  this=$0
57    
58    # By default, move libraries to lib directory:
59    MOVE_LIBRARIES=true
60    
61    # function to be used in config/targets:
62    dont_move_libraries() { MOVE_LIBRARIES=false ; }
63    
64    # Initialize target list.
65    TARGETS=""
66    
67    # function to be used in config/targets:
68    request() { TARGETS="$TARGETS $1" ; }
69    
70  #  #
71  # get the target list  # get the target list
72  #  #
73  if [ -r config/targets.customized ] ; then  if [ -r config/targets.customized ] ; then
74      . config/targets.customized      . config/targets.customized
75  elif [ ! -r config/targets ]; then  elif [ ! -r config/targets ]; then
76      echo "$this: !!! File config/targets is missing."      complain "$this: !!! File config/targets is missing."
     exit 1  
77  else  else
78      . config/targets      . config/targets
79  fi  fi
80    
81  #  #
82    # resolve dependencies
83    #
84    isnotin() {
85        tested_x=$1
86        shift
87        for set_y in "$@" ; do
88            if [ ${tested_x} = ${set_y} ] ; then
89                return 1
90            fi
91        done
92        return 0
93    }
94    
95    require() {
96        require_who=$1
97        shift
98        if isnotin ${require_who} ${TARGETS} ; then
99            :
100        else
101            for required_x in "$@" ; do
102                if isnotin ${required_x} ${TARGETS} ; then
103                    echo "Including ${required_x} (needed by ${require_who})."
104                    request ${required_x}
105                    CHANGED=true
106                fi
107            done
108        fi
109    }
110    
111    onepass() {
112        while read depline ; do
113            require $depline
114        done
115    }
116    
117    if [ -r config/dependencies ] ; then
118        CHANGED=true
119        while [ $CHANGED = true ]; do
120            CHANGED=false
121            onepass <config/dependencies
122        done
123    fi
124    
125    #
126    # Rebuild target list using the order defined by ALLTARGETS.
127    #
128    NEWTARGETS=""
129    for t in ${ALLTARGETS} ; do
130        if isnotin $t ${TARGETS} ; then
131            :
132        else
133            NEWTARGETS="$NEWTARGETS $t"
134        fi
135    done
136    TARGETS=$NEWTARGETS
137    
138    #
139  # create the preloads.standard file  # create the preloads.standard file
140  #  #
141  if [ ! -r config/preloads ]; then  if [ ! -r config/preloads ]; then
142      echo "$this: !!! File config/preloads is missing."      complain "$this: !!! File config/preloads is missing."
     exit 1  
143  fi  fi
144  cp config/preloads preloads.standard  cp config/preloads preloads.standard
145    
# Line 38  Line 149 
149  #  #
150  MAKE=make  MAKE=make
151    
 #  
 # Make sure we don't have any unpleasant surprises due to the installing  
 # user's process environment:  
 #  
 unset CM_PATHCONFIG  
   
152  SHELL=/bin/sh  SHELL=/bin/sh
153  echo $this: Using shell $SHELL.  vsay $this: Using shell $SHELL.
154    
155  #  #
156  # set the SML root directory  # set the SML root directory
157  #  #
158  REAL_PWD=`pwd`  REAL_PWD=`pwd`
159  ROOT=${PWD:-$REAL_PWD}  ROOT=${PWD:-$REAL_PWD}
160  echo $this: SML root is $ROOT.  vsay $this: SML root is $ROOT.
161  echo $this: Installation directory is ${INSTALLDIR:=$ROOT}.  vsay $this: Installation directory is ${INSTALLDIR:=$ROOT}.
162    
163  #  #
164  # set the various directory and file pathname variables  # set the various directory and file pathname variables
# Line 69  Line 174 
174  LIBMOVESCRIPT=$ROOT/libmove     # a temporary script  LIBMOVESCRIPT=$ROOT/libmove     # a temporary script
175  LOCALPATHCONFIG=$INSTALLDIR/pathconfig # a temporary pathconfig file  LOCALPATHCONFIG=$INSTALLDIR/pathconfig # a temporary pathconfig file
176    
 URLGETTER=unknown  
   
177  #  #
178  # 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
179  # ml-makedepend live  # ml-makedepend live.  This path will be interpreted relative to $LIBDIR.
180  #  #
181  TOOLDIR=$BINDIR  TOOLDIR=../bin
182    
183  #  #
184  # A temporary file for post-editing the pathconfig file...  # A temporary file for post-editing the pathconfig file...
# Line 101  Line 204 
204  #  #
205  # set the CM configuration variables (these are environment variables  # set the CM configuration variables (these are environment variables
206  # that will be queried by the bootstrap code)  # that will be queried by the bootstrap code)
207  # Especially important is CM_PATHCONFIG_DEFAULT.  # Especially important is CM_PATHCONFIG.
208  #  #
209  CM_PATHCONFIG_DEFAULT=$LIBDIR/pathconfig  CM_PATHCONFIG=$LIBDIR/pathconfig
210  export CM_PATHCONFIG_DEFAULT  export CM_PATHCONFIG
211    
212  #  #
213  # the release version that we are installing  # the release version that we are installing
214  #  #
215  VERSION=`cat $CONFIGDIR/version`  VERSION=`cat $CONFIGDIR/version`
216  echo $this: Installing version $VERSION.  vsay $this: Installing version $VERSION.
217    
218  #  #
219  # the URL for the (usually remote) source archive  # the URL for the (usually remote) source archive
220  #  #
221  SRCARCHIVEURL=`cat $CONFIGDIR/srcarchiveurl`  SRCARCHIVEURL=`cat $CONFIGDIR/srcarchiveurl`
222  echo $this: URL of source archive is $SRCARCHIVEURL.  vsay $this: URL of source archive is $SRCARCHIVEURL.
223    
224  #  #
225  # Function to make a directory (and advertise such action).  # Function to make a directory including its ancestors.
226  #  #
227  makedir() {  makedir() {
228      if [ ! -d $1 ] ; then      if [ x$1 = x ] ; then
229          echo $this: Making directory $1          :
230        elif [ -d $1 ] ; then
231            :
232        else
233            makedir `dirname $1`
234            if [ x${INSTALL_VERBOSE} = xtrue ] ; then
235                vsay "$this: Making directory $1"
236            fi
237          if mkdir $1 ; then          if mkdir $1 ; then
238              : everything is fine              :
239          else          else
240              echo "$this: !!! Unable to make directory $1!"              complain "$this: !!! Unable to make directory $1!"
             exit 1  
241          fi          fi
242      fi      fi
243  }  }
# Line 156  Line 265 
265  #  #
266  fetchurl() {  fetchurl() {
267      getter=$1 ; shift      getter=$1 ; shift
268      echo $this: Fetching $1 from $3. Please stand by...      vsay $this: Fetching $1 from $3. Please stand by...
269      fetched=no      fetched=no
270      for base in $2 $VERSION-$2 ; do      for base in $2 $VERSION-$2 ; do
271          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
272              try=$base.$ext              try=$base.$ext
273              echo $this: Trying $try ...              vsay $this: Trying $try ...
274              if $getter $3 $try $ROOT/$try ; then              if $getter $3/$try $ROOT/$try ; then
275                  fetched=yes                  fetched=yes
276                  echo $this: Fetching $try was a success.                  vsay $this: Fetching $try was a success.
277                  break 2         # get out of both for-loops                  break 2         # get out of both for-loops
278              else              else
279                  rm -f $ROOT/$try                  rm -f $ROOT/$try
# Line 178  Line 287 
287      fi      fi
288  }  }
289    
290    # wrapper for wget
291  usewget() {  usewget() {
292      wget -nv -O $3 $1/$2      wget -nv -O $2 $1
293  }  }
294    
295    # wrapper for lynx
296  uselynx() {  uselynx() {
297      lynx -source $1/$2 >$3      lynx -source $1 >$2
298    }
299    
300    # wrapper for curl
301    usecurl() {
302        curl -s $1 >$2
303  }  }
304    
305  testurlgetter() {  testurlgetter() {
# Line 192  Line 308 
308    
309  #  #
310  # Function to check whether wget or lynx is available.  # Function to check whether wget or lynx is available.
311  # Set URLGETTER accordingly.  # Set URLGETTER accordingly.  URLGETTER can be set externally
312    # to either 'wget' or 'curl' or 'lynx' -- in which case the
313    # corresponding command will be used (properly wrapped).  Any
314    # other external setting will be passed directly to fetchurl (without
315    # wrapping -- meaning it must take precisely two argumets: source and
316    # destination, in that order).
317  #  #
318  urlgetter() {  urlgetter() {
319      if [ "$URLGETTER" = unknown ] ; then      case ${URLGETTER:-unknown} in
320            fetchurl*)
321                ;;
322            unknown)
323                # automatically figure out which wrapper to use
324          if testurlgetter wget --help ; then          if testurlgetter wget --help ; then
325              URLGETTER="fetchurl usewget"              URLGETTER="fetchurl usewget"
326                elif testurlgetter curl -s -O file:///dev/null -o /dev/null ; then
327                    URLGETTER="fetchurl usecurl"
328          elif testurlgetter lynx -help ; then          elif testurlgetter lynx -help ; then
329              URLGETTER="fetchurl uselynx"              URLGETTER="fetchurl uselynx"
330          else          else
331              URLGETTER="askurl"              URLGETTER="askurl"
332          fi          fi
333      fi              ;;
334            wget|curl|lynx)
335                # special getters we know how to wrap
336                URLGETTER="fetchurl use${URLGETTER}"
337                ;;
338            *)
339                # other -- must be able to work without wrapper
340                URLGETTER="fetchurl ${URLGETTER}"
341                ;;
342        esac
343  }  }
344    
345    # wrapper for tar
346  un_tar() {  un_tar() {
347      echo "$this: Un-TAR-ing $1 archive."      vsay "$this: Un-TAR-ing $1 archive."
348      tar -xf $2      tar -xf $2
349  }  }
350    
351    # wrapper for zcat followed by tar
352  un_tar_Z() {  un_tar_Z() {
353      echo "$this: Un-COMPRESS-ing and un-TAR-ing $1 archive."      vsay "$this: Un-COMPRESS-ing and un-TAR-ing $1 archive."
354      zcat $2 | tar -xf -      zcat $2 | tar -xf -
355  }  }
356    
357    # wrapper for gunzip followed by tar
358  un_tar_gz() {  un_tar_gz() {
359      echo "$this: Un-GZIP-ing and un-TAR-ing $1 archive."      vsay "$this: Un-GZIP-ing and un-TAR-ing $1 archive."
360      gunzip -c $2 | tar -xf -      gunzip -c $2 | tar -xf -
361  }  }
362    
363    # wrapper for bunzip2 followed by tar
364  un_tar_bz2() {  un_tar_bz2() {
365      echo "$this: Un-BZIP2-ing and un-TAR-ing $1 archive."      vsay "$this: Un-BZIP2-ing and un-TAR-ing $1 archive."
366      bunzip2 -c $2 | tar -xf -      bunzip2 -c $2 | tar -xf -
367  }  }
368    
369    # unarchive archive without and with version number attached
370  unarchive() {  unarchive() {
371      # $1: descriptive string, $2: archive, $3: unpacker      # $1: descriptive string, $2: archive, $3: unpacker
372      if [ -r $ROOT/$2 ] ; then      if [ -r $ROOT/$2 ] ; then
# Line 252  Line 393 
393  # The variable $tryfetch is used to make sure this happens only once.  # The variable $tryfetch is used to make sure this happens only once.
394  fetch_n_unpack() {  fetch_n_unpack() {
395      cd $2      cd $2
396      if unarchive "$1" $4.tar.gz un_tar_gz ||      if unarchive "$1" $4.tgz un_tar_gz ||
397         unarchive "$1" $4.tgz un_tar_gz ||         unarchive "$1" $4.tar.gz un_tar_gz ||
398         unarchive "$1" $4.tar.Z un_tar_Z ||         unarchive "$1" $4.tar.Z un_tar_Z ||
399         unarchive "$1" $4.tar un_tar ||         unarchive "$1" $4.tar un_tar ||
400         unarchive "$1" $4.tar.bz1 un_tar_bz2 ||         unarchive "$1" $4.tar.bz2 un_tar_bz2 ||
401         unarchive "$1" $4.tz un_tar_Z         unarchive "$1" $4.tz un_tar_Z
402      then      then
403          : we are done          : we are done
# Line 274  Line 415 
415  unpack() {  unpack() {
416      tryfetch=yes      tryfetch=yes
417      if [ -d $2/$3 ]; then      if [ -d $2/$3 ]; then
418          echo "$this: The $1 tree already exists."          vsay "$this: The $1 tree already exists."
419      else      else
420          fetch_n_unpack "$1" "$2" "$3" "$4"          fetch_n_unpack "$1" "$2" "$3" "$4"
421      fi      fi
422      if [ ! -d $2/$3 ]; then      if [ ! -d $2/$3 ]; then
423          echo "$this: !!! Unable to unpack $1 archive."          complain "$this: !!! Unable to unpack $1 archive."
         exit 1  
424      fi      fi
425  }  }
426    
# Line 292  Line 432 
432      if [ -d $1 ] ; then      if [ -d $1 ] ; then
433          if [ ! -d $2 ] ; then          if [ ! -d $2 ] ; then
434              if [ -f $2 ] ; then              if [ -f $2 ] ; then
435                  echo $this: $2 exists as a non-directory.                  complain $this: $2 exists as a non-directory.
                 exit 1  
436              fi              fi
437              mkdir $2              mkdir $2
438          fi          fi
# Line 308  Line 447 
447      fi      fi
448  }  }
449    
450  #  # move stable library file from $1 to $2
451  # Move the stable archive of a library whose description file was $1/$2 to  movelib()
452  # $LIBDIR/$2/CM/$ARCH-unix/$2 so that it appears as if the description file  {
453  # had been at $LIBDIR/$2/$2      SOURCE=$1
454  #      TARGET=$2
455  # (This script will also move all other libraries that show up in      TARGETDIR=`dirname ${TARGET}`
456  #  $1/CM/$ARCH-unix because in the case of the boot directory this indicates      if [ ! -d ${TARGETDIR} ] ; then
457  #  that some library did not have its own path anchor but was specified          makedir ${TARGETDIR}
458  #  relative to $1/$2. Still, don't rely on this to be robust -- rather make      fi
459  #  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  
460  }  }
461    
462  # A shell function that registers a library for being built.  # A shell function that registers a library for being built.
463  # This function takes two arguments: 1. a name under which the library  # This function takes 3 arguments:
464  # is to be known later (something.cm) and 2. the path relative to $SRCDIR  #   $1 = controlling anchor
465  # that leads to the library's .cm file.  The library's .cm file must be the  #   $2 = name relative to controlling anchor
466  # same as $1.  #   $3 = dir (relative to ${SRCDIR}) corresponding to $1
467  #  #
468  # 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
469  # 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
470  # 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
471  # the end by putting a "movelibs" line into $LIBMOVESCRIPT.  # the end by putting a "movelib" line into $LIBMOVESCRIPT.
   
472  reglib() {  reglib() {
473        ANCHOR=$1
474        RELNAME=$2
475        LIBNAME='$'${ANCHOR}/${RELNAME}
476        ADIR=${SRCDIR}/$3
477        RELDIR=`dirname $RELNAME`
478        RELBASE=`basename $RELNAME`
479        if [ x$RELDIR = x. ] ; then
480            RELDIR=
481        else
482            RELDIR=/$RELDIR
483        fi
484        RELLOC=${RELDIR}/CM/${ARCH}-unix/${RELBASE}
485        SRCFINALLOC=${ADIR}${RELLOC}
486      if [ x$MOVE_LIBRARIES = xtrue ] ; then      if [ x$MOVE_LIBRARIES = xtrue ] ; then
487          FINALLOCATION=$LIBDIR/$1          FINALLOC=${LIBDIR}/${ANCHOR}${RELLOC}
488          FINALCONFIGPATH=$1          FINALCONFIGPATH=${ANCHOR}
489      else      else
490          FINALLOCATION=$SRCDIR/$2          FINALLOC=${SRCFINALLOC}
491          FINALCONFIGPATH=$FINALLOCATION          FINALCONFIGPATH=${ADIR}
492      fi      fi
493      if [ -d $FINALLOCATION/CM/$ARCH-unix ] ; then  
494          echo "$this: Library $1 already exists in $FINALLOCATION."      if [ -f ${FINALLOC} ] ; then
495            vsay "$this: Library ${LIBNAME} already exists in ${FINALLOC}"
496      else      else
497          echo "$this: Scheduling library $1 to be built in $FINALLOCATION."          vsay "$this: Scheduling library ${LIBNAME} to be built as ${FINALLOC}."
498          echo "  andalso CM.stabilize false \"\$/$1\"" >>$LIBLIST          echo "  andalso CM.stabilize false \"${LIBNAME}\"" >>${LIBLIST}
499          echo $1 $SRCDIR/$2 >>$LOCALPATHCONFIG          echo ${ANCHOR} ${ADIR} >>${LOCALPATHCONFIG}
500          if [ x$MOVE_LIBRARIES = xtrue ] ; then          if [ x$MOVE_LIBRARIES = xtrue ] ; then
501              echo movelibs $SRCDIR/$2 $1 >>$LIBMOVESCRIPT              echo movelib ${SRCFINALLOC} ${FINALLOC} >>${LIBMOVESCRIPT}
502          fi          fi
503      fi      fi
504      echo $1 $FINALCONFIGPATH >>$CM_PATHCONFIG_DEFAULT      echo ${ANCHOR} ${FINALCONFIGPATH} >>${CM_PATHCONFIG}
505  }  }
506    
507  #  #
508  # 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
509  # 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
510  # 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
511  # argument is a descriptive name for the program (passed on to "unpack").  # argument is a descriptive name for the program (passed on to "unpack").
512  # The optional third argument specifies the path relative to $SRCDIR/$1  # The optional third argument specifies the path relative to $SRCDIR/$4/$1
513  # 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.
514    # The fourth argument, if missing, defaults to "."
515  #  #
516    
517  standalone() {  standalone() {
# Line 386  Line 521 
521      else      else
522          TARGETLOC=$TARGET          TARGETLOC=$TARGET
523      fi      fi
524        if [ $# = 4 ] ; then
525             MYSRCDIR=$SRCDIR/$4
526        else
527             MYSRCDIR=$SRCDIR
528        fi
529      if [ -r $HEAPDIR/$TARGET ] ; then      if [ -r $HEAPDIR/$TARGET ] ; then
530          echo $this: Target $TARGET already exists.          vsay $this: Target $TARGET already exists.
531      else      else
532          echo $this: Building $TARGET.          echo $this: Building $TARGET.
533          unpack $2 $SRCDIR $1 $1          unpack $2 $MYSRCDIR $1 $1
534          cd $SRCDIR/$1          cd $MYSRCDIR/$1
535          # build it, but make sure we don't pick up some (unrelated)          # build it, but make sure we don't pick up some (unrelated)
536          # local path configuration...          # local path configuration...
537          CM_LOCAL_PATHCONFIG=/dev/null ./build          CM_LOCAL_PATHCONFIG=/dev/null ./build
# Line 407  Line 547 
547      fi      fi
548  }  }
549    
550    ######################################################################
551    
552  #  #
553  # create the various sub directories  # create the various sub directories
554  #  #
# Line 415  Line 557 
557  done  done
558    
559  #  #
 # install the script that tests the architecture, and make sure that it works  
 #  
 if [ -x $BINDIR/.arch-n-opsys ]; then  
     echo $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  
         echo "$this: !!! Installation of $BINDIR/.arch-n-opsys failed."  
         exit 1  
     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  
     echo $this: Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.  
 fi  
 eval $ARCH_N_OPSYS  
   
 #  
560  # Function to install a "driver" script...  # Function to install a "driver" script...
561  #   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,
562  #   BINDIR, and VERSION variables to use.  #   BINDIR, and VERSION variables to use.
# Line 461  Line 578 
578              > $BINDIR/$ddst              > $BINDIR/$ddst
579          chmod 555 $BINDIR/$ddst          chmod 555 $BINDIR/$ddst
580          if [ ! -x $BINDIR/$ddst ]; then          if [ ! -x $BINDIR/$ddst ]; then
581              echo "$this: !!! Installation of $BINDIR/${ddst} failed."              complain "$this: !!! Installation of $BINDIR/${ddst} failed."
             exit 1  
582          fi          fi
583  #   fi  #   fi
584  }  }
585    
586    #
587    # install the script that tests architecture and os...
588    #
589    installdriver _arch-n-opsys .arch-n-opsys
590    
591    #
592    # run it to figure out what architecture and os we are using, define
593    # corresponding variables...
594    #
595    ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`
596    if [ "$?" != "0" ]; then
597        echo "$this: !!! Script $BINDIR/.arch-n-opsys fails on this machine."
598        echo "$this: !!! You must patch this by hand and repeat the installation."
599        exit 2
600    else
601        vsay $this: Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.
602    fi
603    eval $ARCH_N_OPSYS
604    
605    #
606    # now install all the other driver scripts...
607    #
608  installdriver _run-sml .run-sml  installdriver _run-sml .run-sml
609  installdriver _link-sml .link-sml  installdriver _link-sml .link-sml
610  installdriver _ml-build ml-build  installdriver _ml-build ml-build
# Line 502  Line 640 
640      linux)      linux)
641          EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`          EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`
642          if [ "$?" != "0" ]; then          if [ "$?" != "0" ]; then
643              echo "$this: !!! Problems checking for underscores in asm names."              complain "$this: !!! Problems checking for underscores in asm names."
             exit 1  
644          fi          fi
645          EXTRA_DEFS="XDEFS=$EXTRA_DEFS"          EXTRA_DEFS="XDEFS=$EXTRA_DEFS"
646          ;;          ;;
# Line 520  Line 657 
657  #  #
658  unpack "run-time" $SRCDIR runtime runtime  unpack "run-time" $SRCDIR runtime runtime
659  if [ -x $RUNDIR/run.$ARCH-$OPSYS ]; then  if [ -x $RUNDIR/run.$ARCH-$OPSYS ]; then
660      echo $this: Run-time system already exists.      vsay $this: Run-time system already exists.
661  else  else
662      cd $SRCDIR/runtime/objs      cd $SRCDIR/runtime/objs
663      echo $this: Compiling the run-time system.      echo $this: Compiling the run-time system.
# Line 529  Line 666 
666          mv run.$ARCH-$OPSYS $RUNDIR          mv run.$ARCH-$OPSYS $RUNDIR
667          $MAKE MAKE=$MAKE clean          $MAKE MAKE=$MAKE clean
668      else      else
669          echo "$this: !!! Run-time system build failed for some reason."          complain "$this: !!! Run-time system build failed for some reason."
         exit 1  
670      fi      fi
671  fi  fi
672  cd $SRCDIR  cd $SRCDIR
# Line 539  Line 675 
675  # boot the base SML system  # boot the base SML system
676  #  #
677  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then
678      echo $this: Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.      vsay $this: Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.
679  else  else
680      unpack bin $ROOT $BOOT_FILES $BOOT_ARCHIVE      unpack bin $ROOT $BOOT_FILES $BOOT_ARCHIVE
681      cd $ROOT/$BOOT_FILES      cd $ROOT/$BOOT_FILES
# Line 557  Line 693 
693              cd $ROOT/$BOOT_FILES              cd $ROOT/$BOOT_FILES
694              for anchor in * ; do              for anchor in * ; do
695                  if [ -d $anchor ] ; then                  if [ -d $anchor ] ; then
696                      echo $anchor $anchor >>$CM_PATHCONFIG_DEFAULT                      echo $anchor $anchor >>$CM_PATHCONFIG
697                      move $anchor $LIBDIR/$anchor                      move $anchor $LIBDIR/$anchor
698                  fi                  fi
699              done              done
# Line 566  Line 702 
702              rm -rf $BOOT_FILES              rm -rf $BOOT_FILES
703    
704          else          else
705              echo "$this !!! No heap image generated (sml.$HEAP_SUFFIX)."              complain "$this !!! No heap image generated (sml.$HEAP_SUFFIX)."
             exit 1  
706          fi          fi
707      else      else
708          echo "$this !!! Boot code failed, no heap image (sml.$HEAP_SUFFIX)."          complain "$this !!! Boot code failed, no heap image (sml.$HEAP_SUFFIX)."
         exit 1  
709      fi      fi
710  fi  fi
711    
# Line 586  Line 720 
720  # now build (or prepare to build) the individual targets  # now build (or prepare to build) the individual targets
721  #  #
722  cd $SRCDIR  cd $SRCDIR
723  echo $this: Installing other targets.  vsay $this: Installing other targets.
724  for i in $TARGETS ; do  for i in $TARGETS ; do
725      case $i in      case $i in
726        src-smlnj)        src-smlnj)
# Line 597  Line 731 
731          ;;          ;;
732        ml-yacc)        ml-yacc)
733          standalone ml-yacc ML-Yacc src          standalone ml-yacc ML-Yacc src
734          echo ml-yacc $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-yacc $TOOLDIR >>$CM_PATHCONFIG
735          ;;          ;;
736        ml-lex)        ml-lex)
737          standalone ml-lex ML-Lex          standalone ml-lex ML-Lex
738          echo ml-lex $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-lex $TOOLDIR >>$CM_PATHCONFIG
739          ;;          ;;
740        ml-burg)        ml-burg)
741          standalone ml-burg ML-Burg          standalone ml-burg ML-Burg
742          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-burg $TOOLDIR >>$CM_PATHCONFIG
743          ;;          ;;
744        ml-nlffigen)        ml-nlffigen)
745          echo standalone ml-nlffigen ML-NLFFI-Gen >>$LATESTANDALONES          echo standalone ml-nlffigen ML-NLFFI-Gen >>$LATESTANDALONES
746          echo ml-nlffigen $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo ml-nlffigen $TOOLDIR >>$CM_PATHCONFIG
747          ;;          ;;
748        smlnj-lib)        smlnj-lib)
749          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib
750    
751          # 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
752          # installed when making the base system.  In other words, don't do...          # installed when making the base system.  In other words, don't do...
753              #reglib smlnj-lib.cm smlnj-lib/Util              #reglib smlnj-lib.cm smlnj-lib.cm smlnj-lib/Util
754          # ... and don't make the HTML library ...          # ... and don't make the HTML library ...
755              #reglib html-lib.cm smlnj-lib/HTML              #reglib html-lib.cm html-lib.cm smlnj-lib/HTML
756          # ... and don't make the PP library ...          # ... and don't make the PP library ...
757              #reglib pp-lib.cm smlnj-lib/PP              #reglib pp-lib.cm pp-lib.cm smlnj-lib/PP
758            # ... and don't make the controls library ...
759                #reglib controls-lib.cm controls-lib.cm smlnj-lib/Controls
760          # make the Unix library          # make the Unix library
761              reglib unix-lib.cm smlnj-lib/Unix              reglib unix-lib.cm unix-lib.cm smlnj-lib/Unix
762          # make the INet library          # make the INet library
763              reglib inet-lib.cm smlnj-lib/INet              reglib inet-lib.cm inet-lib.cm smlnj-lib/INet
764          # make the RegExp library          # make the RegExp library
765              reglib regexp-lib.cm smlnj-lib/RegExp              reglib regexp-lib.cm regexp-lib.cm smlnj-lib/RegExp
766          # make the Reactive library          # make the Reactive library
767              reglib reactive-lib.cm smlnj-lib/Reactive              reglib reactive-lib.cm reactive-lib.cm smlnj-lib/Reactive
768            # make the HashCons library
769                reglib hash-cons-lib.cm hash-cons-lib.cm smlnj-lib/HashCons
770          ;;          ;;
771        cml)        cml)
772          unpack CML $SRCDIR cml cml          unpack CML $SRCDIR cml cml
773          reglib core-cml.cm cml/src/core-cml          reglib cml core-cml.cm cml/src
774          reglib cml.cm cml/src          reglib cml cml-internal.cm cml/src
775          reglib cml-basis.cm cml          reglib cml cml.cm cml/src
776            reglib cml basis.cm cml/src
777          ;;          ;;
778        cml-lib)        cml-lib)
779          unpack CML $SRCDIR cml cml          unpack CML $SRCDIR cml cml
780          reglib cml-lib.cm cml/cml-lib          reglib cml-lib trace-cml.cm cml/cml-lib/cm
781            reglib cml-lib smlnj-lib.cm cml/cml-lib/cm
782          ;;          ;;
783        eXene)        eXene)
784          unpack EXene $SRCDIR eXene eXene          unpack EXene $SRCDIR eXene eXene
785          reglib eXene.cm eXene          reglib eXene.cm eXene.cm eXene
786          ;;          ;;
787        ckit)        ckit)
788          unpack "C-Kit" $ROOT ckit ckit          unpack "C-Kit" $ROOT ckit ckit
789          reglib ckit-lib.cm ../ckit/src          reglib ckit-lib.cm ckit-lib.cm ../ckit/src
790          ;;          ;;
791        ml-nlffi-lib)        ml-nlffi-lib)
792          unpack "NLFFI Library" $SRCDIR ml-nlffi-lib ml-nlffi-lib          unpack "NLFFI Library" $SRCDIR ml-nlffi-lib ml-nlffi-lib
793          reglib memory.cm ml-nlffi-lib/memory          reglib c memory/memory.cm ml-nlffi-lib
794          reglib c-int.cm ml-nlffi-lib/internals          reglib c internals/c-int.cm ml-nlffi-lib
795          reglib c.cm ml-nlffi-lib          reglib c c.cm ml-nlffi-lib
796            ;;
797          pgraph-util)
798            unpack "CM source code" $SRCDIR cm cm
799            reglib pgraph-util.cm pgraph-util.cm cm/pgraph
800            ;;
801          mlrisc-tools)
802            unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC
803            reglib mlrisc-tools pp.cm MLRISC/Tools
804            reglib mlrisc-tools source-map.cm MLRISC/Tools
805            reglib mlrisc-tools sml-ast.cm MLRISC/Tools
806            reglib mlrisc-tools prec-parser.cm MLRISC/Tools
807            reglib mlrisc-tools parser.cm MLRISC/Tools
808            reglib mlrisc-tools match-compiler.cm MLRISC/Tools
809            ;;
810          nowhere)
811            unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC
812            echo standalone nowhere NoWhere . MLRISC/Tools >>$LATESTANDALONES
813            echo nowhere $TOOLDIR >>$CM_PATHCONFIG
814          ;;          ;;
815        doc)        doc)
816          unpack Doc $ROOT doc doc          echo Package doc is currently unavailable.
817          cd $ROOT/doc          # unpack Doc $ROOT doc doc
818          build $ROOT          # cd $ROOT/doc
819            # build $ROOT
820          ;;          ;;
821        *)        *)
822          echo "$this: !!! Unknown target $i."          echo "$this: !!! Unknown target $i."
# Line 674  Line 833 
833  echo $this: Compiling library code.  echo $this: Compiling library code.
834  echo 'then OS.Process.success else OS.Process.failure));' >>$LIBLIST  echo 'then OS.Process.success else OS.Process.failure));' >>$LIBLIST
835  if CM_LOCAL_PATHCONFIG=$LOCALPATHCONFIG $BINDIR/sml <$LIBLIST ; then  if CM_LOCAL_PATHCONFIG=$LOCALPATHCONFIG $BINDIR/sml <$LIBLIST ; then
836      echo $this: Libraries compiled successfully.      vsay $this: Libraries compiled successfully.
837  else  else
838      echo "$this: !!! Something went wrong when compiling the libraries."      complain "$this: !!! Something went wrong when compiling the libraries."
     exit 1  
839  fi  fi
840    
841  #  #
# Line 685  Line 843 
843  #  #
844    
845  if [ -r $LIBMOVESCRIPT ] ; then  if [ -r $LIBMOVESCRIPT ] ; then
846      echo $this: Moving libraries to $LIBDIR.      vsay $this: Moving libraries to $LIBDIR.
847      . $LIBMOVESCRIPT      . $LIBMOVESCRIPT
848  fi  fi
849    
# Line 695  Line 853 
853  #  #
854    
855  if [ -r $LATESTANDALONES ] ; then  if [ -r $LATESTANDALONES ] ; then
856      echo $this: Building late standalone programs.      vsay $this: Building late standalone programs.
857      . $LATESTANDALONES      . $LATESTANDALONES
858  fi  fi
859    
860  #  #
861  # Finally, remove duplicate entries from pathconfig file...  # Finally, remove duplicate entries from pathconfig file...
862  #  #
863  if [ -f $CM_PATHCONFIG_DEFAULT ] ; then  if [ -f $CM_PATHCONFIG ] ; then
864      cp $CM_PATHCONFIG_DEFAULT $PCEDITTMP      cp $CM_PATHCONFIG $PCEDITTMP
865      rm -f $CM_PATHCONFIG_DEFAULT      rm -f $CM_PATHCONFIG
866      awk <$PCEDITTMP 'NF == 2 { mapping[$1] = $2 }      awk <$PCEDITTMP 'NF == 2 { mapping[$1] = $2 }
867  NF != 2 { print $0 }  NF != 2 { print $0 }
868  END { for (i in mapping) print i, mapping[i] }' \  END { for (i in mapping) print i, mapping[i] }' \
869        | sort >$CM_PATHCONFIG_DEFAULT        | sort >$CM_PATHCONFIG
870  fi  fi
871    
872  exit 0  exit 0

Legend:
Removed from v.833  
changed lines
  Added in v.1282

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