INSTALL_HOME=
if [ $# -gt 0 ]; then
	INSTALL_HOME=$1
fi

if [ "$INSTALL_HOME"X == "X" ]; then
	INSTALL_HOME=$HOME/CUnitHome
fi

aclocal && \
automake --add-missing --include-deps --copy && \
autoconf

if [ $? -ne 0 ]; then
	echo "Automake/Autoconf returned with error."
	exit 1
fi

mkdir -p $INSTALL_HOME
if [ $# -gt 0 ]; then
	./configure --srcdir=`pwd` --prefix=$INSTALL_HOME --enable-debug --enable-automated
else
	./configure --srcdir=`pwd` --prefix=$INSTALL_HOME --enable-debug --enable-memtrace --enable-automated
fi
