# of them are sane to use in the hypervisor context, rather than
# simply in userland binaries.
#
-export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+# Inexplicably, if you tell make `export V=value' and `$(shell ...)'
+# it does not pass V to the shell. WTF. So we set a variable
+# dbmo which we include in the relevant $(shell ...) invocations.
+dbmo= DEB_BUILD_MAINT_OPTIONS=hardening=+all
# Architecture handling.
#
t=$(PWD)/debian/tmp
-dpkg_CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
-dpkg_CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
-dpkg_LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
+dpkg_CFLAGS := $(shell $(dbmo) dpkg-buildflags --get CFLAGS)
+dpkg_CPPFLAGS := $(shell $(dbmo) dpkg-buildflags --get CPPFLAGS)
+dpkg_LDFLAGS := $(shell $(dbmo) dpkg-buildflags --get LDFLAGS)
make_args_xen= $(make_args_common) \
XEN_COMPILE_ARCH=$(xen_arch_$(DEB_BUILD_ARCH)) \