1SUMMARY = "Trace and analyze execution of a program written in C/C++, Rust and Python"
2HOMEPAGE = "https://github.com/namhyung/uftrace"
3BUGTRACKER = "https://github.com/namhyung/uftrace/issues"
4SECTION = "devel"
5LICENSE = "GPL-2.0-only"
6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
7
8DEPENDS = "elfutils"
9DEPENDS:append:libc-musl = " argp-standalone"
10
11inherit autotools
12
13SRCREV = "68aed9b0a20d3d1b5e1dc15e0f8aabba7e34735b"
14SRC_URI = "git://github.com/namhyung/${BPN};branch=master;protocol=https \
15           file://0001-include-libgen.h-for-basename.patch"
16S = "${WORKDIR}/git"
17
18LDFLAGS:append:libc-musl = " -largp"
19
20def set_target_arch(d):
21    import re
22    arch = d.getVar('TARGET_ARCH')
23    if re.match(r'i.86', arch, re.I):
24        return 'i386'
25    elif re.match('armeb', arch, re.I):
26        return 'arm'
27    else:
28        return arch
29
30EXTRA_UFTRACE_OECONF = "ARCH=${@set_target_arch(d)} \
31                        with_elfutils=/use/libelf/from/sysroot"
32
33do_configure() {
34    ${S}/configure ${EXTRA_UFTRACE_OECONF}
35}
36
37FILES_SOLIBSDEV = ""
38FILES:${PN} += "${libdir}/*.so"
39
40COMPATIBLE_HOST = "(i.86|x86_64|aarch64|arm|riscv64)"
41
42# uftrace supports armv6 and above
43COMPATIBLE_HOST:armv4 = 'null'
44COMPATIBLE_HOST:armv5 = 'null'
45