I would like to have a simple way to query for a specific feature in
debian/rules. E.g. an upstream package provides options to configure for lto or
pgo builds on it's own, like
ifeq (yes,$(shell dpkg-buildflags --query-feature optimize lto))
configure_args += --enable-lto
# lto flags are set by the upstream build system
export DEB_BUILD_MAINT_OPTIONS := $(DEB_BUILD_MAINT_OPTIONS) optimize=-lto
endif
dpkg-buildflags already has a --query-features option, but that one would be
inconvenient to use in a Makefile.
A space-separated list of enabled features may be useful on its own, and would not increase the complexity in Makefiles. features := $(shell dpkg-buildflags --enabled-features optimize) ifneq (,$(filter lto,$(features))) ... endif ifneq (,$(filter pgo,$(features))) ... For symetry, a '--disabled-features AREA' option would be nice. For consistency with '--query-features AREA', both should report unknown AREAs with an exit status of 1.