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

EAPI="2"

inherit eutils

DESCRIPTION="Portable and efficient API to determine the call-chain of a program."
HOMEPAGE="http://savannah.nongnu.org/projects/libunwind"
SRC_URI="http://download.savannah.nongnu.org/releases/libunwind/${P}.tar.gz"
LICENSE="MIT"
SLOT="7"
KEYWORDS="~amd64 ~ia64 ~x86"
IUSE="cxx debug"

DEPEND=""
RDEPEND=""

# some tests have a problem with the sandbox
RESTRICT="test"

src_prepare() {
	epatch "${FILESDIR}/${PV}-implicit-declaration.patch"
}

src_configure() {
	econf \
		$(use_enable debug) \
		$(use_enable cxx cxx-exceptions) \
		--enable-debug-frame
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc AUTHORS ChangeLog NEWS README TODO
}