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: Trent Piepho <[email protected]>
Acked-by: Mauro Carvalho Chehab <[email protected]>
Cc: "David S. Miller" <[email protected]>
Acked-by: Jeff Garzik <[email protected]>
Cc: Dominik Brodowski <[email protected]>
Cc: Chas Williams <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Trent Piepho 2007-06-27 14:09:54 -07:00 • committed by Linus Torvalds
commit 59faba1b31
5 changed files with 7 additions and 7 deletions

View file

@ -7,7 +7,7 @@ menuconfig ATM_DRIVERS
depends on NETDEVICES && ATM
default y
if ATM_DRIVERS
if ATM_DRIVERS && NETDEVICES && ATM
config ATM_DUMMY
tristate "Dummy ATM driver"