#! /bin/sh

# For OpenBSD, the server is not supported
CONFIGURE="../src/configure"
CONFIGURE_OPTIONS="--srcdir=../src --enable-srclinks --enable-server --with-rsaref=no --enable-krb5"


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

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

cd build

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