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