--- /usr/portage/dev-libs/libgcrypt/libgcrypt-1.2.2-r1.ebuild 2006-12-28 12:35:44.000000000 +0100 +++ libgcrypt-1.2.2-r1.ebuild 2007-02-27 11:30:18.000000000 +0100 @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-libs/libgcrypt/libgcrypt-1.2.2-r1.ebuild,v 1.18 2006/12/28 11:32:04 grobian Exp $ -inherit eutils libtool +inherit eutils libtool toolchain-funcs DESCRIPTION="general purpose crypto library based on the code used in GnuPG" HOMEPAGE="http://www.gnupg.org/" @@ -27,6 +27,17 @@ cd "${S}" epatch "${WORKDIR}"/${PN}-1.2.1-ppc64-fix.patch + # cross compile fixes by impulze + if [[ "${CBUILD%%-*}" == x86_64 ]] && tc-is-cross-compiler ; then + sed -i -e \ + "s:\(LDADD = ../src/libgcrypt.la\):\1 @LTLIBOBJS@ @GPG_ERROR_LIBS@:g" \ + tests/Makefile.in || die "sed failed" + + sed -i -e \ + "s:\(LDADD = ../src/libgcrypt.la\):\1 @LTLIBOBJS@ @GPG_ERROR_LIBS@:g" \ + tests/Makefile.am || die "sed failed" + fi + # cd ${S} # epatch ${WORKDIR}/${PN}-1.2.1-GNU-stack-fix.patch @@ -36,10 +47,18 @@ src_compile() { local myconf - use ppc64 && myconf="${myconf} --disable-asm" + # cross compile patch by impulze + use ppc64 \ + || [[ "${CBUILD%%-*}" == x86_64 && tc-is-cross-compiler ]] && myconf="${myconf} --disable-asm" econf $(use_enable nls) --disable-dependency-tracking --with-pic \ --enable-noexecstack ${myconf} || die + + # cross compile patch by impulze + [[ "${CBUILD%%-*}" == x86_64 ]] && tc-is-cross-compiler && \ + epatch ${FILESDIR}/libtool-cross-compile.patch \ + || die "libtool-cross-compile patch failed" + emake || die }