1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic toolchain-funcs
8 if [[ ${PV} == "9999" ]] ; then
9 EGIT_REPO_URI="https://github.com/strace/strace.git"
10 inherit git-r3 autotools
12 SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz"
13 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
16 DESCRIPTION="A useful diagnostic, instructional, and debugging tool"
17 HOMEPAGE="https://strace.io/"
21 IUSE="aio perl static unwind elfutils"
23 REQUIRED_USE="?? ( unwind elfutils )"
26 unwind? ( sys-libs/libunwind[static-libs(+)] )
27 elfutils? ( dev-libs/elfutils[static-libs(+)] )
29 # strace only uses the header from libaio to decode structs
31 static? ( ${LIB_DEPEND} )
32 aio? ( >=dev-libs/libaio-0.3.106 )
33 sys-kernel/linux-headers
36 !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
37 perl? ( dev-lang/perl )
43 if [[ ! -e configure ]] ; then
45 sed /autoreconf/d -i bootstrap || die
48 [[ ! -e CREDITS ]] && cp CREDITS{.in,}
51 filter-lfs-flags # configure handles this sanely
52 # Add -pthread since strace wants -lrt for timer_create, and -lrt uses -lpthread.
53 use static && append-ldflags -static -pthread
55 export ac_cv_header_libaio_h=$(usex aio)
56 use elibc_musl && export ac_cv_header_stdc=no
58 # Stub out the -k test since it's known to be flaky. #545812
59 sed -i '1iexit 77' tests*/strace-k.test || die
63 # Set up the default build settings, and then use the names strace expects.
64 tc-export_build_env BUILD_{CC,CPP}
66 for v in CC CPP {C,CPP,LD}FLAGS ; do
68 export "${v}_FOR_BUILD=${!bv}"
71 # Don't require mpers support on non-multilib systems. #649560
73 --enable-mpers=check \
74 $(use_with unwind libunwind) \
75 $(use_with elfutils libdw)
79 if has usersandbox $FEATURES ; then
80 ewarn "Test suite is known to fail with FEATURES=usersandbox -- skipping ..." #643044
89 use perl || rm "${ED%/}"/usr/bin/strace-graph