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 1494, Thu May 20 03:09:17 2004 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/sh
2  #  #
3  # Copyright (c) 1994 AT&T Bell Laboratories.  # Copyright (c) 1994 AT&T Bell Laboratories.
4    # Copyright (c) 2003 The Fellowship of SML/NJ
5  #  #
6  # Installation script for SML/NJ and related tools; this is a temporary  # Installation script for SML/NJ and related tools; this is a temporary
7  # placeholder until the configuration tool is finished.  # placeholder until the configuration tool is finished.
8  #  #
9  # Significant changes to accommodate (and take advantage of) the new CM  # Significant changes to take advantage of a new portable installer
10  # by M.Blume (2/2000).  # script for everything after booting the interactive system.
11    #
12    # Author: Matthias Blume (blume@tti-c.org)
13  #  #
14    
15  this=$0  if [ x${INSTALL_QUIETLY} = xtrue ] ; then
16        export CM_VERBOSE=false
17    fi
18    
19  #  vsay() {
20  # get the target list      if [ x${INSTALL_DEBUG} = xtrue ] ; then
21  #          echo "$@"
22  if [ -r config/targets.customized ] ; then      elif [ x${INSTALL_QUIETLY} = xtrue ] ; then
23      . config/targets.customized          :
 elif [ ! -r config/targets ]; then  
     echo "$this: !!! File config/targets is missing."  
     exit 1  
24  else  else
25      . config/targets          echo "$@"
26  fi  fi
27    }
28    
29    complain() {
30        echo "$@"
31        exit 1
32    }
33    
34    this=$0
35    
36    
37  #  #
38  # create the preloads.standard file  # create the preloads.standard file
39  #  #
40  if [ ! -r config/preloads ]; then  if [ ! -r config/preloads ]; then
41      echo "$this: !!! File config/preloads is missing."      complain "$this: !!! File config/preloads is missing."
     exit 1  
42  fi  fi
43  cp config/preloads preloads.standard  cp config/preloads preloads.standard
44    
# Line 38  Line 48 
48  #  #
49  MAKE=make  MAKE=make
50    
 #  
 # Make sure we don't have any unpleasant surprises due to the installing  
 # user's process environment:  
 #  
 unset CM_PATHCONFIG  
   
51  SHELL=/bin/sh  SHELL=/bin/sh
52  echo $this: Using shell $SHELL.  vsay $this: Using shell $SHELL.
53    
54  #  #
55  # set the SML root directory  # set the SML root directory
56  #  #
57  REAL_PWD=`pwd`  REAL_PWD=`pwd`
58  ROOT=${PWD:-$REAL_PWD}  ROOT=${PWD:-$REAL_PWD}
59  echo $this: SML root is $ROOT.  vsay $this: SML root is $ROOT.
60  echo $this: Installation directory is ${INSTALLDIR:=$ROOT}.  
61    cd ${INSTALLDIR:=$ROOT}
62    INSTALLDIR=`pwd`
63    cd $ROOT
64    vsay $this: Installation directory is ${INSTALLDIR}.
65    
66  #  #
67  # set the various directory and file pathname variables  # set the various directory and file pathname variables
# Line 64  Line 72 
72  RUNDIR=$BINDIR/.run             # where executables (i.e., the RTS) live  RUNDIR=$BINDIR/.run             # where executables (i.e., the RTS) live
73  SRCDIR=$ROOT/src                # where the source tree is rooted  SRCDIR=$ROOT/src                # where the source tree is rooted
74  LIBDIR=$INSTALLDIR/lib          # where libraries live  LIBDIR=$INSTALLDIR/lib          # where libraries live
 LIBLIST=$ROOT/liblist           # list of commands to stabilize libraries  
 LATESTANDALONES=$ROOT/latestandalones # standalone programs to be built late  
 LIBMOVESCRIPT=$ROOT/libmove     # a temporary script  
 LOCALPATHCONFIG=$INSTALLDIR/pathconfig # a temporary pathconfig file  
   
 URLGETTER=unknown  
   
 #  
 # the path to the dir where ml-yacc, ml-burg, ml-lex, ml-build, and  
 # ml-makedepend live  
 #  
 TOOLDIR=$BINDIR  
   
 #  
 # A temporary file for post-editing the pathconfig file...  
 #  
 PCEDITTMP=$INSTALLDIR/pcedittmp.$$  
