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

Diff of /sml/trunk/config/install.sh

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

revision 526, Thu Jan 13 06:07:45 2000 UTC revision 569, Tue Mar 7 04:01:07 2000 UTC
# Line 2  Line 2 
2  #  #
3  # Copyright (c) 1994 AT&T Bell Laboratories.  # Copyright (c) 1994 AT&T Bell Laboratories.
4  #  #
5  # installation script for SML/NJ and related tools; this is a temporary  # Installation script for SML/NJ and related tools; this is a temporary
6  # placeholder until the configuration tool is finished.  # placeholder until the configuration tool is finished.
7  #  #
8    # Significant changes to accommodate (and take advantage of) the new CM
9  #set -x  # by M.Blume (2/2000).
10    #
11    
12  #  #
13  # get the target list  # get the target list
# Line 27  Line 28 
28  cp config/preloads preloads.standard  cp config/preloads preloads.standard
29    
30  #  #
31  # some OSs have make in strange places  # Some OSs have make in strange places, but most of the time it is
32    # simply on the PATH:
33  #  #
34  MAKE=make  MAKE=make
35    
 #  
 # check for ksh  
 #  
 # ksh causes some people problems so we will always use /bin/sh  
 #  
 #echo "checking for ksh"  
 #if [ -x /bin/ksh ]; then  
 #  SHELL=/bin/ksh  
 #elif [ -x /usr/local/bin/ksh ]; then  
 #  SHELL=/usr/local/bin/ksh  
 #else  
36    SHELL=/bin/sh    SHELL=/bin/sh
 #fi  
