#!/usr/bin/make -f

# output every command that modifies files on the build system.
#DH_VERBOSE = 1

DEB_BUILD_MAINT_OPTIONS =hardening=+all

include /usr/share/dpkg/architecture.mk

ifeq ($(DEB_HOST_ARCH_OS),hurd)
DEB_CPPFLAGS_MAINT_APPEND = -DPATH_MAX=4096
endif

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS)))
  CC =diet -v -Os gcc
  CFLAGS =-nostdinc -Wall
  CPPFLAGS =
  LDFLAGS =
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		--disable-fnmatch \
		--disable-lineno \
		--disable-glob

execute_before_dh_gencontrol:
	# dh_installdebconf will add a dependency on debconf to
	# ${misc:Depends} because of the presence of ./debian/dash.templates
	# Since the preinst snippet has fallback code for when debconf is not
	# available, that extra dependency is not needed.
	# FIXME: remove this after Trixie together with the preinst
	sed -i '/^misc:Depends=/s/debconf[^,]*[, ]*//' debian/dash.substvars

.PHONY: override_dh_auto_configure
