#!/bin/sh

BINDIR="$0"
BINDIR=`whence $BINDIR` >/dev/null 2>&1
BINDIR=${BINDIR%/*}

MAIN_CLASS="sun.rmi.rmic.Main"

#
# If RMI-IIOP is installed, use the updated rmi classes
#
if [[ -r ${JAVA_HOME}/lib/iioptools.jar ]]
then
  CLASSPATH=${JAVA_HOME}/lib/iioptools.jar:${CLASSPATH}
  export CLASSPATH
  MAIN_CLASS="com.ibm.iioptools.$MAIN_CLASS"
fi

#
# source a script that extracts RUNTIME_ARGS and APP_ARGS
#
. $BINDIR/.extract_args

#
# Run the stub compiler
#
$BINDIR/java_g $RUNTIME_ARGS $MAIN_CLASS $APP_ARGS