37  echo Using shell $SHELL.  echo Using shell $SHELL.
38    
39  #  #
# Line 68  Line 58 
58  LOCALPATHCONFIG=$INSTALLDIR/pathconfig # a temporary pathconfig file  LOCALPATHCONFIG=$INSTALLDIR/pathconfig # a temporary pathconfig file
59    
60  #  #
61  # the path to the dir where ml-yacc, ml-burg, and ml-lex live  # the path to the dir where ml-yacc, ml-burg, ml-lex, and ml-build live
62  #  #
63  TOOLDIR=$BINDIR  TOOLDIR=$BINDIR
64    
65  #  #
66    # files to be deleted after we are done...
67    #
68    tmpfiles=""
69    tmpfiles="$tmpfiles $ROOT/preloads.standard"
70    tmpfiles="$tmpfiles $LIBLIST"
71    tmpfiles="$tmpfiles $LOCALPATHCONFIG"
72    tmpfiles="$tmpfiles $LIBMOVESCRIPT"
73    #
74    # make sure we always clean up after ourselves...
75    #
76    trap 'rm -f $tmpfiles' 0 1 2 3 15
77    
78    
79    #
80  # set the CM configuration variables (these are environment variables  # set the CM configuration variables (these are environment variables
81  # that will be queried by the bootstrap code)  # that will be queried by the bootstrap code)
82  # Especially important is CM_PATHCONFIG_DEFAULT.  # Especially important is CM_PATHCONFIG_DEFAULT.
# Line 111  Line 115 
115  #     different suffixes to determine what kind of de-compression is to  #     different suffixes to determine what kind of de-compression is to
116  #     be used)  #     be used)
117  unpack() {  unpack() {
118      if [ ! -d $2/$3 ]; then      if [ -d $2/$3 ]; then
119          echo Unpacking $1 source files.          echo "The $1 source tree already exists."
120        else
121            echo "Unpacking $1 source archive."
122          cd $2          cd $2
123          if [ -r $4.tar.Z ] ; then          if [ -r $4.tar.Z ] ; then
124              zcat $4.tar.Z | tar -xf -              zcat $4.tar.Z | tar -xf -
# Line 127  Line 133 
133          elif [ -r $4.tz ] ; then          elif [ -r $4.tz ] ; then
134              zcat $4.tz | tar -xf -              zcat $4.tz | tar -xf -
135          else          else
136              echo "!!! The $1 source files are missing."              echo "!!! The $1 source archive is missing."
137              exit 1              exit 1
138          fi          fi
139          if [ ! -d $2/$3 ]; then          if [ ! -d $2/$3 ]; then
140              echo "!!! Unable to unpack $1 source files."              echo "!!! Unable to unpack $1 source archive."
141              exit 1              exit 1
142          fi          fi
143      fi      fi
# Line 151  Line 157 
157  movelibs() {  movelibs() {
158      for lib in `/bin/ls $1/CM/$ARCH-unix` ; do      for lib in `/bin/ls $1/CM/$ARCH-unix` ; do
159          case $lib in          case $lib in
160          *.cm)          *.cm | *.cmi)
161              if [ $lib != $2 ] ; then              if [ $lib != $2 ] ; then
162                  echo "! Warning:" $lib specified relative to $2                  echo "! Warning:" $lib specified relative to $2
163              fi              fi
# Line 240  Line 246 
246      makedir $dir      makedir $dir
247  done  done
248    
   
249  #  #
250  # install the script that tests the architecture, and make sure that it works  # install the script that tests the architecture, and make sure that it works
251  #  #
252  if [ -x $BINDIR/.arch-n-opsys ]; then  if [ -x $BINDIR/.arch-n-opsys ]; then
253    echo Script $BINDIR/.arch-n-opsys already exists.    echo Script $BINDIR/.arch-n-opsys already exists.
254  else  else
255    cat $CONFIGDIR/_arch-n-opsys | sed -e "s,@SHELL@,$SHELL,g" > $BINDIR/.arch-n-opsys      cat $CONFIGDIR/_arch-n-opsys \
256        | sed -e "s,@SHELL@,$SHELL,g" > $BINDIR/.arch-n-opsys
257    chmod 555 $BINDIR/.arch-n-opsys    chmod 555 $BINDIR/.arch-n-opsys
258    if [ ! -x $BINDIR/.arch-n-opsys ]; then    if [ ! -x $BINDIR/.arch-n-opsys ]; then
259      echo "!!! Installation of $BINDIR/.arch-n-opsys failed for some reason."          echo "!!! Installation of $BINDIR/.arch-n-opsys failed."
260      exit 1      exit 1
261    fi    fi
262  fi  fi
263    
264  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`
265  if [ "$?" != "0" ]; then  if [ "$?" != "0" ]; then
266    echo "!!! Script $BINDIR/.arch-n-opsys fails on this machine."    echo "!!! Script $BINDIR/.arch-n-opsys fails on this machine."
# Line 264  Line 271 
271  fi  fi
272  eval $ARCH_N_OPSYS  eval $ARCH_N_OPSYS
273    
274  if [ -x $BINDIR/.run-sml ]; then  #
275    echo Script $BINDIR/.run-sml already exists.  # Function to install a "driver" script...
276  else  #   This takes care of patching the source of the script with the SHELL,
277    cat $CONFIGDIR/_run-sml | \  #   BINDIR, and VERSION variables to use.
278      sed -e "s,@SHELL@,$SHELL,g" -e "s,@BINDIR@,$BINDIR," -e "s,@VERSION@,$VERSION," \  #
279      > $BINDIR/.run-sml  installdriver() {
280    chmod 555 $BINDIR/.run-sml      dsrc=$1
281    if [ ! -x $BINDIR/.run-sml ]; then      ddst=$2
282      echo "!!! Installation of $BINDIR/.run-sml failed for some reason."  # We install the driver unconditionally. (It would be better to test
283    # for an outdated driver script, but not all "test" commands understand
284    # the -nt comparison operator....)
285    #   if [ -x $BINDIR/$ddst ]; then
286    #       echo Script $BINDIR/$ddst already exists.
287    #   else
288            rm -f $BINDIR/$ddst
289            cat $CONFIGDIR/$dsrc | \
290            sed -e "s,@SHELL@,$SHELL,g" \
291                -e "s,@BINDIR@,$BINDIR," \
292                -e "s,@VERSION@,$VERSION," \
293                > $BINDIR/$ddst
294            chmod 555 $BINDIR/$ddst
295            if [ ! -x $BINDIR/$ddst ]; then
296                echo "!!! Installation of $BINDIR/${ddst} failed."
297      exit 1      exit 1
298    fi    fi
299  fi  #   fi
300    }
301    
302    installdriver _run-sml .run-sml
303    installdriver _link-sml .link-sml
304    installdriver _ml-build ml-build
305    
306  #  #
307  # set some architecture dependent run-time system flags  # set some architecture dependent run-time system flags
308  #  #
309  case $ARCH in  case $ARCH in
310    mips*) ALLOC=1M ;;      mips*)
311            ALLOC=1M
312            ;;
313    x86)    x86)
314      ALLOC=256k      ALLOC=256k
315    ;;    ;;
# Line 292  Line 320 
320      ALLOC=512k      ALLOC=512k
321    ;;    ;;
322  esac  esac
323    
324  case $OPSYS in  case $OPSYS in
325    solaris)    solaris)
326      MAKE=/usr/ccs/bin/make      MAKE=/usr/ccs/bin/make
# Line 315  Line 344 
344  # build the run-time system  # build the run-time system
345  #  #
346  unpack "run-time" $SRCDIR runtime $ROOT/$VERSION-runtime  unpack "run-time" $SRCDIR runtime $ROOT/$VERSION-runtime
347  if [ ! -x $RUNDIR/run.$ARCH-$OPSYS ]; then  if [ -x $RUNDIR/run.$ARCH-$OPSYS ]; then
348        echo Run-time system already exists.
349    else
350    cd $SRCDIR/runtime/objs    cd $SRCDIR/runtime/objs
351    echo Compiling the run-time system.    echo Compiling the run-time system.
352    $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS    $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
# Line 336  Line 367 
367    echo Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.    echo Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.
368  else  else
369    unpack bin $ROOT $BOOT_FILES $ROOT/$VERSION-$BOOT_FILES    unpack bin $ROOT $BOOT_FILES $ROOT/$VERSION-$BOOT_FILES
370    cd $ROOT      cd $ROOT/$BOOT_FILES
371    if $RUNDIR/run.$ARCH-$OPSYS @SMLheap=sml \      if $BINDIR/.link-sml @SMLheap=$ROOT/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC
         @SMLboot=$ROOT/$BOOT_FILES @SMLrtpid=`cat $BOOT_FILES/RTPID` \  
         @SMLalloc=$ALLOC  
372    then    then
373            cd $ROOT
374      if [ -r sml.$HEAP_SUFFIX ]; then      if [ -r sml.$HEAP_SUFFIX ]; then
375          mv sml.$HEAP_SUFFIX $HEAPDIR          mv sml.$HEAP_SUFFIX $HEAPDIR
376          cd $BINDIR          cd $BINDIR
377          ln -s .run-sml sml          ln -s .run-sml sml
   
378          #          #
379          # Now move all stable libraries to #LIBDIR and generate          # Now move all stable libraries to #LIBDIR and generate
380          # the pathconfig file.          # the pathconfig file.
381          #          #
   
382          cd $ROOT/$BOOT_FILES          cd $ROOT/$BOOT_FILES
383          for lib in *.cm ; do          for lib in *.cm ; do
384              echo $lib $LIBDIR/$lib >>$CM_PATHCONFIG_DEFAULT              echo $lib $LIBDIR/$lib >>$CM_PATHCONFIG_DEFAULT
# Line 459  Line 487 
487      echo "!!! Something went wrong when compiling the libraries."      echo "!!! Something went wrong when compiling the libraries."
488      exit 1      exit 1
489  fi  fi
 rm -f $LIBLIST $LOCALPATHCONFIG  
490    
491  #  #
492  # Finally, move the libraries to their final locations...  # Finally, move the libraries to their final locations...
# Line 468  Line 495 
495  if [ -r $LIBMOVESCRIPT ] ; then  if [ -r $LIBMOVESCRIPT ] ; then
496      echo Moving libraries to $LIBDIR.      echo Moving libraries to $LIBDIR.
497      . $LIBMOVESCRIPT      . $LIBMOVESCRIPT
     rm -f $LIBMOVESCRIPT  
498  fi  fi
499    
500  #  exit 0
 # Get rid of preloads.standard  
 #  
 rm -f $ROOT/preloads.standard  

Legend:
Removed from v.526  
changed lines
  Added in v.569

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