More specifically, I thought we had done a *full sweep* for
all pseudo-flavors, but I am mistaken.

The proper way to handle  pseudo-flavors looks like this:

PSEUDO_FLAVORS = no_foo no_bar
FLAVOR ?=
MULTI_PACKAGES = -main -foo -bar

.include <bsd.port.arch.mk>

.if ${BUILD_PACKAGES:M-foo}
....
.endif

.if ${BUILD_PACKAGES:M-bar}
....
.endif


bsd.port.arch.mk does remove "bad" pseudo-flavors from 
BUILD_PACKAGES.  This does take care of ONLY_FOR_ARCHS-foo,
this does take care of bulk builds.


Of course, for this to work properly, you *must* include
bsd.port.arch.mk and you *must* base your tests on BUILD_PACKAGES,
*not* FLAVOR.

bsd.port.arch.mk cannot change FLAVOR (for various reasons).


One other bad idiom I'm frequently seeing is:

.if sometest for foo
LIB_DEPENDS-foo = whatever
.endif

do take
LIB_DEPENDS-foo = whatever
*out* of the -foo test.
The main reason we have variables like
LIB_DEPENDS-foo is so we can set them *unconditionally*.

This does simplify the maze of tests greatly, by *only* making
conditional what really needs to be conditional.

Reply via email to