#!/usr/bin/make -f

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_ARCH_CPU=$(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
DEB_HOST_ARCH_OS=$(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
export DEB_BUILD_HARDENING=1
export DEB_BUILD_HARDENING_PIE=0

NO_PPTRACE=

ifneq ($(DEB_HOST_ARCH_OS),linux)
NO_PPTRACE=--without-pptrace
endif
ifneq ($(DEB_HOST_ARCH_CPU),i386)
ifneq ($(DEB_HOST_ARCH_CPU),amd64)
NO_PPTRACE=--without-pptrace
endif
endif

%:
	dh $@  --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- $(NO_PPTRACE) --with-mpi-include=/usr/include/mpi --with-fxt=/usr --with-gtg=/usr --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)

override_dh_auto_test:
	-dh_auto_test
