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/makeml
ViewVC logotype

View of /sml/trunk/src/system/makeml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 569 - (download) (annotate)
Tue Mar 7 04:01:07 2000 UTC (19 years, 4 months ago) by blume
File size: 2823 byte(s)
- size info in BOOTLIST
     * no fixed upper limits for number of bootfiles or length of
       bootfile names in runtime
     * falling back to old behavior if no BOOTLIST size info found
- allocation size heuristics in .run-sml
     * tries to read cache size from /proc/cpuinfo (this is important for
        small-cache Celeron systems!)
- install.sh robustified
- CM manual updates
- paranoid mode
     * no more CMB.deliver() (i.e., all done by CMB.make())
     * can re-use existing sml.boot.* files
     * init.cmi now treated as library
     * library stamps for consistency checks
- sml.boot.<arch>-<os>/PIDMAP file
     * This file is read by the CM startup code.  This is used to minimize
       the amount of dynamic state that needs to be stowed away for the
       purpose of sharing between interactive system and user code.
- CM.Anchor.anchor instead of CM.Anchor.{set,cancel}
     * Upon request by Elsa.  Anchors now controlled by get-set-pair
       like most other CM state variables.
- Compiler.CMSA eliminated
     * No longer supported by CM anyway.
- fixed bugs in pickler that kept biting Stefan
     * past refs to past refs (was caused by the possibility that
       ad-hoc sharing is more discriminating than hash-cons sharing)
     * integer overflow on LargeInt.minInt
- ml-{lex,yacc} build scripts now use new mechanism
  for building standalone programs
- fixed several gcc -Wall warnings that were caused by missing header
  files, missing initializations, etc., in runtime (not all warnings
  eliminated, though)
#!/bin/sh

here=`pwd`
cd ../..
twoup=`pwd`
cd $here

LINK=$twoup/bin/.link-sml

if [ ! -x $LINK ] ; then
    echo Link script $LINK is not operational.
    exit 1
fi

ALLOC=1M
ARCH=sparc
HEAP="sml"
ARGS=""
MODE=""
RUN=""

rebuilt=no
bare=no

#
# Set CM_PATHCONFIG_DEFAULT to ../../lib/pathconfig
# (using an absolute path!)
#

CM_PATHCONFIG_DEFAULT=$twoup/lib/pathconfig
export CM_PATHCONFIG_DEFAULT

#
# use the arch-n-opsys script to determine the ARCH/OS if possible
#
if [ -f $twoup/bin/.arch-n-opsys ]; then
    ARCH_N_OPSYS=`$twoup/bin/.arch-n-opsys`
    if [ "$?" = "0" ]; then
	eval $ARCH_N_OPSYS
	echo Architecture: $ARCH
    fi
fi

# A function to create a directory hierarchy parallel to a given
# hierarchy where ordinary files are hard-linked (i.e., shared).
# The first argument must be a simple path (no / inside), and
# the second argument must be an absolute path.
link() {
    if [ -d $1 ] ; then
	if [ ! -d $2 ] ; then
	    if [ -f $2 ] ; then
		echo makeml: $2 exists as a non-directory.
		exit 1
	    fi
	    mkdir $2
	fi
	cd $1
	for i in * ; do
	    link $i $2/$i
	done
	cd ..
    elif [ -f $1 ] ; then
	rm -f $2
	ln $1 $2
    fi
}

BOOT_DIR="sml.boot.${ARCH}-unix"

while [ "$#" != "0" ] ; do
    arg=$1; shift
    case $arg in
    -run)
	if [ "$#" = "0" ]; then
	    echo "makeml: missing argument for \"-run\" option"
	    exit 1
	fi
	RUN="@SMLrun=$1"; shift
	;;
    -bare)
	bare=yes
	MODE="@SMLbare"
	;;
    -rebuild)
	if [ "$#" = "0" ]; then
	    echo "makeml: missing argument for \"-rebuild\" option"
	    exit 1
	fi
	rebuilt=yes
	MODE="@SMLrebuild=$1"; shift
	;;
    -o)
	if [ "$#" = "0" ]; then
	    echo "makeml: missing argument for \"-o\" option"
	    exit 1
	fi
	HEAP=$1; shift
	;;
    -alloc)
	if [ "$#" = "0" ]; then
	    echo "makeml: missing argument for \"-alloc\" option"
	    exit 1
	fi
	ALLOC=$1; shift
	;;
    -boot)
	if [ "$#" = "0" ]; then
	    echo "makeml: missing argument for \"-boot\" option"
	    exit 1
	fi
	BOOT_DIR=$1; shift
	;;
    @SML*)
	ARGS="$ARGS $arg"
	;;
    *)
	echo "makeml: unknown argument \"$arg\""
	exit 1
	;;
    esac
done

cd $BOOT_DIR

echo $LINK $RUN \
    @SMLboot=BOOTLIST @SMLheap=$here/$HEAP @SMLalloc=$ALLOC $ARGS $MODE
if $LINK $RUN \
    @SMLboot=BOOTLIST @SMLheap=$here/$HEAP @SMLalloc=$ALLOC $ARGS $MODE
then
#
# If this was a -rebuild run, we have to quit now...
#
    if [ $rebuilt = yes ] ; then
	echo New binfiles are ready.
	exit 0
    fi
    echo Heap image generated.
else
    echo Something broke.
    exit 1
fi

#
# Now move the libraries, generate the pathconfig file, and delete the bootdir.
#

cd $here
if [ $bare = no ] ; then
    LIB_DIR=`pwd`/${HEAP}.lib

    rm -rf $LIB_DIR
    mkdir $LIB_DIR

    cd $BOOT_DIR

    for i in init.cmi *.cm ; do
	link $i $LIB_DIR/$i
	echo $i $i
    done >$LIB_DIR/pathconfig

    cd $here
fi

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