--- autogen-5.18.1.ebuild.orig 2013-12-02 10:18:43.000000000 +0000 +++ autogen-5.18.1.ebuild 2014-01-13 22:09:12.000000000 +0000 @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-devel/autogen/autogen-5.18.1.ebuild,v 1.1 2013/12/02 10:18:43 radhermit Exp $ -EAPI="4" +EAPI="5-hdepend" inherit eutils @@ -13,21 +13,42 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos" -IUSE="libopts static-libs" +IUSE="libopts static-libs targetroot" RDEPEND=">=dev-scheme/guile-1.8 dev-libs/libxml2" DEPEND="${RDEPEND}" +HDEPEND="targetroot? ( ${CATEGORY}/${PN} )" src_configure() { # suppress possibly incorrect -R flag export ag_cv_test_ldflags= econf $(use_enable static-libs static) + + if use targetroot; then + # Cross-compile with host autogen. + sed -i "s:PROG=\./:PROG=:" autoopts/tpl/agtexi-cmd.tpl || die + fi +} + +src_compile() { + if use targetroot; then + # Cross-compile with host autogen. Absolute paths required. + emake AGexe="$(which autogen)" CLexe="$(which columns)" GDexe="$(which getdefs)" + else + default + fi } src_install() { - default + if use targetroot; then + # Cross-compile with host autogen. Absolute paths required. + emake AGexe="$(which autogen)" CLexe="$(which columns)" GDexe="$(which getdefs)" DESTDIR="${D}" install + else + default + fi + prune_libtool_files if ! use libopts ; then