Line 0
Link Here
|
0 |
- |
1 |
# Copyright 2005-2019 Gentoo Authors |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
4 |
EAPI="7" |
5 |
|
6 |
MY_PV=${PV/_/-} |
7 |
MY_P=${PN}-${MY_PV} |
8 |
|
9 |
inherit autotools libtool multilib multilib-minimal usr-ldscript |
10 |
|
11 |
DESCRIPTION="Portable and efficient API to determine the call-chain of a program" |
12 |
HOMEPAGE="https://savannah.nongnu.org/projects/libunwind" |
13 |
SRC_URI="mirror://nongnu/libunwind/${MY_P}.tar.gz" |
14 |
|
15 |
LICENSE="MIT" |
16 |
SLOT="0/8" |
17 |
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv -sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" |
18 |
IUSE="debug debug-frame doc libatomic lzma +static-libs" |
19 |
|
20 |
RESTRICT="test" # half of tests are broken (toolchain version dependent) |
21 |
|
22 |
# We just use the header from libatomic. |
23 |
RDEPEND="lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] )" |
24 |
DEPEND="${RDEPEND} |
25 |
libatomic? ( dev-libs/libatomic_ops[${MULTILIB_USEDEP}] )" |
26 |
RDEPEND+=" |
27 |
!${CATEGORY}/${PN}:7 |
28 |
!<sys-devel/gcc-config-2.1" |
29 |
|
30 |
S="${WORKDIR}/${MY_P}" |
31 |
|
32 |
MULTILIB_WRAPPED_HEADERS=( |
33 |
/usr/include/libunwind.h |
34 |
|
35 |
# see libunwind.h for the full list of arch-specific headers |
36 |
/usr/include/libunwind-aarch64.h |
37 |
/usr/include/libunwind-arm.h |
38 |
/usr/include/libunwind-hppa.h |
39 |
/usr/include/libunwind-ia64.h |
40 |
/usr/include/libunwind-mips.h |
41 |
/usr/include/libunwind-ppc32.h |
42 |
/usr/include/libunwind-ppc64.h |
43 |
/usr/include/libunwind-sh.h |
44 |
/usr/include/libunwind-tilegx.h |
45 |
/usr/include/libunwind-x86.h |
46 |
/usr/include/libunwind-x86_64.h |
47 |
) |
48 |
|
49 |
PATCHES=( |
50 |
"${FILESDIR}"/${PN}-1.2-coredump-regs.patch #586092 |
51 |
"${FILESDIR}"/${PN}-1.2-ia64-undwarf.patch |
52 |
"${FILESDIR}"/${PN}-1.2-ia64-ptrace-coredump.patch |
53 |
"${FILESDIR}"/${PN}-1.2-ia64-missing.patch |
54 |
"${FILESDIR}"/${PN}-1.2.1-fix_version_macros.patch |
55 |
"${FILESDIR}"/${PN}-1.2.1-only-include-execinfo_h-if-avaliable.patch |
56 |
"${FILESDIR}"/${PN}-1.2.1-no-PROTECTED.patch #659732 |
57 |
"${FILESDIR}"/${PN}-1.2.1-arm-__asm__.patch #635674 |
58 |
) |
59 |
|
60 |
src_prepare() { |
61 |
default |
62 |
chmod +x src/ia64/mk_cursor_i || die |
63 |
# Since we have tests disabled via RESTRICT, disable building in the subdir |
64 |
# entirely. This worksaround some build errors too. #484846 |
65 |
sed -i -e '/^SUBDIRS/s:tests::' Makefile.in || die |
66 |
|
67 |
elibtoolize |
68 |
eautoreconf |
69 |
} |
70 |
|
71 |
multilib_src_configure() { |
72 |
# --enable-cxx-exceptions: always enable it, headers provide the interface |
73 |
# and on some archs it is disabled by default causing a mismatch between the |
74 |
# API and the ABI, bug #418253 |
75 |
# conservative-checks: validate memory addresses before use; as of 1.0.1, |
76 |
# only x86_64 supports this, yet may be useful for debugging, couple it with |
77 |
# debug useflag. |
78 |
ECONF_SOURCE="${S}" \ |
79 |
ac_cv_header_atomic_ops_h=$(usex libatomic) \ |
80 |
econf \ |
81 |
--enable-cxx-exceptions \ |
82 |
--enable-coredump \ |
83 |
--enable-ptrace \ |
84 |
--enable-setjmp \ |
85 |
$(use_enable debug-frame) \ |
86 |
$(use_enable doc documentation) \ |
87 |
$(use_enable lzma minidebuginfo) \ |
88 |
$(use_enable static-libs static) \ |
89 |
$(use_enable debug conservative_checks) \ |
90 |
$(use_enable debug) |
91 |
} |
92 |
|
93 |
multilib_src_compile() { |
94 |
# Bug 586208 |
95 |
CCACHE_NODIRECT=1 default |
96 |
} |
97 |
|
98 |
multilib_src_test() { |
99 |
# Explicitly allow parallel build of tests. |
100 |
# Sandbox causes some tests to freak out. |
101 |
SANDBOX_ON=0 emake check |
102 |
} |
103 |
|
104 |
multilib_src_install() { |
105 |
default |
106 |
|
107 |
pushd "${ED}/usr/$(get_libdir)" > /dev/null || die |
108 |
( |
109 |
shopt -s extglob |
110 |
# Names of libraries are architecture-specific. |
111 |
# libunwind-generic should be skipped. |
112 |
eval "local libraries=(libunwind!(-generic)$(get_libname))" |
113 |
libraries=("${libraries[@]#lib}") |
114 |
libraries=("${libraries[@]%$(get_libname)}") |
115 |
gen_usr_ldscript -a "${libraries[@]}" |
116 |
) |
117 |
popd > /dev/null || die |
118 |
|
119 |
if ! use static-libs; then |
120 |
# Obsolete after http://git.savannah.gnu.org/gitweb/?p=libunwind.git;a=commitdiff;h=4e8b7a595e144e905fd9c8aed053d7529afb78a4 |
121 |
rm "${ED}/usr/$(get_libdir)/libunwind-generic.a" || die |
122 |
fi |
123 |
} |
124 |
|
125 |
multilib_src_install_all() { |
126 |
find "${D}" -name "*.la" -type f -delete || die |
127 |
} |