#! /bin/ksh

# Script to build the XMerge project standalone

DEBUG=off
OPTIMIZE=off
case "`uname`" in
  SunOS*) INPATH=unxsols3.pro;;
  Linux*) INPATH=unxlngi3.pro;;
  *) INPATH=unx;;
esac

if (( $# < 2 )) 
then
	print "\nUsage: \tbuild_xmerge -jars <jar_location> [-debug | -optimize]\n"
	exit 1
fi


SOLARBIN=$2

if [[ $3 == "-debug" ]] 
then
  INPATH=${INPATH%.pro}
  DEBUG=on
  OPTIMIZE=off
elif [[ $3 == "-optimize" ]]
then
  DEBUG=off
  OPTIMIZE=on
fi


ant -Dsolar.bin=$SOLARBIN -Dinpath=$INPATH -Ddebug=$DEBUG -Doptimize=$OPTIMIZE
