Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/system/installml
ViewVC logotype

View of /sml/trunk/src/system/installml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 537 - (download) (annotate)
Fri Feb 18 17:20:16 2000 UTC (19 years, 9 months ago) by blume
File size: 1800 byte(s)
CM changes: standalone builds, better CMB.make/deliver, general improvements
#!/bin/sh

# The tmpfile is for pathconfig editing (see below).
tmpfile=pathconfig.tmp.$$

trap 'rm -f $tmpfile; exit 1' 0 1 2 3 15

MAIN_HEAP_DIR=../../bin/.heap
MAIN_LIB_DIR=../../lib

if [ $# -gt 0 ] ; then
    STEM=$1
else
    STEM=sml
fi

if [ -f ../../bin/.arch-n-opsys ]; then
  ARCH_N_OPSYS=`../../bin/.arch-n-opsys`
  if [ "$?" = "0" ]; then
    eval $ARCH_N_OPSYS
  else
    echo "Cannot determine architecture/os."
    exit 1
  fi
fi

HEAP_FILE=$STEM.$ARCH-$OPSYS
LIB_DIR=$STEM.lib

if [ ! -f $HEAP_FILE ] ; then
    echo "The heap file $HEAP_FILE is missing."
    exit 1
fi

if [ ! -d $LIB_DIR ] ; then
    echo "The library directory $LIB_DIR is missing."
    exit 1
fi

# Moving the heap image to its place
mv $HEAP_FILE $MAIN_HEAP_DIR/sml.$ARCH-$OPSYS

# Moving each individual library...
cd $LIB_DIR
list=`echo *.cm`
cd ..
for lib in init.cmi $list ; do
    if [ -d $MAIN_LIB_DIR/$lib/CM/$ARCH-unix ] ; then
	rm -r $MAIN_LIB_DIR/$lib/CM/$ARCH-unix
    fi
    # Be careful not to clobber libraries for other architectures...
    if [ -d $MAIN_LIB_DIR/$lib ] ; then
	if [ -d $MAIN_LIB_DIR/$lib/CM ] ; then
	    mv $LIB_DIR/$lib/CM/$ARCH-unix $MAIN_LIB_DIR/$lib/CM/$ARCH-unix
	else
	    mv $LIB_DIR/$lib/CM $MAIN_LIB_DIR/$lib/CM
	fi
    else
	mv $LIB_DIR/$lib $MAIN_LIB_DIR/$lib
    fi
done

# Update the pathconfig file in $MAIN_LIB_DIR
#  The awk script below replaces the original binding in $pcfile
#  with its fresh counterpart should there be one.  Other bindings
#  are retained and brand new ones are added.
pcfile=$MAIN_LIB_DIR/pathconfig
if [ -f $pcfile ] ; then
    cp $pcfile $tmpfile
fi
rm -f $pcfile
cat $LIB_DIR/pathconfig >>$tmpfile
awk <$tmpfile >$pcfile 'NF == 2 { mapping[$1] = $2 }
NF != 2 { print $0 }
END { for (i in mapping) print i, mapping[i] }'

rm -r $LIB_DIR

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