#!/bin/sh

JVM=@JVM@
JVMFLAGS=@JVMFLAGS@

# Set PATH to the jar needed by the print program
GUI_LIBDIR=@libbuild_dir@
GUI_HOME=${GUI_LIBDIR}/..
MAIN_LIB=${GUI_LIBDIR}/clog2print.jar


if [ -z "${GUI_LIBDIR}" -o "${GUI_LIBDIR}" = "/lib" ]; then
    echo "GUI_LIBDIR is NOT set!"
    exit 1
else
    echo "GUI_LIBDIR is set. GUI_LIBDIR = "${GUI_LIBDIR}
fi

if [ -z "`echo $JVMFLAGS | grep '\-Xms'`" ] ; then
    JVMFLAGS="-Xms32m $JVMFLAGS"
fi
if [ -z "`echo $JVMFLAGS | grep '\-Xmx'`" ] ; then
    JVMFLAGS="-Xmx96m $JVMFLAGS"
fi

${JVM} ${JVMFLAGS} -jar @JPATH_START@${MAIN_LIB}@JPATH_FINAL@ "$@"
