diff --git a/depends/Makefile b/depends/Makefile --- a/depends/Makefile +++ b/depends/Makefile @@ -15,6 +15,7 @@ NO_WALLET ?= NO_ZMQ ?= NO_UPNP ?= +NO_JEMALLOC ?= FALLBACK_DOWNLOAD_PATH ?= https://download.bitcoinabc.org/depends-sources BUILD = $(shell ./config.guess) @@ -110,6 +111,8 @@ protobuf_packages_$(NO_PROTOBUF) = $(protobuf_packages) rapidcheck_packages_$(RAPIDCHECK) = $(rapidcheck_packages) +jemalloc_packages_$(NO_JEMALLOC) = $(jemalloc_packages) + packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) @@ -126,6 +129,10 @@ packages += $(rapidcheck_packages) endif +ifneq ($(jemalloc_packages_),) +packages += $(jemalloc_packages) +endif + all_packages = $(packages) $(native_packages) meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk diff --git a/depends/README.md b/depends/README.md --- a/depends/README.md +++ b/depends/README.md @@ -89,6 +89,7 @@ NO_ZMQ: Don't download/build/cache packages needed for enabling zeromq NO_WALLET: Don't download/build/cache libs needed to enable the wallet NO_UPNP: Don't download/build/cache packages needed for enabling upnp + NO_JEMALLOC: Don't download/build/cache jemalloc DEBUG: disable some optimizations and enable more runtime checking RAPIDCHECK: build rapidcheck (experimental, requires cmake) NO_PROTOBUF: Don't download/build/cache protobuf (used for BIP70 support) diff --git a/depends/packages/jemalloc.mk b/depends/packages/jemalloc.mk new file mode 100644 --- /dev/null +++ b/depends/packages/jemalloc.mk @@ -0,0 +1,21 @@ +package=jemalloc +$(package)_version=5.2.1 +$(package)_download_path=https://github.com/jemalloc/jemalloc/releases/download/$($(package)_version) +$(package)_file_name=jemalloc-$($(package)_version).tar.bz2 +$(package)_sha256_hash=34330e5ce276099e2e8950d9335db5a875689a4c6a56751ef3b1d8c537f887f6 + +define $(package)_set_vars +$(package)_config_opts=--disable-libdl --disable-shared --enable-cxx --enable-option-checking +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) -j$(JOBS) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -25,3 +25,5 @@ ifneq ($(build_os),darwin) darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus endif + +jemalloc_packages = jemalloc diff --git a/doc/dependencies.md b/doc/dependencies.md --- a/doc/dependencies.md +++ b/doc/dependencies.md @@ -14,6 +14,7 @@ | FreeType | [2.7.1](http://download.savannah.gnu.org/releases/freetype) | | No | | | | GCC | | [5.0](https://gcc.gnu.org/) (C++14 support) | | | | | HarfBuzz-NG | | | | | | +| jemalloc | [5.2.1](https://github.com/jemalloc/jemalloc/releases) | | | | | | libevent | [2.1.11-stable](https://github.com/libevent/libevent/releases) | 2.0.22 | No | | | | libpng | | | | | Yes | | libsrvg | | | | | |