blob: 8618c8c6a7d442072ef19328ae5f9b54f36c89dc [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://0001-Makefile.in-make-sure-doc-generated-before-install.patch \
18 file://run-ptest \
19"
Patrick Williams213cb262021-08-07 19:21:33 -050020
Andrew Geissler595f6302022-01-24 19:11:47 +000021# Workaround for https://github.com/llvm/llvm-project/issues/52765
22SRC_URI:append:libc-glibc:toolchain-clang = " file://0001-test-Disable-optimization-with-clang-for-aligned_all.patch "
23
Patrick Williams213cb262021-08-07 19:21:33 -050024SRCREV = "ea6b3e973b477b8061e0076bb257dbd7f3faa756"
25
26S = "${WORKDIR}/git"
27
Patrick Williams0ca19cc2021-08-16 14:03:13 -050028inherit autotools ptest
Patrick Williams213cb262021-08-07 19:21:33 -050029
30EXTRA_AUTORECONF += "--exclude=autoheader"
31
32EXTRA_OECONF:append:libc-musl = " --with-jemalloc-prefix=je_"
Patrick Williams0ca19cc2021-08-16 14:03:13 -050033
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050034do_install:append() {
35 sed -i -e 's@${STAGING_DIR_HOST}@@g' \
36 -e 's@${STAGING_DIR_NATIVE}@@g' \
37 -e 's@${WORKDIR}@@g' ${D}${bindir}/jemalloc-config
38}
39
Patrick Williams0ca19cc2021-08-16 14:03:13 -050040do_compile_ptest() {
41 oe_runmake tests
42}
43
44do_install_ptest() {
45 install -d ${D}${PTEST_PATH}/tests
46 subdirs="test/unit test/integration test/stress "
47 for tooltest in ${subdirs}
48 do
49 cp -r ${B}/${tooltest} ${D}${PTEST_PATH}/tests
50 done
51 find ${D}${PTEST_PATH}/tests \( -name "*.d" -o -name "*.o" \) -exec rm -f {} \;
52}