blob: df499fbe50b76ca86b957cb7e1507ef442b79b11 [file] [log] [blame]
Patrick Williams213cb262021-08-07 19:21:33 -05001# Copyright (C) 2021 Mingli Yu <mingli.yu@windriver.com>
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4SUMMARY = "General-purpose scalable concurrent malloc implementation"
5
6DESCRIPTION = "jemalloc is a general purpose malloc(3) implementation that emphasizes \
7fragmentation avoidance and scalable concurrency support."
8
9HOMEPAGE = "https://github.com/jemalloc/jemalloc"
Andrew Geissler5199d832021-09-24 16:47:35 -050010LICENSE = "BSD-2-Clause"
Patrick Williams213cb262021-08-07 19:21:33 -050011
12SECTION = "libs"
13
Andrew Geissler595f6302022-01-24 19:11:47 +000014LIC_FILES_CHKSUM = "file://COPYING;md5=ea061f8731d5e6a5761dfad951ef5f5f"
Patrick Williams213cb262021-08-07 19:21:33 -050015
Andrew Geissler595f6302022-01-24 19:11:47 +000016SRC_URI = "git://github.com/jemalloc/jemalloc.git;branch=master;protocol=https \
Patrick Williams0ca19cc2021-08-16 14:03:13 -050017 file://run-ptest \
Andrew Geisslerd5838332022-05-27 11:33:10 -050018 "
Andrew Geisslerd5838332022-05-27 11:33:10 -050019SRCREV = "54eaed1d8b56b1aa528be3bdd1877e59c56fa90c"
Patrick Williams213cb262021-08-07 19:21:33 -050020
21S = "${WORKDIR}/git"
22
Patrick Williams0ca19cc2021-08-16 14:03:13 -050023inherit autotools ptest
Patrick Williams213cb262021-08-07 19:21:33 -050024
25EXTRA_AUTORECONF += "--exclude=autoheader"
26
27EXTRA_OECONF:append:libc-musl = " --with-jemalloc-prefix=je_"
Andrew Geissler5082cc72023-09-11 08:41:39 -040028# For some reason VERSION file populated only in tarball distribution.
29# Adding jemalloc version since this recipe is using source code from git tag
30EXTRA_OECONF:append = " --with-version=${PV}-0-g${SRCREV}"
Patrick Williams0ca19cc2021-08-16 14:03:13 -050031
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050032do_install:append() {
33 sed -i -e 's@${STAGING_DIR_HOST}@@g' \
34 -e 's@${STAGING_DIR_NATIVE}@@g' \
35 -e 's@${WORKDIR}@@g' ${D}${bindir}/jemalloc-config
36}
37
Patrick Williams0ca19cc2021-08-16 14:03:13 -050038do_compile_ptest() {
39 oe_runmake tests
40}
41
42do_install_ptest() {
43 install -d ${D}${PTEST_PATH}/tests
Patrick Williams8e7b46e2023-05-01 14:19:06 -050044 subdirs="unit integration stress "
Patrick Williams0ca19cc2021-08-16 14:03:13 -050045 for tooltest in ${subdirs}
46 do
Patrick Williams8e7b46e2023-05-01 14:19:06 -050047 cp -r ${B}/test/${tooltest} ${D}${PTEST_PATH}/tests
48 if find ${S}/test/${tooltest}/ -name '*.sh' -print -quit | grep -q .; then
49 cp ${S}/test/${tooltest}/*.sh ${D}${PTEST_PATH}/tests/${tooltest}
50 fi
Patrick Williams0ca19cc2021-08-16 14:03:13 -050051 done
52 find ${D}${PTEST_PATH}/tests \( -name "*.d" -o -name "*.o" \) -exec rm -f {} \;
53}