#! /bin/sh
# We use kjc compiler rather than Sun's.
prefix=/opt/kaffe
exec_prefix=${prefix}
lib_path=/opt/kaffe

# Ensure that /usr/lib/rt.jar is in the classpath. 
for opt in ${1+"$@"}; do 
    if [ "x$classpath" = "xtrue" ]; then
        classpath=$opt
        continue
    fi
    if [ $opt = "-classpath" ]; then
        classpath="true"
        continue
    fi
    args="${args} $opt"
done
if [ "x$classpath" != "x" ]; then
    echo $classpath | grep -q ${lib_path}/rt.jar
    if [ $? -eq 1 ]; then
        classpath=${lib_path}/rt.jar:${classpath}
    fi
    args="${args} -classpath $classpath"
fi

exec ${exec_prefix}/bin/kaffe at.dms.kjc.Main $args

