#! /bin/sh

# NOTES:
#   1)	The M4 setting is necessary because, by default, autoheader
#	tries to use /bin/m4 which is the wrong version.  By setting
#	it here, we don't let it use the default.
#   2)	The AFS_SYSNAME setting is necessary because the `fs sysname`
#	output on the engin machines is not the same as what Transarc
#	sets.  To find the AFS libraries, we have to use the hp700_ux90
#	name.
#   3)	The K4BASE, OPENSSLBASE, and RSAREFBASE settings are only needed
#	when using local builds of these components.  Since these haven't
#	been built in the x509 build area yet, setting these variables
#	helps configure find my local builds.

M4=/usr/um/gnu/bin/m4
AFS_SYSNAME=hp700_ux90
export M4 AFS_SYSNAME

K4BASE=/afs/umich.edu/group/itd/ifs/sandbox/kwc/krb5-1.0.5UM/hp7_1020/dest/krb5
OPENSSLBASE=/afs/umich.edu/group/itd/build/kwc/temp-checkout/openssl
RSAREFBASE=/afs/umich.edu/group/itd/build/kwc/temp-checkout/rsaref
export K4BASE OPENSSLBASE RSAREFBASE

PATH=/usr/um/bin:/usr/um/gnu/bin:/usr/itd/gnubin:/bin:/usr/vice/bin:/usr/afs/bin
export PATH
rm -rf hp7_1020 build
mkdir hp7_1020
ln -s @sys build

# if (cd src && \
# 	rm -f configure && \
# 	ln -s ../build/configure configure && \
# 	autoheader && \
# 	autoconf configure.in >../build/configure && \
# 	chmod a+rx ../build/configure \
# ); then

	cd build
#	CFLAGS='-g' ../src/configure --enable-srclinks --disable-server
	../src/configure --enable-srclinks --disable-server
	if [ -x /usr/um/gnu/bin/gmake ]; then
		/usr/um/gnu/bin/gmake
	elif [ -x /usr/um/gnu/bin/make ]; then
		/usr/um/gnu/bin/make
	else
		echo 'Could not find GNU make in /usr/um/gnu/bin as either make nor gmake'
	fi
fi
