File: rules

package info (click to toggle)
jemalloc 5.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,840 kB
  • sloc: ansic: 38,965; perl: 4,138; sh: 3,725; makefile: 521; cpp: 216; python: 162
file content (58 lines) | stat: -rwxr-xr-x 2,095 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/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 (,$(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

override_dh_auto_clean:
	dh_auto_clean
	# these are being regenerated by "make dist" above
	-rm -f doc/jemalloc.3 doc/jemalloc.html