Background: I have a port (multimedia/cx88) that installs some kmods, which I
like to rebuild during the PORTS_MODULES step. That port also installs a userspace
utility that is built using bsd.prog.mk with libs specified in LDADD. As such,
rebuilding it during PORTS_MODULES has been broken since 11.0 because MAKESYSPATH/
MAKEFLAGS (-m) point to SRCROOT, which consumes src.libnames.mk and results in an
error like "These libraries should be LIBADD+=foo rather than DPADD/LDADD+=-lfoo".
I'm not at all an expert on the build system, so this change may be the wrong thing
to do for a variety of reasons. The real answer might just be something like
"split the port up" or "don't use LDADD there". But as long as bsd.kmod.mk remains
a thin wrapper that respects SYSDIR, it seems like this approach could allow
PORTS_MODULES to work for a broader variety of ports. It would result in kmods
building against the makefiles in the updated src tree through SYSDIR, while any
remaining piece of the port would build against the installed ports/build system,
which (I think?) is what one would want in an upgrade scenario.
So I thought I'd at least post it so you guys could poke holes in it:)