Skip to content
Commit 59faba1b authored by Trent Piepho's avatar Trent Piepho Committed by Linus Torvalds
Browse files

Fix Kconfig dependency problems wrt boolean menuconfigs



If one has a dependency chain (tristate)FOO depends on (bool)BAR depends on
(tristate)BAZ, build problems will result.  If BAZ=m, then BAR can be set
y, which allows FOO=y.  It's possible to have FOO=y && BAZ=m, which
wouldn't be allowed if FOO depended directly on BAZ.  In effect, the bool
promotes the tristate from m to y.

This ends up causing a problem with several menuconfigs that look like:

menuconfig BAR
	bool
	depends on BAZ [tristate]
if BAR
config FOO
	tristate
endif

The solution used here is to add the dependencies of BAR to the if
statement, so that items in the if block will gain a direct
non-bool-promoted dependency on BAZ.  This is how it would work if a menu
was used instead of an if block.

Signed-off-by: default avatarTrent Piepho <xyzzy@speakeasy.org>
Acked-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
Cc: "David S. Miller" <davem@davemloft.net>
Acked-by: default avatarJeff Garzik <jeff@garzik.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Chas Williams <chas@cmf.nrl.navy.mil>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 30acbaba
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment