#!/bin/sh
set -e

# Specify how we will call the Java compiler.
if [ -z "$JAVAC" ]; then
	JAVAC=/usr/bin/javac
fi

# Get basic information about the Java compiler.
compinfo=`/usr/share/jython/whichjavac "$JAVAC" --eval`
if ! eval "$compinfo"; then
	exit 1
fi

# Run jythonc.
export JAVAC
export JAVAC_BOOTSTRAP_CLASSES
export CALLED_FROM_JYTHONC=1
/usr/bin/jython /usr/share/jython/Tools/jythonc/jythonc.py "$@"
