xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-devtools/jemalloc/jemalloc_5.2.1.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# Copyright (C) 2021 Mingli Yu <mingli.yu@windriver.com>
2*4882a593Smuzhiyun# Released under the MIT license (see COPYING.MIT for the terms)
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunSUMMARY = "General-purpose scalable concurrent malloc implementation"
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunDESCRIPTION = "jemalloc is a general purpose malloc(3) implementation that emphasizes \
7*4882a593Smuzhiyunfragmentation avoidance and scalable concurrency support."
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunHOMEPAGE = "https://github.com/jemalloc/jemalloc"
10*4882a593SmuzhiyunLICENSE = "BSD-2-Clause"
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunSECTION = "libs"
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=ea061f8731d5e6a5761dfad951ef5f5f"
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunSRC_URI = "git://github.com/jemalloc/jemalloc.git;branch=master;protocol=https \
17*4882a593Smuzhiyun           file://0001-Makefile.in-make-sure-doc-generated-before-install.patch \
18*4882a593Smuzhiyun           file://run-ptest \
19*4882a593Smuzhiyun"
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun# Workaround for https://github.com/llvm/llvm-project/issues/52765
22*4882a593SmuzhiyunSRC_URI:append:libc-glibc:toolchain-clang = " file://0001-test-Disable-optimization-with-clang-for-aligned_all.patch "
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunSRCREV = "ea6b3e973b477b8061e0076bb257dbd7f3faa756"
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunS = "${WORKDIR}/git"
27*4882a593Smuzhiyun
28*4882a593Smuzhiyuninherit autotools ptest
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunEXTRA_AUTORECONF += "--exclude=autoheader"
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunEXTRA_OECONF:append:libc-musl = " --with-jemalloc-prefix=je_"
33*4882a593Smuzhiyun
34*4882a593Smuzhiyundo_install:append() {
35*4882a593Smuzhiyun	sed -i -e 's@${STAGING_DIR_HOST}@@g' \
36*4882a593Smuzhiyun               -e 's@${STAGING_DIR_NATIVE}@@g' \
37*4882a593Smuzhiyun               -e 's@${WORKDIR}@@g' ${D}${bindir}/jemalloc-config
38*4882a593Smuzhiyun}
39*4882a593Smuzhiyun
40*4882a593Smuzhiyundo_compile_ptest() {
41*4882a593Smuzhiyun	oe_runmake tests
42*4882a593Smuzhiyun}
43*4882a593Smuzhiyun
44*4882a593Smuzhiyundo_install_ptest() {
45*4882a593Smuzhiyun	install -d ${D}${PTEST_PATH}/tests
46*4882a593Smuzhiyun	subdirs="test/unit test/integration test/stress "
47*4882a593Smuzhiyun	for tooltest in ${subdirs}
48*4882a593Smuzhiyun	do
49*4882a593Smuzhiyun		cp -r ${B}/${tooltest} ${D}${PTEST_PATH}/tests
50*4882a593Smuzhiyun	done
51*4882a593Smuzhiyun	find ${D}${PTEST_PATH}/tests \( -name "*.d" -o -name "*.o" \) -exec rm -f {} \;
52*4882a593Smuzhiyun}
53