description="A garbage collector for C and C++"
url="http://www.hpl.hp.com/personal/Hans_Boehm/gc/"

packager="tnut <tnut@nutyx.org>"
contributors="Pierre B"

makedepends=(libatomic-ops)

name=gc
version=8.0.4
release=2

source=(http://www.hboehm.info/gc/gc_source/gc-$version.tar.gz)

build() {
cd gc-*
sed -i 's#pkgdata#doc#' doc/doc.am && autoreconf &&
./configure --prefix=/usr \
--enable-threads=pthreads \
--disable-static \
--enable-shared \
--enable-cplusplus
install -D -m 644 doc/gc.man $PKG/usr/share/man/man3/gc_malloc.3
make
make DESTDIR=$PKG install
# rm obsolets libs
rm $PKG/usr/lib/lib{gc{,cpp},cord}.la
}
uptodate() {
local url ext
url="http://www.hboehm.info/gc/gc_source/"
ext=".tar.gz"
lynx -read_timeout=20 -dump -listonly -nonumbers \
$url?C=M\;O=A|grep $name-[0-9]|grep [0-9]$ext$| \
sed "s@$url$name-@@"|sed "s@$ext@@"|tail -1
}
