1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils flag-o-matic multilib-minimal
9 DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
10 HOMEPAGE="https://fedorahosted.org/elfutils/"
11 SRC_URI="https://fedorahosted.org/releases/e/l/${PN}/${PV}/${P}.tar.bz2"
13 LICENSE="GPL-2-with-exceptions"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
16 IUSE="bzip2 lzma nls static-libs test +threads +utils"
18 # This pkg does not actually seem to compile currently in a uClibc
19 # environment (xrealloc errs), but we need to ensure that glibc never
20 # gets pulled in as a dep since this package does not respect virtual/libc
21 RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
22 bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
23 lzma? ( >=app-arch/xz-utils-5.0.5-r1[${MULTILIB_USEDEP}] )
26 !<=app-emulation/emul-linux-x86-baselibs-20130224-r11
27 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
29 # We need to require a newer glibc for its elf.h defs. #571814
32 nls? ( sys-devel/gettext )
33 >=sys-devel/flex-2.5.4a
37 epatch "${FILESDIR}"/${PN}-0.118-PaX-support.patch
38 use static-libs || sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in
39 sed -i 's:-Werror::' */Makefile.in
40 # some patches touch both configure and configure.ac
41 find -type f -exec touch -r configure {} +
45 use test && append-flags -g #407135
46 multilib-minimal_src_configure
49 multilib_src_configure() {
50 ECONF_SOURCE="${S}" econf \
52 $(use_enable threads thread-safety) \
53 --program-prefix="eu-" \
55 $(use_with bzip2 bzlib) \
60 env LD_LIBRARY_PATH="${BUILD_DIR}/libelf:${BUILD_DIR}/libebl:${BUILD_DIR}/libdw:${BUILD_DIR}/libasm" \
65 multilib_src_install_all() {
68 # These build quick, and are needed for most tests, so don't
69 # disable their building when the USE flag is disabled.
70 use utils || rm -rf "${ED}"/usr/bin