75    
76  #  #
77  # files to be deleted after we are done...  # files to be deleted after we are done...
78  #  #
79  tmpfiles=""  tmpfiles=""
80  tmpfiles="$tmpfiles $ROOT/preloads.standard"  tmpfiles="$tmpfiles $ROOT/preloads.standard"
 tmpfiles="$tmpfiles $LIBLIST"  
 tmpfiles="$tmpfiles $LATESTANDALONES"  
 tmpfiles="$tmpfiles $LOCALPATHCONFIG"  
 tmpfiles="$tmpfiles $LIBMOVESCRIPT"  
 tmpfiles="$tmpfiles $PCEDITTMP"  
81  #  #
82  # make sure we always clean up after ourselves...  # make sure we always clean up after ourselves...
83  #  #
# Line 101  Line 87 
87  #  #
88  # set the CM configuration variables (these are environment variables  # set the CM configuration variables (these are environment variables
89  # that will be queried by the bootstrap code)  # that will be queried by the bootstrap code)
90  # Especially important is CM_PATHCONFIG_DEFAULT.  # Especially important is CM_PATHCONFIG.
91  #  #
92  CM_PATHCONFIG_DEFAULT=$LIBDIR/pathconfig  CM_PATHCONFIG=$LIBDIR/pathconfig
93  export CM_PATHCONFIG_DEFAULT  export CM_PATHCONFIG
94    
95  #  #
96  # the release version that we are installing  # the release version that we are installing
97  #  #
98  VERSION=`cat $CONFIGDIR/version`  VERSION=`cat $CONFIGDIR/version`
99  echo $this: Installing version $VERSION.  vsay $this: Installing version $VERSION.
100    
101  #  #
102  # the URL for the (usually remote) source archive  # the URL for the (usually remote) source archive
103  #  #
104  SRCARCHIVEURL=`cat $CONFIGDIR/srcarchiveurl`  SRCARCHIVEURL=`cat $CONFIGDIR/srcarchiveurl`
105  echo $this: URL of source archive is $SRCARCHIVEURL.  vsay $this: URL of source archive is $SRCARCHIVEURL.
106    
107  #  #
108  # Function to make a directory (and advertise such action).  # Function to make a directory including its ancestors.
109  #  #
110  makedir() {  makedir() {
111      if [ ! -d $1 ] ; then      if [ x$1 = x ] ; then
112          echo $this: Making directory $1          :
113        elif [ -d $1 ] ; then
114            :
115        else
116            makedir `dirname $1`
117            if [ x${INSTALL_VERBOSE} = xtrue ] ; then
118                vsay "$this: Making directory $1"
119            fi
120          if mkdir $1 ; then          if mkdir $1 ; then
121              : everything is fine              :
122          else          else
123              echo "$this: !!! Unable to make directory $1!"              complain "$this: !!! Unable to make directory $1!"
             exit 1  
124          fi          fi
125      fi      fi
126  }  }
127    
128  #  #
129  # Function for asking user to fetch source archive.  # Fish out the CM metadata directory name from library files
130  #   $1 - descriptive name  # and store it in ORIG_CM_DIR_ARC.
131  #   $2 - base name without extension, without version, and without dir  # The single argument is the name of the directory containing
132  #   $3 - remote directory  # a single subdirectory which is a CM metadata directory:
 #  
 askurl() {  
     echo "$this: Please, fetch $1 archive"  
     echo ' ('$2.'*' or $VERSION-$2.'*)'  
     echo " from $3"  
     echo " and then re-run this script!"  
     exit 1  
 }  
   
