--- libnet-1.0.2a-r3.ebuild 2009-06-30 00:37:12.000000000 +0200 +++ libnet-1.0.2a-r4.ebuild 2009-06-30 00:31:03.000000000 +0200 @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-libs/libnet/libnet-1.0.2a-r3.ebuild,v 1.18 2009/05/25 23:41:56 jer Exp $ -inherit eutils autotools +inherit eutils autotools toolchain-funcs flag-o-matic DESCRIPTION="library to provide an API for commonly used low-level network functions (mainly packet injection)" HOMEPAGE="http://www.packetfactory.net/libnet/" @@ -35,6 +35,19 @@ src_compile() { econf || die + + local endianness="$(tc-endian)" + case "${endianness}" in + "little") + append-flags "-DLIBNET_LIL_ENDIAN" + ;; + "big") + append-flags "-DLIBNET_BIG_ENDIAN" + ;; + *) + # best effort + ;; + esac emake CFLAGS="${CFLAGS}" || die "Failed to compile" }