1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 MY_P="gperftools-${PV}"
7 inherit toolchain-funcs flag-o-matic vcs-snapshot autotools multilib-minimal
9 DESCRIPTION="Fast, multi-threaded malloc() and nifty performance analysis tools"
10 HOMEPAGE="https://github.com/gperftools/gperftools"
11 SRC_URI="https://github.com/gperftools/gperftools/tarball/${MY_P} -> ${MY_P}.tar.gz"
15 # contains ASM code, with support for
17 # linux x86/amd64/ppc/ppc64/arm
20 KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
21 IUSE="largepages +debug minimal optimisememory test static-libs"
23 DEPEND="sys-libs/libunwind"
26 S="${WORKDIR}/${MY_P}"
31 # set up the make options in here so that we can actually make use
32 # of them on both compile and install.
34 # Avoid building the unit testing if we're not going to execute
35 # tests; this trick here allows us to ignore the tests without
36 # touching the build system (and thus without rebuilding
37 # autotools). Keep commented as long as it's restricted.
39 MAKEOPTS+=" noinst_PROGRAMS= "
48 multilib_src_configure() {
49 use largepages && append-cppflags -DTCMALLOC_LARGE_PAGES
50 use optimisememory && append-cppflags -DTCMALLOC_SMALL_BUT_SLOW
51 append-flags -fno-strict-aliasing -fno-omit-frame-pointer
54 --htmldir=${EPREFIX}/usr/share/doc/${PF}/html \
55 --docdir=${EPREFIX}/usr/share/doc/${PF} \
57 $(use_enable static-libs static) \
58 $(use_enable debug debugalloc) \
59 $(if [[ ${ABI} == x32 ]]; then printf "--enable-minimal\n" else use_enable minimal; fi)
63 case "${LD_PRELOAD}" in
65 ewarn "Unable to run tests when sandbox is enabled."
66 ewarn "See https://bugs.gentoo.org/290249"
71 multilib-minimal_src_test
75 if ! use minimal && has x32 ${MULTILIB_ABIS}; then
76 MULTILIB_WRAPPED_HEADERS=(
77 /usr/include/gperftools/heap-checker.h
78 /usr/include/gperftools/heap-profiler.h
79 /usr/include/gperftools/stacktrace.h
80 /usr/include/gperftools/profiler.h
84 multilib-minimal_src_install