#!/usr/bin/make -f # -*- makefile -*- export DH_VERBOSE=1 include /usr/share/dpkg/architecture.mk # jemalloc supports a runtime page size that's smaller or equal to the build # time one, but aborts on a larger one. If not defined, it falls back to the # the build system's _SC_PAGESIZE, which in many architectures can vary. Set # this to 4K on x86 for performance, and set it to 64K (2^16) on every other # architecture, which should be a reasonable maximum. See Debian #843926, as # well as upstream #467 for more context. ifneq (,$(findstring $(DEB_HOST_ARCH),i386 amd64 kfreebsd-i386 kfreebsd-amd64 x32)) DEB_CONFIGOPTS += --with-lg-page=12 else DEB_CONFIGOPTS += --with-lg-page=16 endif # 2MB (2^21) is the default, but (as of 5.1.0) is overriden by whatever is # found in /proc/meminfo. Avoid relying on the build system's configuration and # just set it statically here. DEB_CONFIGOPTS += --with-lg-hugepage=21 # Broken multiple times on random architectures using all the different methods # (including libunwind). Profiling is nice-to-have but not necessary, and # i386/amd64 seem regularly tested by upstream, so enable it only for these. ifneq (,$(findstring $(DEB_HOST_ARCH),i386 amd64)) DEB_CONFIGOPTS += --enable-prof endif ifneq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) DEB_CONFIGOPTS += --disable-doc endif ifneq (,$(findstring $(DEB_HOST_ARCH),powerpc)) DEB_CPPFLAGS_MAINT_APPEND += -maltivec endif export DEB_CPPFLAGS_MAINT_APPEND # dh 10 calls autoreconf, and autoreconf calls autoheader if AC_CONFIG_HEADERS # is used. Upstream, however, uses multiple hand-crafted config headers, which # makes autoheader fail. Override with /bin/true. export AUTOHEADER = true # suppress Address Sanitizer alignment checks, cf. #812874 export ASAN_OPTIONS = suppressions=$(CURDIR)/debian/asan-suppressions.txt %: dh $@ override_dh_auto_configure: dh_auto_configure -- --with-version=VERSION $(DEB_CONFIGOPTS) override_dh_auto_build: make all dist sed -i 's;#!\s*/usr/bin/env perl;#!/usr/bin/perl;' $(CURDIR)/bin/jeprof