#! /bin/sh

# the relationship between cacao and boehm-gc is too tight
# for the OpenBSD ports CONFIGURE_STYLE= autoconf automake

echo "***********************************************************************************"
echo "*** Configuring boehm-gc and cacao ***"
pwd
echo "$@"
env|sort
set
echo "***********************************************************************************"

export PWD

export AUTOCONF_VERSION=2.59
export AUTOMAKE_VERSION=1.9

cd ${WRKSRC}

	set -x

	if test ! -d /usr/src/lib; then
		echo "***********************************************************************************"
		echo "$0: configure will fail without OpenBSD sources for libc and libpthread."
		echo "$0: You don't need all of the OpenBSD source; nor does it need to be compiled."
		echo "$0: You only need access to private include files in the correct relative positions."
		echo "$0: hint:"
		echo "$0: cd /usr; cvs -drepository co -P src/lib/libc"
		echo "$0: cd /usr; cvs -drepository co -P src/lib/libpthread"
		echo "***********************************************************************************"
	fi

	# boehm-gc source within cacao must be autoconf'd and automake'd first

	cd src/boehm-gc
	pwd
	autoconf
	automake

	# cacao itself must be autoconf'd and automake'd second

	cd ../..
	pwd
	autoconf
	automake
