summaryrefslogtreecommitdiff
blob: a71ebbaaca7d8b082cd4c1504af13f1c8ac2dc4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit autotools multilib-minimal toolchain-funcs

DESCRIPTION="ELF object file access library"
HOMEPAGE="
	https://directory.fsf.org/wiki/Libelf
	https://web.archive.org/web/20190203164512/http://www.mr511.de/software/
"
SRC_URI="http://www.mr511.de/software/${P}.tar.gz"

LICENSE="LGPL-2+"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~mips ppc ppc64 sparc x86 ~x64-solaris"
IUSE="debug nls"

RDEPEND="!dev-libs/elfutils"
DEPEND="${RDEPEND}"
BDEPEND="nls? ( sys-devel/gettext )"

DOCS=( ChangeLog README )

MULTILIB_WRAPPED_HEADERS=( /usr/include/libelf/sys_elf.h )

PATCHES=(
	"${FILESDIR}/${P}-build.patch"
)

src_prepare() {
	default

	eautoreconf
}

multilib_src_configure() {
	# prefix might want to play with this; unfortunately the stupid
	# macro used to detect whether we're building ELF is so screwed up
	# that trying to fix it is just a waste of time.
	export mr_cv_target_elf=yes

	ECONF_SOURCE="${S}" econf \
		$(use_enable nls) \
		--enable-shared \
		$(use_enable debug)
}

multilib_src_compile() {
	emake AR="$(tc-getAR)"
}

multilib_src_install() {
	emake \
		prefix="${ED}/usr" \
		libdir="${ED}/usr/$(get_libdir)" \
		install \
		install-compat \
		-j1

	find "${D}" -name '*.la' -o -name '*.a' -delete || die
}