#!/usr/bin/make -f
export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

ifneq (,$(filter m68k powerpc sh4,${DEB_HOST_ARCH}))
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
# on these platforms gcc does not link with -latomic, resulting in
#   /usr/bin/m68k-linux-gnu-ld.bfd: ./obj-m68k-linux-gnu/../src/rist.c:1189:(.text+0xff8): undefined reference to `__atomic_fetch_add_8'
#   /usr/bin/m68k-linux-gnu-ld.bfd: ./obj-m68k-linux-gnu/../src/rist.c:1374:(.text+0x2592): undefined reference to `__atomic_load_8'
#   /usr/bin/m68k-linux-gnu-ld.bfd: ./obj-m68k-linux-gnu/../src/rist-common.c:1011:(.text+0x2310): undefined reference to `__atomic_fetch_add_8'
#   collect2: error: ld returned 1 exit status
# include a workaround for now
DEB_LDFLAGS_MAINT_APPEND += -latomic
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- -Duse_mbedtls=false -Duse_gnutls=true -Duse_nettle=true

override_dh_auto_test-arch:
	# must be executed consecutively lest they interfer with each other!
	# and grant the tests more time which is sorely needed with noisy neighbors
	dh_auto_test --no-parallel -- --timeout-multiplier 5

override_dh_installchangelogs:
	dh_installchangelogs NEWS
