SUMMARY="The Boehm-Demers-Weiser conservative garbage collector"
DESCRIPTION="
The Boehm-Demers-Weiser conservative garbage collector can be used as a \
garbage collecting replacement for C malloc or C++ new. It allows you to \
allocate memory basically as you normally would, without explicitly \
deallocating memory that is no longer useful. The collector automatically \
recycles memory when it determines that it can no longer be otherwise accessed.
"
HOMEPAGE="http://www.hboehm.info/gc/"
SOURCE_URI="http://www.hboehm.info/gc/gc_source/gc-7.2d.tar.gz"
CHECKSUM_SHA256="d9fe0ae8650d43746a48bfb394cab01a319f3809cee19f8ebd16aa985b511c5e"
REVISION="2"
ARCHITECTURES="x86 x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="x86 x86_gcc2"
SOURCE_DIR="gc-7.2"

PATCHES="boehm_gc-7.2d.patch"

PROVIDES="
	boehm_gc$secondaryArchSuffix = $portVersion compat >= 7
	lib:libgc$secondaryArchSuffix = $portVersion compat >= 7
	lib:libcord$secondaryArchSuffix = $portVersion compat >= 7
	"

REQUIRES="
	haiku$secondaryArchSuffix
	"

BUILD_REQUIRES=""

BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:libtoolize
	cmd:autoconf
	cmd:make
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	"

BUILD()
{
	libtoolize --force --copy --install
	autoconf -f
	runConfigure ./configure --enable-threads=posix \
		--enable-thread-local-alloc --enable-parallel-mark
	make
}

INSTALL()
{
	make install
	prepareInstalledDevelLibs libgc libcord
	fixPkgconfig
	packageEntries devel $developDir
}

TEST()
{
	make check
}

PROVIDES_devel="
	boehm_gc${secondaryArchSuffix}_devel = $portVersion compat >= 7
	devel:libgc${secondaryArchSuffix} = $portVersion compat >= 7
	devel:libcord${secondaryArchSuffix} = $portVersion compat >= 7
	"

REQUIRES_devel="
	boehm_gc${secondaryArchSuffix} == $portVersion base
	"

LICENSE="BOEHM"
COPYRIGHT="1988, 1989 Hans-J. Boehm, Alan J. Demers
	1991-1996 by Xerox Corporation.  All rights reserved.
	1996-1999 by Silicon Graphics.  All rights reserved.
	1999-2011 Hewlett-Packard Development Company, L.P."
