summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/uftrace/uftrace_0.18.bb
blob: 7ba2dcadc96338611373428ce14d588e9fe9102f (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
SUMMARY = "Trace and analyze execution of a program written in C/C++, Rust and Python"
HOMEPAGE = "https://github.com/namhyung/uftrace"
BUGTRACKER = "https://github.com/namhyung/uftrace/issues"
SECTION = "devel"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

DEPENDS = "elfutils"
DEPENDS:append:libc-musl = " argp-standalone"

SRCREV = "8ccd4f627569b0af122c8d1df98dc6813ab97a40"
SRC_URI = "git://github.com/namhyung/${BPN};branch=master;protocol=https;tag=v${PV} \
           file://0001-include-libgen.h-for-basename.patch \
           file://0001-build-Fix-a-build-error-on-i386.patch \
          "

LDFLAGS:append:libc-musl = " -largp"

def set_target_arch(d):
    import re
    arch = d.getVar('TARGET_ARCH')
    if re.match(r'i.86', arch, re.I):
        return 'i386'
    elif re.match('armeb', arch, re.I):
        return 'arm'
    else:
        return arch


do_configure() {
    ${S}/configure --prefix=${prefix} \
    --objdir=${B} \
    --cflags='${CFLAGS}' \
    --ldflags='${LDFLAGS}' \
    --arch='${@set_target_arch(d)}' \
    --with-elfutils=${STAGING_EXECPREFIXDIR}
}

do_compile() {
    oe_runmake V=1
}

do_install() {
    oe_runmake DESTDIR=${D}
}

FILES_SOLIBSDEV = ""
FILES:${PN} += "${libdir}/*.so"

COMPATIBLE_HOST = "(i.86|x86_64|aarch64|arm|riscv64)"

# uftrace supports armv6 and above
COMPATIBLE_HOST:armv4 = 'null'
COMPATIBLE_HOST:armv5 = 'null'