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

sml/trunk/config/install.sh revision 1494, Thu May 20 03:09:17 2004 UTC config/releases/release-110.63/install.sh revision 2369, Thu Mar 22 21:07:47 2007 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 70  Line 77 
77  CONFIGDIR=$ROOT/config  CONFIGDIR=$ROOT/config
78  HEAPDIR=$BINDIR/.heap           # where heap images live  HEAPDIR=$BINDIR/.heap           # where heap images live
79  RUNDIR=$BINDIR/.run             # where executables (i.e., the RTS) live  RUNDIR=$BINDIR/.run             # where executables (i.e., the RTS) live
80  SRCDIR=$ROOT/src                # where the source tree is rooted  BASEDIR=$ROOT/base              # where the base source tree is rooted
81  LIBDIR=$INSTALLDIR/lib          # where libraries live  LIBDIR=$INSTALLDIR/lib          # where libraries live
82    
83  #  #
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" "$BASEDIR" ; 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,@LIBDIR@,$LIBDIR," \
232              -e "s,@VERSION@,$VERSION," \              -e "s,@VERSION@,$VERSION," \
233              -e "s,@CMDIRARC@,${CM_DIR_ARC:-dummy}," \              -e "s,@CMDIRARC@,${CM_DIR_ARC:-dummy}," \
234              > $BINDIR/$ddst              > "$BINDIR"/"$ddst"
235          chmod 555 $BINDIR/$ddst          chmod 555 "$BINDIR"/"$ddst"
236          if [ ! -x $BINDIR/$ddst ]; then          if [ ! -x "$BINDIR"/"$ddst" ]; then
237              complain "$this: !!! Installation of $BINDIR/${ddst} failed."              complain "$this: !!! Installation of $BINDIR/${ddst} failed."
238          fi          fi
239  #   fi  #   fi
# Line 240  Line 248 
248  # 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
249  # corresponding variables...  # corresponding variables...
250  #  #
251  ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`  ARCH_N_OPSYS=`"$BINDIR"/.arch-n-opsys`
252  if [ "$?" != "0" ]; then  if [ "$?" != "0" ]; then
253      echo "$this: !!! Script $BINDIR/.arch-n-opsys fails on this machine."      echo "$this: !!! Script $BINDIR/.arch-n-opsys fails on this machine."
254      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 266 
266  installdriver _link-sml .link-sml  installdriver _link-sml .link-sml
267  installdriver _ml-makedepend ml-makedepend  installdriver _ml-makedepend ml-makedepend
268    
269    installdriver _heap2exec heap2exec
270    
271  #  #
272  # set some architecture dependent run-time system flags  # set some architecture dependent run-time system flags
273  #  #
# Line 303  Line 313 
313  #  #
314  # build the run-time system  # build the run-time system
315  #  #
316  if [ -x $RUNDIR/run.$ARCH-$OPSYS ]; then  if [ -x "$RUNDIR"/run.$ARCH-$OPSYS ]; then
317      vsay $this: Run-time system already exists.      vsay $this: Run-time system already exists.
318  else  else
319      $CONFIGDIR/unpack $ROOT runtime      "$CONFIGDIR"/unpack "$ROOT" runtime
320      cd $SRCDIR/runtime/objs      cd "$BASEDIR"/runtime/objs
321      echo $this: Compiling the run-time system.      echo $this: Compiling the run-time system.
322      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
323      if [ -x run.$ARCH-$OPSYS ]; then      if [ -x run.$ARCH-$OPSYS ]; then
324          mv run.$ARCH-$OPSYS $RUNDIR          mv run.$ARCH-$OPSYS "$RUNDIR"
325            if [ -f runx.$ARCH-$OPSYS ]; then
326                mv runx.$ARCH-$OPSYS "$RUNDIR"
327            fi
328            if [ -f run.$ARCH-$OPSYS.so ]; then
329                mv run.$ARCH-$OPSYS.so "$RUNDIR"
330            fi
331            if [ -f run.$ARCH-$OPSYS.a ]; then
332                mv run.$ARCH-$OPSYS.a "$RUNDIR"
333            fi
334          $MAKE MAKE=$MAKE clean          $MAKE MAKE=$MAKE clean
335      else      else
336          complain "$this: !!! Run-time system build failed for some reason."          complain "$this: !!! Run-time system build failed for some reason."
337      fi      fi
338  fi  fi
339  cd $SRCDIR  cd "$BASEDIR"
340    
341  #  #
342  # boot the base SML system  # boot the base SML system
343  #  #
344  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then  if [ -r "$HEAPDIR"/sml.$HEAP_SUFFIX ]; then
345      vsay $this: Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.      vsay $this: Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.
346      fish $LIBDIR/basis.cm      fish "$LIBDIR"/smlnj/basis
347      # 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:
348      export CM_DIR_ARC=$ORIG_CM_DIR_ARC      export CM_DIR_ARC
349        CM_DIR_ARC=$ORIG_CM_DIR_ARC
350        # now re-dump the heap image:
351        vsay "$this: Re-creating a (customized) heap image..."
352        "$BINDIR"/sml @CMredump "$ROOT"/sml
353        cd "$ROOT"
354        if [ -r sml.$HEAP_SUFFIX ]; then
355            mv sml.$HEAP_SUFFIX "$HEAPDIR"
356  else  else
357      $CONFIGDIR/unpack $ROOT $BOOT_ARCHIVE          complain "$this !!! Unable to re-create heap image (sml.$HEAP_SUFFIX)."
358        fi
359    else
360        "$CONFIGDIR"/unpack "$ROOT" "$BOOT_ARCHIVE"
361    
362      fish $ROOT/$BOOT_FILES/basis.cm      fish "$ROOT"/"$BOOT_FILES"/smlnj/basis
363    
364      cd $ROOT      cd "$ROOT"
365    
366      # Target arc:      # Target arc:
367      export CM_DIR_ARC=${CM_DIR_ARC:-".cm"}      export CM_DIR_ARC
368        CM_DIR_ARC=${CM_DIR_ARC:-".cm"}
369    
370      if [ $CM_DIR_ARC = $ORIG_CM_DIR_ARC ] ; then      if [ $CM_DIR_ARC = $ORIG_CM_DIR_ARC ] ; then
371          : we are happy          : we are happy
372      else      else
373          # now we have to make a symbolic link for each occurrence of          # now we have to make a symbolic link for each occurrence of
374          # $ORIG_CM_DIR_ARC to $CM_DIR_ARC          # $ORIG_CM_DIR_ARC to $CM_DIR_ARC
375          dirarcs ${ORIG_CM_DIR_ARC} ${CM_DIR_ARC} $BOOT_FILES          dirarcs "$ORIG_CM_DIR_ARC" "$CM_DIR_ARC" "$BOOT_FILES"
376      fi      fi
377    
378      cd $ROOT/$BOOT_FILES      cd "$ROOT"/"$BOOT_FILES"
379    
380      # now link (boot) the system and let it initialize itself...      # now link (boot) the system and let it initialize itself...
381      if $BINDIR/.link-sml @SMLheap=$ROOT/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC      if "$BINDIR"/.link-sml @SMLheap="$ROOT"/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC
382      then      then
383          cd $ROOT          cd "$ROOT"
384          if [ -r sml.$HEAP_SUFFIX ]; then          if [ -r sml.$HEAP_SUFFIX ]; then
385              mv sml.$HEAP_SUFFIX $HEAPDIR              mv sml.$HEAP_SUFFIX "$HEAPDIR"
386              cd $BINDIR              cd "$BINDIR"
387              ln -s .run-sml sml              ln -s .run-sml sml
388              #              #
389              # Now move all stable libraries to #LIBDIR and generate              # Now move all stable libraries to #LIBDIR and generate
390              # the pathconfig file.              # the pathconfig file.
391              #              #
392              cd $ROOT/$BOOT_FILES              cd "$ROOT"/"$BOOT_FILES"
393              for anchor in * ; do              for anchor in * ; do
394                  if [ -d $anchor ] ; then                  if [ -d $anchor ] ; then
395                      echo $anchor $anchor >>$CM_PATHCONFIG                      echo $anchor $anchor >>$CM_PATHCONFIG
396                      move $anchor $LIBDIR/$anchor                      move $anchor "$LIBDIR"/$anchor
397                  fi                  fi
398              done              done
399              cd $ROOT              cd "$ROOT"
400              # $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.
401              rm -rf $BOOT_FILES              rm -rf "$BOOT_FILES"
402    
403          else          else
404              complain "$this !!! No heap image generated (sml.$HEAP_SUFFIX)."              complain "$this !!! No heap image generated (sml.$HEAP_SUFFIX)."
# Line 383  Line 413 
413  #  #
414  installdriver _ml-build ml-build  installdriver _ml-build ml-build
415    
416  cd $ROOT  cd "$ROOT"
417    
418  #  #
419  # Now do all the rest using the precompiled installer:  # Now do all the rest using the precompiled installer:
420  #  #
421    if [ $nolib = false ] ; then
422  echo $this: Installing other libraries and programs:  echo $this: Installing other libraries and programs:
423  export ROOT INSTALLDIR CONFIGDIR BINDIR  export ROOT INSTALLDIR CONFIGDIR BINDIR
424  if $BINDIR/sml -m \$smlnj/installer.cm      if "$BINDIR"/sml -m \$smlnj/installer.cm
425  then  then
426      vsay $this: Installation complete.      vsay $this: Installation complete.
427  else  else
428      complain "$this: !!! Installation of libraries and programs failed."      complain "$this: !!! Installation of libraries and programs failed."
429  fi  fi
430    fi
431    
432  exit 0  exit 0

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

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