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/system/fixpt
ViewVC logotype

View of /sml/trunk/system/fixpt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 577 - (download) (annotate)
Fri Mar 10 08:07:18 2000 UTC (19 years, 5 months ago) by blume
Original Path: sml/trunk/src/system/fixpt
File size: 1971 byte(s)
improved version of Dave's fixpt script added
#!/bin/sh

# fixpt
#  - to be run in src/system to iterate compilation to a fixed point
#  - assumes no sml.boot... directory in src/system (but uses it if it
#    is there and the base is set to "sml" -- which is the default)
#  - assumes that ../../bin/sml and ../../bin/.arch-n-opsys have been installed

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

SML=$twoup/bin/sml
ARCH=sparc

#
# 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

BIN=.bin.$ARCH-unix
BOOT=.boot.$ARCH-unix
ITER=3
BASE=sml

#
# Function to do one round of compilation to get the initial set of binfiles.
# (The funky ML comment is there to un-confuse emacs fontlock mode. :)
#
initcompile() {
$SML smlnj/cmb.cm <<EOF
local open OS.Process CMB in
   val _ = exit (if make' (SOME "$BASE") then success else failure) (* ' *)
end
EOF
}

#
# Parse command line
#
while [ "$#" != 0 ] ; do
    arg=$1; shift
    case $arg in
    -iter)
	if [ "$#" = 0 ] ; then
	    echo "$this: missing argument for \"-iter\" option"
	    exit 2
	fi
	ITER=$1; shift
	;;
    -base)
	if [ "$#" = 0 ] ; then
	    echo "$this: missing argument for \"-base\" option"
	    exit 2
	fi
	BASE=$1; shift
	;;
    *)
	echo "$this: unknown argument \"$arg\""
	exit 2
	;;
    esac
done

iter=0
iterbase=$BASE

if initcompile ; then
    while [ $iter -lt $ITER ] ; do
	prev=$iter
	prevbase=$iterbase
	iter=`expr $iter + 1`
	iterbase=$BASE$iter
	if ./makeml -boot $prevbase$BOOT -rebuild $iterbase ; then
	    if diff -r $prevbase$BIN $iterbase$BIN >/dev/null 2>&1 ; then
		echo "$this: fixpoint reached in round $iter"
		exit 0
	    fi
	else
	    echo "$this: compilation failed in round $iter"
	    exit 3
	fi
    done
else
    echo "$this: initial compilation failed"
    exit 3
fi

echo "$this: no fixpoint reached after $iter rounds"
exit 1

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