133  #  #
134  # Function for fetching source archives automatically using wget or lynx.  fish() {
135  #   $1 - command to actually get the stuff      cd $1
136  #   $2 - descriptive name      ORIG_CM_DIR_ARC=unknown
137  #   $3 - base name without extension and without dir      for i in * .[a-zA-Z0-9]* ; do
138  #   $4 - remote directory          if [ -d $i ] ; then
139  #              ORIG_CM_DIR_ARC=$i
140  fetchurl() {              break
     getter=$1 ; shift  
     echo $this: Fetching $1 from $3. Please stand by...  
     fetched=no  
     for base in $2 $VERSION-$2 ; do  
         for ext in tar.gz tgz tar.Z tz tar tar.bz2 ; do  
             try=$base.$ext  
             echo $this: Trying $try ...  
             if $getter $3 $try $ROOT/$try ; then  
                 fetched=yes  
                 echo $this: Fetching $try was a success.  
                 break 2         # get out of both for-loops  
             else  
                 rm -f $ROOT/$try  
141              fi              fi
142          done          done
143      done      if [ $ORIG_CM_DIR_ARC = unknown ] ; then
144      if [ $fetched = no ] ; then          complain "$this: could not determine CM metadata directory name"
         echo $this: Fetching $try was no success.  
         echo '  ' You should try to do it manually now.  
         askurl "$1" "$2" "$3"  
     fi  
 }  
   
 usewget() {  
     wget -nv -O $3 $1/$2  
 }  
   
 uselynx() {  
     lynx -source $1/$2 >$3  
 }  
   
 testurlgetter() {  
     (exec >/dev/null 2>&1 ; exec $*)  
 }  
   
 #  
 # Function to check whether wget or lynx is available.  
 # Set URLGETTER accordingly.  
 #  
 urlgetter() {  
     if [ "$URLGETTER" = unknown ] ; then  
         if testurlgetter wget --help ; then  
             URLGETTER="fetchurl usewget"  
         elif testurlgetter lynx -help ; then  
             URLGETTER="fetchurl uselynx"  
145          else          else
146              URLGETTER="askurl"          echo "$this: CM metadata directory name is \"${ORIG_CM_DIR_ARC}\""
         fi  
     fi  
 }  
   
 un_tar() {  
     echo "$this: Un-TAR-ing $1 archive."  
     tar -xf $2  
 }  
   
 un_tar_Z() {  
     echo "$this: Un-COMPRESS-ing and un-TAR-ing $1 archive."  
     zcat $2 | tar -xf -  
 }  
   
 un_tar_gz() {  
     echo "$this: Un-GZIP-ing and un-TAR-ing $1 archive."  
     gunzip -c $2 | tar -xf -  
 }  
   
 un_tar_bz2() {  
     echo "$this: Un-BZIP2-ing and un-TAR-ing $1 archive."  
     bunzip2 -c $2 | tar -xf -  
 }  
   
 unarchive() {  
     # $1: descriptive string, $2: archive, $3: unpacker  
     if [ -r $ROOT/$2 ] ; then  
         $3 "$1" $ROOT/$2  
     elif [ -r $ROOT/$VERSION-$2 ]; then  
         $3 "$1" $ROOT/$VERSION-$2  
     else  
         return 1  
147      fi      fi
148  }  }
149    
 #  
 # Function to unpack a source archive.  
 #  
 # $1: descriptive name of the sources to be unpacked  
 # $2: the directory into which to unpack the sources  
 # $3: the sub-directory of $2 that is going to be created by unpacking  
 # $4: the basename of the source archive (the script will check several  
 #     different suffixes to determine what kind of de-compression is to  
 #     be used)  
 #  
 # fetch_n_unpack is the helper function that does the real work.  If  
 # no archive is found locally, it invokes $URLGETTER and tries again.  
 # The variable $tryfetch is used to make sure this happens only once.  
 fetch_n_unpack() {  
     cd $2  
     if unarchive "$1" $4.tar.gz un_tar_gz ||  
        unarchive "$1" $4.tgz un_tar_gz ||  
        unarchive "$1" $4.tar.Z un_tar_Z ||  
        unarchive "$1" $4.tar un_tar ||  
        unarchive "$1" $4.tar.bz1 un_tar_bz2 ||  
        unarchive "$1" $4.tz un_tar_Z  
     then  
         : we are done  
     elif [ $tryfetch = yes ] ; then  
         urlgetter  
         $URLGETTER "$1" $4 $SRCARCHIVEURL  
         tryfetch=no  
         fetch_n_unpack "$1" "$2" "$3" "$4"  
     fi  
 }  
   
 #  
 # The main "unpack" driver function that invokes the above helper.  
 #  
 unpack() {  
     tryfetch=yes  
     if [ -d $2/$3 ]; then  
         echo "$this: The $1 tree already exists."  
     else  
         fetch_n_unpack "$1" "$2" "$3" "$4"  
     fi  
     if [ ! -d $2/$3 ]; then  
         echo "$this: !!! Unable to unpack $1 archive."  
         exit 1  
     fi  
 }  
