#!/usr/bin/make -f
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export SCRYPT_VERSION = $(shell dpkg-parsechangelog --show-field version | sed -e 's/-[^-][^-]*$$//')

ifeq ($(DEB_HOST_ARCH),ppc64el)
  export DEB_CFLAGS_MAINT_APPEND += -O2
  export DEB_CFLAGS_MAINT_STRIP += -O3
endif

%:
	dh $@

# In the upstream tarball, but not the git repo, the autotools support
# files are in autotools/. For robustness, we link them to top level
# if necessary.

override_dh_autoreconf: configure.ac Makefile.am
	dh_autoreconf

configure.ac Makefile.am:
	@echo "Link autotools scripts to top level"
	ln --verbose -s autotools/$@ ./

override_dh_auto_configure:
	@echo "configure to generate shared library"
	dh_auto_configure -- --enable-libscrypt-kdf
