#!/bin/sh

JAVA=@JAVA@

working_dir=@CWD@

prefix=@prefix@
exec_prefix=${prefix}

#CL=xlC

#if [ -f ${working_dir}/src/include/ad++.h ]
#then 
#  $CL  -I${working_dir}/src/include -L${working_dir}/src/kernel -I/usr/local/include/ -L/usr/local/lib/rs6000/ch_p4 $* -ladlib -lmpi 
#else
#  $CL  -I${prefix}/include -L{exec_prefix}/lib -I/usr/local/include/ -L/usr/local/lib/rs6000/ch_p4 $* -ladlib -lmpi
#fi  

if [ $# -lt 1 ]
then
  echo "Usage: adjavac [ options ] files"
  exit 1
fi

CMD=

#if there is classpath
if [ $# -gt 1000 ]
then
until [ $# -eq 1 ]
do
  if [ $1 != -classpath ] 
  then 
    CMD="$CMD $1"
  else
    CMD="$CMD $1"
    shift
    CMD="$CMD .;$JAVA/class:$JAVA/lib/classes.zip:$ADLIB:$1"
    shift
  fi  
done
CMD="$CMD $1"
else
CMD="-classpath .;$JAVA/class:$JAVA/lib/classes.zip:/tmp_mnt/project/kyk20/pcrc/zgs/Project/java/Adlib/src/adJava $*"

fi

echo "$JAVA/bin/javac $CMD"
$JAVA/bin/javac $CMD
