summaryrefslogtreecommitdiff
path: root/debian/rules
blob: a806ef81ad70925dbaa1bf5ab1498663910aad95 (plain)
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
#!/usr/bin/make -f
include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS := hardening=+all
export DEB_LDFLAGS_MAINT_APPEND := -Wl,-z,defs

# In the normative branch, we need to manually set the target cpu to
# enable optimisation
ifeq ($(DEB_HOST_ARCH_CPU),arm64)
  TARGET_CPU = arm64
else ifeq ($(DEB_HOST_ARCH_CPU)_$(DEB_HOST_ARCH_ABI),arm_eabihf)
  TARGET_CPU = armv7
  # On ARM, we need to manually pass the flag used to compile NEON
  # code with
  CONFIG_EXTRA := -DAOM_NEON_INTRIN_FLAG=-mfpu=neon
else ifneq ($(filter mips64%, $(DEB_HOST_ARCH_CPU)),)
  TARGET_CPU = mips64
else ifneq ($(filter mips%, $(DEB_HOST_ARCH_CPU)),)
  TARGET_CPU = mips32
else ifneq ($(filter ppc% powerpc%, $(DEB_HOST_ARCH_CPU)),)
  TARGET_CPU = ppc
else ifeq ($(DEB_HOST_ARCH_CPU)_$(DEB_HOST_ARCH_ABI),amd64_base)
  TARGET_CPU = x86_64
else ifeq ($(DEB_HOST_ARCH_CPU),i386)
  TARGET_CPU = x86
else
  TARGET_CPU = generic
endif

# Disable AltiVec on powerpcspe
ifeq ($(DEB_HOST_ARCH),powerpcspe)
  CONFIG_EXTRA := -DENABLE_VSX=OFF
endif

%:
	dh $@ -Bbuild-debian

# Examples and tools not built because they require various private
#  symbols from libaom.so which we filter out.
# Tests disabled because they require network access to download test
#  data.
# Setting GIT_EXECUTABLE to some invalid file prevents the version
#  being taken from git if we're on a Debian packaging git branch.
override_dh_auto_configure:
	dh_auto_configure -- \
		-DBUILD_SHARED_LIBS=1 \
		-DCONFIG_MULTITHREAD=1 \
		-DENABLE_TESTS=0 \
		-DGIT_EXECUTABLE=/nonexistant-binary \
		-DLIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
		-DAOM_TARGET_CPU=$(TARGET_CPU) \
		$(CONFIG_EXTRA)

# Do not compress html changelog which breaks documentation
override_dh_compress:
	dh_compress -Xchangelog.html