#!/bin/sh

# Copyright (c) 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.

if [ ! -x ${J2SE14}/bin/javac -o ! -r ${J2SE14}/jre/lib/rt.jar ]; then
    echo '${J2SE14} does not point to a working J2SE 1.4.2 installation.'
    exit 1
fi

if [ ! -r ${JSR14DISTR}/gjc-rt.jar -o ! -r ${JSR14DISTR}/collect.jar ]; then
    echo '${JSR14DISTR} does not point to a JSR14 distribution.'
    exit 1
fi

if [ ! "$*" ]; then
    # if no arguments, print usage
    exec ${J2SE14}/bin/javac -J-Xbootclasspath/p:${JSR14DISTR}/gjc-rt.jar
fi

exec ${J2SE14}/bin/javac -J-Xbootclasspath/p:${JSR14DISTR}/gjc-rt.jar -bootclasspath ${JSR14DISTR}/collect.jar:${J2SE14}/jre/lib/rt.jar -source 1.5 "$@"