150    
151  # A function to move all stable library files to a parallel directory  # A function to move all stable library files to a parallel directory
152  # hierarchy.  # hierarchy.
153  # The first argument must be a simple path (no / inside), and  # The first argument must be a simple path (no / inside), and
154  # the second argument must be an absolute path.  # the second argument must be an absolute path.
155  move() {  move() {
156      if [ -d $1 ] ; then      if [ -L $1 ] ; then
157            rm -f $1             # remove symbolic link made by diracs (see below)
158        elif [ -d $1 ] ; then
159          if [ ! -d $2 ] ; then          if [ ! -d $2 ] ; then
160              if [ -f $2 ] ; then              if [ -f $2 ] ; then
161                  echo $this: $2 exists as a non-directory.                  complain $this: $2 exists as a non-directory.
                 exit 1  
162              fi              fi
163              mkdir $2              mkdir $2
164          fi          fi
165          cd $1          cd $1
166          for i in * ; do          for i in * .[a-zA-Z0-9]* ; do
167              move $i $2/$i              move $i $2/$i
168          done          done
169          cd ..          cd ..
# Line 309  Line 174 
174  }  }
175    
176  #  #
177  # Move the stable archive of a library whose description file was $1/$2 to  # Traverse the directory tree rooted at $3 (must be single arc!).
178  # $LIBDIR/$2/CM/$ARCH-unix/$2 so that it appears as if the description file  # Find all directories named $1, rename them into $2 and make
179  # had been at $LIBDIR/$2/$2  # and establish $1 as a symbolic link to $2:
180  #  #
181  # (This script will also move all other libraries that show up in  dirarcs() {
182  #  $1/CM/$ARCH-unix because in the case of the boot directory this indicates      if [ -d $3 ] ; then
183  #  that some library did not have its own path anchor but was specified          if [ $3 = $1 ] ; then
184  #  relative to $1/$2. Still, don't rely on this to be robust -- rather make              mv $1 $2
185  #  separate anchors for every library!)              ln -s $2 $1
186  #          else
187  movelibs() {              cd $3
188      for lib in `/bin/ls $1/CM/$ARCH-unix` ; do              for d in * .[a-zA-Z0-9]* ; do
189          case $lib in                  dirarcs $1 $2 $d
         *.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  
190       done       done
191  }              cd ..
   
 # A shell function that registers a library for being built.  
 # This function takes two arguments: 1. a name under which the library  
 # is to be known later (something.cm) and 2. the path relative to $SRCDIR  
 # that leads to the library's .cm file.  The library's .cm file must be the  
 # same as $1.  
 #  
 # This works by adding ML code to file $LIBLIST.  The code in this file  
 # will be executed near the end of this script.  If $MOVE_LIBRARIES is  
 # set to true, then reglib will also register a "movelibs" to be executed at  
 # the end by putting a "movelibs" line into $LIBMOVESCRIPT.  
   
 reglib() {  
     if [ x$MOVE_LIBRARIES = xtrue ] ; then  
         FINALLOCATION=$LIBDIR/$1  
         FINALCONFIGPATH=$1  
     else  
         FINALLOCATION=$SRCDIR/$2  
         FINALCONFIGPATH=$FINALLOCATION  
     fi  
     if [ -d $FINALLOCATION/CM/$ARCH-unix ] ; then  
         echo "$this: Library $1 already exists in $FINALLOCATION."  
     else  
         echo "$this: Scheduling library $1 to be built in $FINALLOCATION."  
         echo "  andalso CM.stabilize false \"\$/$1\"" >>$LIBLIST  
         echo $1 $SRCDIR/$2 >>$LOCALPATHCONFIG  
         if [ x$MOVE_LIBRARIES = xtrue ] ; then  
             echo movelibs $SRCDIR/$2 $1 >>$LIBMOVESCRIPT  
192          fi          fi
193      fi      fi
     echo $1 $FINALCONFIGPATH >>$CM_PATHCONFIG_DEFAULT  
194  }  }
195    
196  #  
197  # Function to build a standalone program such as ml-yacc.  The function takes  ######################################################################
 # 2 or 3 arguments.  First the name of the program which at the same time  
 # is the directory name under $SRCDIR where the sources reside.  The second  
 # argument is a descriptive name for the program (passed on to "unpack").  
 # The optional third argument specifies the path relative to $SRCDIR/$1  
 # of the directory where the program's heap image is to be found.  
 #  
   
 standalone() {  
     TARGET=$1.$HEAP_SUFFIX  
     if [ $# = 3 ] ; then  
         TARGETLOC=$3/$TARGET  
     else  
         TARGETLOC=$TARGET  
     fi  
     if [ -r $HEAPDIR/$TARGET ] ; then  
         echo $this: Target $TARGET already exists.  
     else  
         echo $this: Building $TARGET.  
         unpack $2 $SRCDIR $1 $1  
         cd $SRCDIR/$1  
         # build it, but make sure we don't pick up some (unrelated)  
         # local path configuration...  
         CM_LOCAL_PATHCONFIG=/dev/null ./build  
         if [ -r $TARGETLOC ] ; then  
             mv $TARGETLOC $HEAPDIR/$TARGET  
             if [ ! -f $BINDIR/$1 ] ; then  
                 cd $BINDIR  
                 ln -s .run-sml $1  
             fi  
         else  
             echo "$this: !!! Build of $TARGET failed."  
         fi  
     fi  
 }  
198    
199  #  #
200  # create the various sub directories  # create the various sub directories
# Line 415  Line 204 
204  done  done
205    
206  #  #
 # 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  
   
 #  
207  # Function to install a "driver" script...  # Function to install a "driver" script...
208  #   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,
209  #   BINDIR, and VERSION variables to use.  #   BINDIR, and VERSION variables to use.
# Line 458  Line 222 
222          sed -e "s,@SHELL@,$SHELL,g" \          sed -e "s,@SHELL@,$SHELL,g" \
223              -e "s,@BINDIR@,$BINDIR," \              -e "s,@BINDIR@,$BINDIR," \
224              -e "s,@VERSION@,$VERSION," \              -e "s,@VERSION@,$VERSION," \
225                -e "s,@CMDIRARC@,${CM_DIR_ARC:-dummy}," \
226              > $BINDIR/$ddst              > $BINDIR/$ddst
227          chmod 555 $BINDIR/$ddst          chmod 555 $BINDIR/$ddst
228          if [ ! -x $BINDIR/$ddst ]; then          if [ ! -x $BINDIR/$ddst ]; then
229              echo "$this: !!! Installation of $BINDIR/${ddst} failed."              complain "$this: !!! Installation of $BINDIR/${ddst} failed."
             exit 1  
230          fi          fi
231  #   fi  #   fi
232  }  }
233    
234    #
235    # install the script that tests architecture and os...
236    #
237    installdriver _arch-n-opsys .arch-n-opsys
238    
239    #
240    # run it to figure out what architecture and os we are using, define
241    # corresponding variables...
242    #
243    ARCH_N_OPSYS=`$BINDIR/.arch-n-opsys`
244    if [ "$?" != "0" ]; then
245        echo "$this: !!! Script $BINDIR/.arch-n-opsys fails on this machine."
246        echo "$this: !!! You must patch this by hand and repeat the installation."
247        exit 2
248    else
249        vsay $this: Script $BINDIR/.arch-n-opsys reports $ARCH_N_OPSYS.
250    fi
251    eval $ARCH_N_OPSYS
252    
253    #
254    # now install most of the other driver scripts
255    #  (except ml-build, since we don't know $CM_DIR_ARC yet)
256    #
257  installdriver _run-sml .run-sml  installdriver _run-sml .run-sml
258  installdriver _link-sml .link-sml  installdriver _link-sml .link-sml
 installdriver _ml-build ml-build  
