--- /home/flame/devel/gentoo-x86/sys-devel/libtool/libtool-1.5.22.ebuild 2006-12-08 20:24:35.985449278 +0100 +++ cross-arm-carel-linux-gnu/libtool/libtool-1.5.22.ebuild 2006-12-13 20:23:26.583810607 +0100 @@ -127,11 +127,31 @@ src_compile() { lt_setup - econf || die + local myconf + + if [[ ${CATEGORY/cross-/} != ${CATEGORY} ]]; then + local ctarget=${CATEGORY/cross-/} + myconf="--program-prefix=${ctarget}- --disable-ltdl-install --build=${CHOST} --host=${ctarget} --target=${ctarget}" + + # We won't build any C code, so just ignore these + unset CFLAGS LDFLAGS + fi + + econf ${myconf} || die emake || die } src_install() { + # When building for crosscompiling we care only about + # the libtool script (that has the defaults of the cross + # compiler rather than system's + if [[ ${CATEGORY/cross-/} != ${CATEGORY} ]]; then + local ctarget=${CATEGORY/cross-/} + newbin libtool ${ctarget}-libtool + + return 0 + fi + make DESTDIR="${D}" install || die dodoc AUTHORS ChangeLog* NEWS README THANKS TODO doc/PLATFORMS