Defining a variable based on the contents of an environment variable
Q: how can I test that DEB_BUILD_OPTIONS contains a certain parameter?
Something like (PeterS):
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
Or use these 2 lines or so from the subversion debian/rules:
# turn DEB_BUILD_OPTIONS='foo,bar' into DEB_BUILD_OPT_FOO and DEB_BUILD_OPT_BAR d_b_o := $(shell echo "$(DEB_BUILD_OPTIONS)" | sed 's/[^-[:alnum:]]/ /g' | tr '[a-z]' '[A-Z]') $(foreach o, $(d_b_o), $(eval DEB_BUILD_OPT_$o := 1))
Then you can do things like:
ifdef DEB_BUILD_OPT_DEBUG confflags+= --enable-debug endif