259  installdriver _ml-makedepend ml-makedepend  installdriver _ml-makedepend ml-makedepend
260    
261  #  #
# Line 502  Line 288 
288      linux)      linux)
289          EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`          EXTRA_DEFS=`$CONFIGDIR/chk-global-names.sh`
290          if [ "$?" != "0" ]; then          if [ "$?" != "0" ]; then
291              echo "$this: !!! Problems checking for underscores in asm names."              complain "$this: !!! Problems checking for underscores in asm names."
             exit 1  
292          fi          fi
293          EXTRA_DEFS="XDEFS=$EXTRA_DEFS"          EXTRA_DEFS="XDEFS=$EXTRA_DEFS"
294          ;;          ;;
# Line 518  Line 303 
303  #  #
304  # build the run-time system  # build the run-time system
305  #  #
 unpack "run-time" $SRCDIR runtime runtime  
306  if [ -x $RUNDIR/run.$ARCH-$OPSYS ]; then  if [ -x $RUNDIR/run.$ARCH-$OPSYS ]; then
307      echo $this: Run-time system already exists.      vsay $this: Run-time system already exists.
308  else  else
309        $CONFIGDIR/unpack $ROOT runtime
310      cd $SRCDIR/runtime/objs      cd $SRCDIR/runtime/objs
311      echo $this: Compiling the run-time system.      echo $this: Compiling the run-time system.
312      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS      $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
# Line 529  Line 314 
314          mv run.$ARCH-$OPSYS $RUNDIR          mv run.$ARCH-$OPSYS $RUNDIR
315          $MAKE MAKE=$MAKE clean          $MAKE MAKE=$MAKE clean
316      else      else
317          echo "$this: !!! Run-time system build failed for some reason."          complain "$this: !!! Run-time system build failed for some reason."
         exit 1  
318      fi      fi
319  fi  fi
320  cd $SRCDIR  cd $SRCDIR
# Line 539  Line 323 
323  # boot the base SML system  # boot the base SML system
324  #  #
325  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then  if [ -r $HEAPDIR/sml.$HEAP_SUFFIX ]; then
326      echo $this: Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.      vsay $this: Heap image $HEAPDIR/sml.$HEAP_SUFFIX already exists.
327        fish $LIBDIR/basis.cm
328        # ignore requested arc name since we have to live with what is there:
329        export CM_DIR_ARC=$ORIG_CM_DIR_ARC
330  else  else
331      unpack bin $ROOT $BOOT_FILES $BOOT_ARCHIVE      $CONFIGDIR/unpack $ROOT $BOOT_ARCHIVE
332    
333        fish $ROOT/$BOOT_FILES/basis.cm
334    
335        cd $ROOT
336    
337        # Target arc:
338        export CM_DIR_ARC=${CM_DIR_ARC:-".cm"}
339    
340        if [ $CM_DIR_ARC = $ORIG_CM_DIR_ARC ] ; then
341            : we are happy
342        else
343            # now we have to make a symbolic link for each occurrence of
344            # $ORIG_CM_DIR_ARC to $CM_DIR_ARC
345            dirarcs ${ORIG_CM_DIR_ARC} ${CM_DIR_ARC} $BOOT_FILES
346        fi
347    
348      cd $ROOT/$BOOT_FILES      cd $ROOT/$BOOT_FILES
349    
350        # now link (boot) the system and let it initialize itself...
351      if $BINDIR/.link-sml @SMLheap=$ROOT/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC      if $BINDIR/.link-sml @SMLheap=$ROOT/sml @SMLboot=BOOTLIST @SMLalloc=$ALLOC
352      then      then
353          cd $ROOT          cd $ROOT
# Line 557  Line 362 
362              cd $ROOT/$BOOT_FILES              cd $ROOT/$BOOT_FILES
363              for anchor in * ; do              for anchor in * ; do
364                  if [ -d $anchor ] ; then                  if [ -d $anchor ] ; then
365                      echo $anchor $anchor >>$CM_PATHCONFIG_DEFAULT                      echo $anchor $anchor >>$CM_PATHCONFIG
366                      move $anchor $LIBDIR/$anchor                      move $anchor $LIBDIR/$anchor
367                  fi                  fi
368              done              done
# Line 566  Line 371 
371              rm -rf $BOOT_FILES              rm -rf $BOOT_FILES
372    
373          else          else
374              echo "$this !!! No heap image generated (sml.$HEAP_SUFFIX)."              complain "$this !!! No heap image generated (sml.$HEAP_SUFFIX)."
             exit 1  
375          fi          fi
376      else      else
377          echo "$this !!! Boot code failed, no heap image (sml.$HEAP_SUFFIX)."          complain "$this !!! Boot code failed, no heap image (sml.$HEAP_SUFFIX)."
         exit 1  
378      fi      fi
379  fi  fi
380    
381  #  #
382  # Initialize $LIBLIST  # now that we know CM_DIR_ARC we can install the ml-build driver...
 #  
 cd $ROOT  
 rm -f $LOCALPATHCONFIG $LIBLIST  
 echo 'ignore (OS.Process.exit (if true' >$LIBLIST  
   
383  #  #
384  # now build (or prepare to build) the individual targets  installdriver _ml-build ml-build
 #  
 cd $SRCDIR  
 echo $this: Installing other targets.  
 for i in $TARGETS ; do  
     case $i in  
       src-smlnj)  
         for src in compiler cm MLRISC smlnj-lib ml-yacc system  
         do  
             unpack $src $ROOT/src $src $src  
         done  
         ;;  
       ml-yacc)  
         standalone ml-yacc ML-Yacc src  
         echo ml-yacc $TOOLDIR >>$CM_PATHCONFIG_DEFAULT  
         ;;  
       ml-lex)  
         standalone ml-lex ML-Lex  
         echo ml-lex $TOOLDIR >>$CM_PATHCONFIG_DEFAULT  
         ;;  
       ml-burg)  
         standalone ml-burg ML-Burg  
         echo ml-burg $TOOLDIR >>$CM_PATHCONFIG_DEFAULT  
         ;;  
       ml-nlffigen)  
         echo standalone ml-nlffigen ML-NLFFI-Gen >>$LATESTANDALONES  
         echo ml-nlffigen $TOOLDIR >>$CM_PATHCONFIG_DEFAULT  
         ;;  
       smlnj-lib)  
         unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib  
385    
386          # Don't make the Util library -- it came pre-made and has been  cd $ROOT
         # installed when making the base system.  In other words, don't do...  
             #reglib smlnj-lib.cm smlnj-lib/Util  
         # ... and don't make the HTML library ...  
             #reglib html-lib.cm smlnj-lib/HTML  
         # ... and don't make the PP library ...  
             #reglib pp-lib.cm smlnj-lib/PP  
         # make the Unix library  
             reglib unix-lib.cm smlnj-lib/Unix  
         # make the INet library  
             reglib inet-lib.cm smlnj-lib/INet  
         # make the RegExp library  
             reglib regexp-lib.cm smlnj-lib/RegExp  
         # make the Reactive library  
             reglib reactive-lib.cm smlnj-lib/Reactive  
         ;;  
       cml)  
         unpack CML $SRCDIR cml cml  
         reglib core-cml.cm cml/src/core-cml  
         reglib cml.cm cml/src  
         reglib cml-basis.cm cml  
         ;;  
       cml-lib)  
         unpack CML $SRCDIR cml cml  
         reglib cml-lib.cm cml/cml-lib  
         ;;  
       eXene)  
         unpack EXene $SRCDIR eXene eXene  
         reglib eXene.cm eXene  
         ;;  
       ckit)  
         unpack "C-Kit" $ROOT ckit ckit  
         reglib ckit-lib.cm ../ckit/src  
         ;;  
       ml-nlffi-lib)  
         unpack "NLFFI Library" $SRCDIR ml-nlffi-lib ml-nlffi-lib  
         reglib memory.cm ml-nlffi-lib/memory  
         reglib c-int.cm ml-nlffi-lib/internals  
         reglib c.cm ml-nlffi-lib  
         ;;  
       doc)  
         unpack Doc $ROOT doc doc  
         cd $ROOT/doc  
         build $ROOT  
         ;;  
       *)  
         echo "$this: !!! Unknown target $i."  
         ;;  
     esac  
 done  
387    
388  #  #
389  # Now go and stabilize all registered libraries...  # Now do all the rest using the precompiled installer:
 # This is done with library sources in their original locations inside  
 # $SRCDIR, so we must consult $LOCALPATHCONFIG.  
390  #  #
391    echo $this: Installing other libraries and programs:
392  echo $this: Compiling library code.  export ROOT INSTALLDIR CONFIGDIR BINDIR
393  echo 'then OS.Process.success else OS.Process.failure));' >>$LIBLIST  if $BINDIR/sml -m \$smlnj/installer.cm
394  if CM_LOCAL_PATHCONFIG=$LOCALPATHCONFIG $BINDIR/sml <$LIBLIST ; then  then
395      echo $this: Libraries compiled successfully.      vsay $this: Installation complete.
396  else  else
397      echo "$this: !!! Something went wrong when compiling the libraries."      complain "$this: !!! Installation of libraries and programs failed."
     exit 1  
 fi  
   
 #  
 # Move the libraries to their final locations...  
 #  
   
 if [ -r $LIBMOVESCRIPT ] ; then  
     echo $this: Moving libraries to $LIBDIR.  
     . $LIBMOVESCRIPT  
 fi  
   
 #  
 # Build "late" standalone programs (i.e., those that must be built  
 # after libraries are already in place):  
 #  
   
 if [ -r $LATESTANDALONES ] ; then  
     echo $this: Building late standalone programs.  
     . $LATESTANDALONES  
 fi  
   
 #  
 # Finally, remove duplicate entries from pathconfig file...  
 #  
 if [ -f $CM_PATHCONFIG_DEFAULT ] ; then  
     cp $CM_PATHCONFIG_DEFAULT $PCEDITTMP  
     rm -f $CM_PATHCONFIG_DEFAULT  
     awk <$PCEDITTMP 'NF == 2 { mapping[$1] = $2 }  
 NF != 2 { print $0 }  
 END { for (i in mapping) print i, mapping[i] }' \  
       | sort >$CM_PATHCONFIG_DEFAULT  
398  fi  fi
399    
400  exit 0  exit 0

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

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