#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
export DEB_CXXFLAGS_MAINT_APPEND  = -Wall -pedantic

# trust upstream optimization level unless explicitly disabled
ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
export DEB_CFLAGS_MAINT_STRIP=-O2
export DEB_CXXFLAGS_MAINT_STRIP=-O2
endif

UNICODE_REGENERATE_TABLES=true

# reduce risk of out-of-memory build issues on weak arches
ifneq (,$(filter $(DEB_HOST_ARCH),armel armhf i386 mips64el powerpc riscv64))
export RUSTFLAGS += -C embed-bitcode=no -C lto=no -C linker-plugin-lto=no
endif

%:
	dh $@
