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 515 - (download) (annotate)
Sun Jan 9 09:59:14 2000 UTC (19 years, 9 months ago) by blume
File size: 3228 byte(s)
pickler bug fixes; some cosmetic changes
#!/bin/sh
#

ARCH=sparc
OPSYS=solaris
RUN_DIR=../../bin/.run
OBJS_DIR=../runtime/objs
HEAP_IMAGE=""
RUN=""
RUN_ARGS=""
MODE=""
BOOT_DIR=""
rebuilt=no
bare=no

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

here=`pwd`
cd ../..
CM_PATHCONFIG_DEFAULT=`pwd`/lib/pathconfig
cd $here
export CM_PATHCONFIG_DEFAULT

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

#
# Allocation size: This snippet should be kept consistent with that
#     in config/install.sh
#
case $ARCH in
  mips*) ALLOC=1M ;;
  x86)
    ALLOC=256k
  ;;
  alpha32)
    ALLOC=512k
  ;;
  *)
    ALLOC=512k
  ;;
esac

while [ "$#" != "0" ]
do
  arg=$1; shift
  case $arg in
    -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
	;;
    -arch)
	if [ "$#" = "0" ]; then
	    echo "makeml: missing argument for \"-arch\" option"
	    exit 1
	fi
	ARCH=$1; shift
	;;
    -opsys)
	if [ "$#" = "0" ]; then
	    echo "makeml: missing argument for \"-opsys\" option"
	    exit 1
	fi
	OPSYS=$1; shift
	;;
    -o)
	if [ "$#" = "0" ]; then
	    echo "makeml: missing argument for \"-o\" option"
	    exit 1
	fi
	HEAP_IMAGE=$1; shift
	;;
    -run)
	if [ "$#" = "0" ]; then
	    echo "makeml: missing argument for \"-run\" option"
	    exit 1
	fi
	RUN=$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*)
	RUN_ARGS="$RUN_ARGS $arg"
	;;
    *)
	echo "makeml: unknown argument \"$arg\""
	exit 1
	;;
    esac
done

if [ x"$RUN" = x ]; then
  if [ x"$OPSYS" = xwin32 ]; then
    RUN_CMD="run.$ARCH-$OPSYS.exe"
  else
    RUN_CMD="run.$ARCH-$OPSYS"
  fi
  if [ -x "$RUN_DIR/$RUN_CMD" ]; then
    RUN="$RUN_DIR/$RUN_CMD"
  elif [ -x "$OBJS_DIR/$RUN_CMD" ]; then
    RUN="$OBJS_DIR/$RUN_CMD"
  else
    echo "makeml: unable to find run-time system \"$RUN_CMD\""
    exit 1
  fi
fi

if [ x"$HEAP_IMAGE" = x ]; then
  HEAP_IMAGE="sml"
fi

if [ x"$BOOT_DIR" = x ]; then
  BOOT_DIR="./sml.boot.$ARCH-unix"
fi

echo "$RUN @SMLboot=$BOOT_DIR @SMLrtpid=`cat $BOOT_DIR/RTPID` \
	@SMLheap=$HEAP_IMAGE @SMLalloc=$ALLOC $RUN_ARGS $MODE"

if $RUN @SMLboot=$BOOT_DIR @SMLrtpid=`cat $BOOT_DIR/RTPID` \
	@SMLheap=$HEAP_IMAGE @SMLalloc=$ALLOC $RUN_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.
#

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

    rm -rf $LIB_DIR
    mkdir $LIB_DIR

    cd $BOOT_DIR

    for i in *.cm ; do
	mv $i $LIB_DIR/$i
	echo $i $i
    done >$LIB_DIR/pathconfig

    cd ..
    rm -r $BOOT_DIR
fi

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