# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header$

inherit eutils

MY_VERSION=${PV/_}
MY_P=ac-woven-${MY_VERSION}

DESCRIPTION="AspectC++ is an AOP extension to C++"
SRC_URI="http://www.aspectc.org/fileadmin/downloads/ac/${MY_VERSION}/${MY_P}.tar.gz"
HOMEPAGE="http://www.aspectc.org/"
RDEPEND="dev-libs/libxml2"
DEPEND="${RDEPEND}"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="x86"
IUSE=""

S="${WORKDIR}/${MY_P}"

src_unpack() {
	unpack "${A}"

	# allow parallel makes in all subdirectories
	epatch "${FILESDIR}"/Makefile-jobserver.diff
}

src_compile() {
	unset ROOT
	emake -C Puma/ compile       || die "emake failed"
	emake -C AspectC++/ SHARED=1 || die "emake failed"
	emake -C Ag++/      SHARED=1 || die "emake failed"
}

src_install() {
	dobin Ag++/bin/linux-release/ag++
	dobin AspectC++/bin/linux-release/ac++

	dodoc ChangeLog
	cp -r AspectC++/examples "${D}/usr/share/doc/${PF}/"
}