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

inherit eutils autotools

DESCRIPTION="CyberLink for C++ is a development package for UPnP programmers."
HOMEPAGE="https://sourceforge.net/projects/clinkcc/"
SRC_URI="mirror://sourceforge/${PN}/clinkcc171.tar.gz"
LICENSE="BSD"

SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="expat libxml2 mythtv"
#RESTRICT="strip"
DEPEND="
	|| (
		expat? >=dev-libs/expat-1.95
		libxml2? >=dev-libs/libxml2-2.6.20
		>=dev-libs/xerces-c-2.3
	)
	virtual/libiconv
	virtual/libc
	mythtv? virtual/mysql
	"

RDEPEND="${DEPEND}"

S="${WORKDIR}/CyberLink/"

src_unpack() {
	unpack ${A}
	cd ${S}
	epatch "${FILESDIR}/gcc-41.patch"
	eautoreconf || die "Autoreconf failed"
}

src_compile() {
	econf $(use_enable expat) \
		$(use_enable libxml2) \
		$(use_enable mythtv) \
	|| die "econf failed"

	emake || die "emake failed"
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
}
