#! /bin/sh

# For OpenBSD, the server is not supported
SSL_AREA=/afs/citi.umich.edu/machdep/i386_obsd28/usr
CONFIGURE="../src/configure"
CONFIGURE_OPTIONS="--srcdir=../src --enable-srclinks --disable-server --with-rsaref=no --with-ssl=${SSL_AREA} --enable-krb5"
#CONFIGURE_OPTIONS="--srcdir=../src --enable-srclinks --disable-server --with-rsaref=no --with-ssl=${SSL_AREA} --enable-krb5=no"

# Remove any existing directories and re-create them
rm -rf i386_obsd28 build
mkdir i386_obsd28
ln -s @sys build

if [ "$1" = "--autoconf" ]; then
	(cd src; \
		autoheader ; \
		rm -f configure; \
		/usr/local/bin/autoconf configure.in >configure; \
		chmod a+rx configure \
	)
fi

cd build

echo "${CONFIGURE} ${CONFIGURE_OPTIONS}"
${CONFIGURE} ${CONFIGURE_OPTIONS}
gmake
