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

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

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

revision 1494, Thu May 20 03:09:17 2004 UTC revision 1863, Tue Nov 15 22:38:49 2005 UTC
# Line 12  Line 12 
12  # Author: Matthias Blume (blume@tti-c.org)  # Author: Matthias Blume (blume@tti-c.org)
13  #  #
14    
15    if [ x$1 = xnolib ] ; then
16        nolib=true
17    else
18        nolib=false
19    fi
20    
21  if [ x${INSTALL_QUIETLY} = xtrue ] ; then  if [ x${INSTALL_QUIETLY} = xtrue ] ; then
22      export CM_VERBOSE=false      export CM_VERBOSE
23        CM_VERBOSE=false
24  fi  fi
25    
26  vsay() {  vsay() {
# Line 58  Line 65 
65  ROOT=${PWD:-$REAL_PWD}  ROOT=${PWD:-$REAL_PWD}
66  vsay $this: SML root is $ROOT.  vsay $this: SML root is $ROOT.
67    
68  cd ${INSTALLDIR:=$ROOT}  cd "${INSTALLDIR:=$ROOT}"
69  INSTALLDIR=`pwd`  INSTALLDIR=`pwd`
70  cd $ROOT  cd "$ROOT"
71  vsay $this: Installation directory is ${INSTALLDIR}.  vsay $this: Installation directory is ${INSTALLDIR}.
72    
73  #  #
# Line 77  Line 84 
84  # files to be deleted after we are done...  # files to be deleted after we are done...
85  #  #
86  tmpfiles=""  tmpfiles=""
87  tmpfiles="$tmpfiles $ROOT/preloads.standard"  tmpfiles="$tmpfiles preloads.standard"
88  #  #
89  # make sure we always clean up after ourselves...  # make sure we always clean up after ourselves...
90  #  #
91  trap 'rm -f $tmpfiles' 0 1 2 3 15  trap 'cd "$ROOT"; rm -f $tmpfiles' 0 1 2 3 15
92    
93    
94  #  #
# Line 89  Line 96 
96  # that will be queried by the bootstrap code)  # that will be queried by the bootstrap code)
97  # Especially important is CM_PATHCONFIG.  # Especially important is CM_PATHCONFIG.
98  #  #
 CM_PATHCONFIG=$LIBDIR/pathconfig  
99  export CM_PATHCONFIG  export CM_PATHCONFIG
100    CM_PATHCONFIG=$LIBDIR/pathconfig
101  #  #
102  # the release version that we are installing  # the release version that we are installing
103  #  #
104  VERSION=`cat $CONFIGDIR/version`  VERSION=`cat "$CONFIGDIR/version"`
105  vsay $this: Installing version $VERSION.  vsay $this: Installing version $VERSION.
106    
107  #  #
108  # the URL for the (usually remote) source archive  # the URL for the (usually remote) source archive
109  #  #
110  SRCARCHIVEURL=`cat $CONFIGDIR/srcarchiveurl`  . "$CONFIGDIR"/srcarchiveurl
111  vsay $this: URL of source archive is $SRCARCHIVEURL.  vsay $this: URL of source archive is $SRCARCHIVEURL.
112    
113  #  #
114  # Function to make a directory including its ancestors.  # Function to make a directory including its ancestors.
115  #  #
116  makedir() {  makedir() {
117      if [ x$1 = x ] ; then      if [ x"$1" = x ] ; then
118          :          :
119      elif [ -d $1 ] ; then      elif [ -d "$1" ] ; then
120          :          :
121      else      else
122          makedir `dirname $1`          makedirtmp=`dirname "$1"`
123            makedir "$makedirtmp"
124          if [ x${INSTALL_VERBOSE} = xtrue ] ; then          if [ x${INSTALL_VERBOSE} = xtrue ] ; then
125              vsay "$this: Making directory $1"              vsay "$this: Making directory $1"
126          fi          fi
127          if mkdir $1 ; then          if mkdir "$1" ; then
128              :              :
129          else          else
130              complain "$this: !!! Unable to make directory $1!"              complain "$this: !!! Unable to make directory $1!"
# Line 132  Line 139 
139  # a single subdirectory which is a CM metadata directory:  # a single subdirectory which is a CM metadata directory:
140  #  #
141  fish() {  fish() {
142      cd $1      cd "$1"
143      ORIG_CM_DIR_ARC=unknown      ORIG_CM_DIR_ARC=unknown
144      for i in * .[a-zA-Z0-9]* ; do      for i in * .[a-zA-Z0-9]* ; do
145          if [ -d $i ] ; then          if [ -d $i ] ; then
# Line 153  Line 160 
160  # The first argument must be a simple path (no / inside), and  # The first argument must be a simple path (no / inside), and
161  # the second argument must be an absolute path.  # the second argument must be an absolute path.
162  move() {  move() {
163      if [ -L $1 ] ; then      if [ -L "$1" ] ; then
164          rm -f $1             # remove symbolic link made by diracs (see below)          rm -f "$1"           # remove symbolic link made by diracs (see below)
165      elif [ -d $1 ] ; then      elif [ -d "$1" ] ; then
166          if [ ! -d $2 ] ; then          if [ ! -d "$2" ] ; then
167              if [ -f $2 ] ; then              if [ -f "$2" ] ; then
168                  complain $this: $2 exists as a non-directory.                  complain $this: $2 exists as a non-directory.
169              fi              fi
170              mkdir $2              mkdir "$2"
171          fi          fi
172          cd $1          cd "$1"
173          for i in * .[a-zA-Z0-9]* ; do          for i in * .[a-zA-Z0-9]* ; do
174              move $i $2/$i              move "$i" "$2"/"$i"
175          done          done
176          cd ..          cd ..
177      elif [ -f $1 ] ; then      elif [ -f "$1" ] ; then
178          rm -f $2          rm -f "$2"
179          mv $1 $2          mv "$1" "$2"
180      fi      fi
181  }  }
182    
# Line 179  Line 186 
186  # and establish $1 as a symbolic link to $2:  # and establish $1 as a symbolic link to $2:
187  #  #
188  dirarcs() {  dirarcs() {
189      if [ -d $3 ] ; then      if [ -d "$3" ] ; then
190          if [ $3 = $1 ] ; then          if [ "$3" = "$1" ] ; then
191              mv $1 $2              mv "$1" "$2"
192              ln -s $2 $1              ln -s "$2" "$1"
193          else          else
194              cd $3              cd "$3"
195              for d in * .[a-zA-Z0-9]* ; do              for d in * .[a-zA-Z0-9]* ; do
196                  dirarcs $1 $2 $d                  dirarcs "$1" "$2" "$d"
197              done              done
198              cd ..              cd ..
199          fi          fi
# Line 199  Line 206 
206  #  #
207  # create the various sub directories  # create the various sub directories
208  #  #
209  for dir in $BINDIR $HEAPDIR $RUNDIR $LIBDIR $SRCDIR ; do  for dir in "$BINDIR" "$HEAPDIR" "$RUNDIR" "$LIBDIR" "$SRCDIR" ; do
210      makedir $dir      makedir "$dir"
211  done  done
212    
213  #  #
# Line 217  Line 224 
224  #   if [ -x $BINDIR/$ddst ]; then  #   if [ -x $BINDIR/$ddst ]; then
225  #       echo $this: Script $BINDIR/$ddst already exists.  #       echo $this: Script $BINDIR/$ddst already exists.
226  #   else  #   else
227          rm -f $BINDIR/$ddst          rm -f "$BINDIR"/"$ddst"
228          cat $CONFIGDIR/$dsrc | \          cat "$CONFIGDIR"/"$dsrc" | \
229          sed -e "s,@SHELL@,$SHELL,g" \          sed -e "s,@SHELL@,$SHELL,g" \
230              -e "s,@BINDIR@,$BINDIR," \              -e "s,@BINDIR@,$BINDIR," \
231              -e "s,@VERSION@,$VERSION," \              -e "s,@VERSION@,$VERSION," \
232              -e "s,@CMDIRARC@,${CM_DIR_ARC:-dummy}," \              -e "s,@CMDIRARC@,${CM_DIR_ARC:-dummy}," \
233              > $BINDIR/$ddst              > "$BINDIR"/"$ddst"
234          chmod 555 $BINDIR/$ddst          chmod 555 "$BINDIR"/"$ddst"
235          if [ ! -x $BINDIR/$ddst ]; then          if [ ! -x "$BINDIR"/"$ddst" ]; then
236              complain "$this: !!! Installation of $BINDIR/${ddst} failed."              complain "$this: !!! Installation of $BINDIR/${ddst} failed."
237          fi          fi
238  #   fi  #   fi
# Line 240  Line 247 
247  # run it to figure out what architecture and os we are using, define  # run it to figure out what architecture and os we are using, define
248  # corresponding variables...  # corresponding variables...
249  #  #
250  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`  ARCH_N_OPSYS=`"$BINDIR"/.arch-n-opsys`
251  if [ "$?" != "0" ]; then  if [ "$?" != "0" ]; then
252      echo "$this: !!! Script $BINDIR/.arch-n-opsys fails on this machine."      echo "$this: !!! Script $BINDIR/.arch-n-opsys fails on this machine."
253      echo "$this: !!! You must patch this by hand and repeat the installation."      echo "$this: !!! You must patch this by hand and repeat the installation."
# Line 258  Line 265 
265  installdriver _link-sml .link-sml  installdriver _link-sml .link-sml
266  installdriver _ml-makedepend ml-makedepend  installdriver _ml-makedepend ml-makedepend
267    
268    installdriver _heap2exec heap2exec
269    
270  #  #
271  # set some architecture dependent run-time system flags  # set some architecture dependent run-time system flags
272  #  #
# Line 303  Line 312 
312  #  #
313  # build the run-time system  # build the run-time system
314  #  #
315  if [ -x $RUNDIR/run.$ARCH-$OPSYS ]; then  if [ -x "$RUNDIR"/run.$ARCH-$OPSYS ]; then
316      vsay $this: Run-time system already exists.      vsay $this: Run-time system already exists.
317  else  else
318      $CONFIGDIR/unpack $ROOT runtime      "$CONFIGDIR"/unpack "$ROOT" runtime
319      cd $SRCDIR/runtime/objs      cd "$SRCDIR"/runtime/objs
320      echo $this: Compiling the run-time system.      echo $this: Compiling the run-time system.
321      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
322      if [ -x run.$ARCH-$OPSYS ]; then      if [ -x run.$ARCH-$OPSYS ]; then
323          mv run.$ARCH-$OPSYS $RUNDIR          mv run.$ARCH-$OPSYS "$RUNDIR"
324            if [ -f runx.$ARCH-$OPSYS ]; then
325                mv runx.$ARCH-$OPSYS "$RUNDIR"
326            fi
327          $MAKE MAKE=$MAKE clean          $MAKE MAKE=$MAKE clean
328      else      else
329          complain "$this: !!! Run-time system build failed for some reason."          complain "$this: !!! Run-time system build failed for some reason."
330      fi      fi
331  fi  fi
332  cd $SRCDIR  cd "$SRCDIR"
333    
334  #  #
335  # boot the base SML system  # boot the base SML system
336  #  #
337  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then  if [ -r "$HEAPDIR"/sml.$HEAP_SUFFIX ]; then
338      vsay $this: Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.      vsay $this: Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.
339      fish $LIBDIR/basis.cm      fish "$LIBDIR"/basis.cm
340      # ignore requested arc name since we have to live with what is there:      # ignore requested arc name since we have to live with what is there:
341      export CM_DIR_ARC=$ORIG_CM_DIR_ARC      export CM_DIR_ARC
342        CM_DIR_ARC=$ORIG_CM_DIR_ARC
343        # now re-dump the heap image:
344        vsay "$this: Re-creating a (customized) heap image..."
345        "$BINDIR"/sml @CMredump "$ROOT"/sml
346        cd "$ROOT"
347        if [ -r sml.$HEAP_SUFFIX ]; then
348            mv sml.$HEAP_SUFFIX "$HEAPDIR"
349  else  else
350      $CONFIGDIR/unpack $ROOT $BOOT_ARCHIVE          complain "$this !!! Unable to re-create heap image (sml.$HEAP_SUFFIX)."
351        fi
352    else
353        "$CONFIGDIR"/unpack "$ROOT" "$BOOT_ARCHIVE"
354    
355      fish $ROOT/$BOOT_FILES/basis.cm      fish "$ROOT"/"$BOOT_FILES"/basis.cm
356    
357      cd $ROOT      cd "$ROOT"
358    
359      # Target arc:      # Target arc:
360      export CM_DIR_ARC=${CM_DIR_ARC:-".cm"}      export CM_DIR_ARC
361        CM_DIR_ARC=${CM_DIR_ARC:-".cm"}
362    
363      if [ $CM_DIR_ARC = $ORIG_CM_DIR_ARC ] ; then      if [ $CM_DIR_ARC = $ORIG_CM_DIR_ARC ] ; then
364          : we are happy          : we are happy
365      else      else
366          # now we have to make a symbolic link for each occurrence of          # now we have to make a symbolic link for each occurrence of
367          # $ORIG_CM_DIR_ARC to $CM_DIR_ARC          # $ORIG_CM_DIR_ARC to $CM_DIR_ARC
368          dirarcs ${ORIG_CM_DIR_ARC} ${CM_DIR_ARC} $BOOT_FILES          dirarcs "$ORIG_CM_DIR_ARC" "$CM_DIR_ARC" "$BOOT_FILES"
369      fi      fi
370    
371      cd $ROOT/$BOOT_FILES      cd "$ROOT"/"$BOOT_FILES"
372    
373      # now link (boot) the system and let it initialize itself...      # now link (boot) the system and let it initialize itself...
374      if $BINDIR/.link-sml @SMLheap=$ROOT/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC      if "$BINDIR"/.link-sml @SMLheap="$ROOT"/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC
375      then      then
376          cd $ROOT          cd "$ROOT"
377          if [ -r sml.$HEAP_SUFFIX ]; then          if [ -r sml.$HEAP_SUFFIX ]; then
378              mv sml.$HEAP_SUFFIX $HEAPDIR              mv sml.$HEAP_SUFFIX "$HEAPDIR"
379              cd $BINDIR              cd "$BINDIR"
380              ln -s .run-sml sml              ln -s .run-sml sml
381              #              #
382              # Now move all stable libraries to #LIBDIR and generate              # Now move all stable libraries to #LIBDIR and generate
383              # the pathconfig file.              # the pathconfig file.
384              #              #
385              cd $ROOT/$BOOT_FILES              cd "$ROOT"/"$BOOT_FILES"
386              for anchor in * ; do              for anchor in * ; do
387                  if [ -d $anchor ] ; then                  if [ -d $anchor ] ; then
388                      echo $anchor $anchor >>$CM_PATHCONFIG                      echo $anchor $anchor >>$CM_PATHCONFIG
389                      move $anchor $LIBDIR/$anchor                      move $anchor "$LIBDIR"/$anchor
390                  fi                  fi
391              done              done
392              cd $ROOT              cd "$ROOT"
393              # $BOOT_FILES is now only an empty skeleton, let's get rid of it.              # $BOOT_FILES is now only an empty skeleton, let's get rid of it.
394              rm -rf $BOOT_FILES              rm -rf "$BOOT_FILES"
395    
396          else          else
397              complain "$this !!! No heap image generated (sml.$HEAP_SUFFIX)."              complain "$this !!! No heap image generated (sml.$HEAP_SUFFIX)."
# Line 383  Line 406 
406  #  #
407  installdriver _ml-build ml-build  installdriver _ml-build ml-build
408    
409  cd $ROOT  cd "$ROOT"
410    
411  #  #
412  # Now do all the rest using the precompiled installer:  # Now do all the rest using the precompiled installer:
413  #  #
414    if [ $nolib = false ] ; then
415  echo $this: Installing other libraries and programs:  echo $this: Installing other libraries and programs:
416  export ROOT INSTALLDIR CONFIGDIR BINDIR  export ROOT INSTALLDIR CONFIGDIR BINDIR
417  if $BINDIR/sml -m \$smlnj/installer.cm      if "$BINDIR"/sml -m \$smlnj/installer.cm
418  then  then
419      vsay $this: Installation complete.      vsay $this: Installation complete.
420  else  else
421      complain "$this: !!! Installation of libraries and programs failed."      complain "$this: !!! Installation of libraries and programs failed."
422  fi  fi
423    fi
424    
425  exit 0  exit 0

Legend:
Removed from v.1494  
changed lines
  Added in v.1863

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