* config language shortcomings in 2.4
@ 2004-08-19 7:12 Joshua Kwan
2004-08-19 7:28 ` Willy Tarreau
0 siblings, 1 reply; 5+ messages in thread
From: Joshua Kwan @ 2004-08-19 7:12 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1539 bytes --]
Hello,
Recently the Debian kernel team has been discussing 2.4's configuration
system. We have a patched tg3.c which removes the firmware and adds a
dependency on CONFIG_FW_LOADER for cases where operation is impossible
without the firmware.
Initially, we changed this:
dep_tristate 'Broadcom Tigon3 support' CONFIG_TIGON3 $CONFIG_PCI
to this:
dep_tristate 'Broadcom Tigon3 support' CONFIG_TIGON3 $CONFIG_PCI $CONFIG_FW_LOADER
But this would still be selectable if CONFIG_FW_LOADER were not set at
all. Selecting it would not enable CONFIG_FW_LOADER either.
So, we tried this:
if [ "$CONFIG_FW_LOADER" != "n" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then
dep_tristate 'Broadcom Tigon3 support' CONFIG_TIGON3 $CONFIG_PCI $CONFIG_FW_LOADER
fi
and this STILL doesn't seem to work in the case that CONFIG_FW_LOADER
isn't set but CONFIG_EXPERIMENTAL is y.
Eventually we continued droning through the corner cases until reaching
if [ "$CONFIG_EXPERIMENTAL" = "y" -a \
"$CONFIG_HOTPLUG" = "y" -a \
"$CONFIG_FW_LOADER" = "y" -o "$CONFIG_FW_LOADER" = "m" -a \
"$CONFIG_CRC32" = "y" -o "$CONFIG_CRC32" = "m" ]; then
dep_tristate 'Broadcom Tigon3 support' CONFIG_TIGON3 $CONFIG_PCI $CONFIG_FW_LOADER $CONFIG_CRC32
fi
which finally has the desired effect.
But is there really no way to say
config TIGON3
select FW_LOADER
in 2.4?
CONFIG_PCMCIA_ATMEL also suffers from this problem.
Any ideas? Is it just that the old Configure scripts suck?
--
Joshua Kwan
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 881 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: config language shortcomings in 2.4
2004-08-19 7:12 config language shortcomings in 2.4 Joshua Kwan
@ 2004-08-19 7:28 ` Willy Tarreau
2004-08-24 5:04 ` Joshua Kwan
0 siblings, 1 reply; 5+ messages in thread
From: Willy Tarreau @ 2004-08-19 7:28 UTC (permalink / raw)
To: joshk, linux-kernel
Hi,
On Thu, Aug 19, 2004 at 12:12:29AM -0700, Joshua Kwan wrote:
> Eventually we continued droning through the corner cases until reaching
>
> if [ "$CONFIG_EXPERIMENTAL" = "y" -a \
> "$CONFIG_HOTPLUG" = "y" -a \
> "$CONFIG_FW_LOADER" = "y" -o "$CONFIG_FW_LOADER" = "m" -a \
> "$CONFIG_CRC32" = "y" -o "$CONFIG_CRC32" = "m" ]; then
> dep_tristate 'Broadcom Tigon3 support' CONFIG_TIGON3 $CONFIG_PCI $CONFIG_FW_LOADER $CONFIG_CRC32
> fi
>
> which finally has the desired effect.
I'm surprized, because I think you have a precedence problem here. Your 'if'
condition will be true if either :
CONFIG_CRC32 = m
or
CONFIG_CRC32 = y and CONFIG_FW_LOADER = m
or
CONFIG_FW_LOADER = y and CONFIG_HOTPLUG = y and CONFIG_EXPERIMENTAL = y
Anyway, I believe that you have no other choice due to the way dep_tristate
works. What would you expect it to do when it depends on 3 variables which
are respectively 'n', 'm' and 'y' ? Honnestly, without looking closer at its
implementation, I would not be able to give a valid response.
BTW, have you tried defining a temporary variable somewhere ? There are
portions of config where you see things such as :
if [ CONFIG_XX = "y" -o CONFIG_YY = "m" -a CONFIG_ZZ = "y" ]; then
TEMP=y
fi
dep_tristate "cool feature" CONFIG_COOL $TEMP
Perhaps it could help you define complex combinations.
Regards,
Willy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: config language shortcomings in 2.4
2004-08-19 7:28 ` Willy Tarreau
@ 2004-08-24 5:04 ` Joshua Kwan
2004-08-24 5:19 ` Nigel Cunningham
2004-08-24 18:35 ` Marcelo Tosatti
0 siblings, 2 replies; 5+ messages in thread
From: Joshua Kwan @ 2004-08-24 5:04 UTC (permalink / raw)
To: Willy Tarreau; +Cc: linux-kernel
Willy Tarreau wrote:
> Anyway, I believe that you have no other choice due to the way dep_tristate
> works. What would you expect it to do when it depends on 3 variables which
> are respectively 'n', 'm' and 'y' ? Honnestly, without looking closer at its
> implementation, I would not be able to give a valid response.
>
> BTW, have you tried defining a temporary variable somewhere ? There are
> portions of config where you see things such as :
>
> if [ CONFIG_XX = "y" -o CONFIG_YY = "m" -a CONFIG_ZZ = "y" ]; then
> TEMP=y
> fi
> dep_tristate "cool feature" CONFIG_COOL $TEMP
>
> Perhaps it could help you define complex combinations.
Sorry for the belated response, but certainly it should not be necessary
to do:
if [ "$CONFIG_FW_LOADER" = "m" -o "$CONFIG_FW_LOADER" = "y" ]; then
HAVE_SOME_FW_LOADER=y
fi
if [ "$CONFIG_CRC32" = "m" -o "$CONFIG_CRC32" = "m" ]; then
HAVE_SOME_CRC32=y
fi
if [ "$HAVE_SOME_CRC32" = "y" -a "$HAVE_SOME_FW_LOADER" = "y" ]; then
dep_tristate 'Broadcom Tigon3 support' CONFIG_TIGON3 $CONFIG_PCI
$HAVE_SOME_FW_LOADER $HAVE_SOME_CRC32
fi
just to enforce an explicit dependency on some form of CONFIG_CRC32 and
CONFIG_FW_LOADER. This is necessary because "$CONFIG_CRC32" != "n"
doesn't work the way you think it would.
Anyway, it's all very disgusting and I'm inclined to just ignore it and
maybe some benevolent soul will one day port Kconfig back to 2.4.
--
Joshua Kwan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: config language shortcomings in 2.4
2004-08-24 5:04 ` Joshua Kwan
@ 2004-08-24 5:19 ` Nigel Cunningham
2004-08-24 18:35 ` Marcelo Tosatti
1 sibling, 0 replies; 5+ messages in thread
From: Nigel Cunningham @ 2004-08-24 5:19 UTC (permalink / raw)
To: Joshua Kwan; +Cc: Willy Tarreau, Linux Kernel Mailing List
Hi.
On Tue, 2004-08-24 at 15:04, Joshua Kwan wrote:
> Sorry for the belated response, but certainly it should not be necessary
> to do:
>
> if [ "$CONFIG_FW_LOADER" = "m" -o "$CONFIG_FW_LOADER" = "y" ]; then
> HAVE_SOME_FW_LOADER=y
> fi
> if [ "$CONFIG_CRC32" = "m" -o "$CONFIG_CRC32" = "m" ]; then
> HAVE_SOME_CRC32=y
> fi
>
> if [ "$HAVE_SOME_CRC32" = "y" -a "$HAVE_SOME_FW_LOADER" = "y" ]; then
> dep_tristate 'Broadcom Tigon3 support' CONFIG_TIGON3 $CONFIG_PCI
> $HAVE_SOME_FW_LOADER $HAVE_SOME_CRC32
> fi
Just in case someone goes to copy and paste the above, there's a typo:
CONFIG_CRC32 = m or = m.
> Anyway, it's all very disgusting and I'm inclined to just ignore it and
> maybe some benevolent soul will one day port Kconfig back to 2.4.
Hehe. I had to do something similar when I made suspend 2 able to be
compiled as modules. It could certainly be more elegant.
Nigel
--
Nigel Cunningham
Christian Reformed Church of Tuggeranong
PO Box 1004, Tuggeranong, ACT 2901
Many today claim to be tolerant. But true tolerance can cope with others
being intolerant.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: config language shortcomings in 2.4
2004-08-24 5:04 ` Joshua Kwan
2004-08-24 5:19 ` Nigel Cunningham
@ 2004-08-24 18:35 ` Marcelo Tosatti
1 sibling, 0 replies; 5+ messages in thread
From: Marcelo Tosatti @ 2004-08-24 18:35 UTC (permalink / raw)
To: Joshua Kwan; +Cc: Willy Tarreau, linux-kernel
> Anyway, it's all very disgusting and I'm inclined to just ignore it and
> maybe some benevolent soul will one day port Kconfig back to 2.4.
Not worth the trouble IMO.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-08-24 20:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-19 7:12 config language shortcomings in 2.4 Joshua Kwan
2004-08-19 7:28 ` Willy Tarreau
2004-08-24 5:04 ` Joshua Kwan
2004-08-24 5:19 ` Nigel Cunningham
2004-08-24 18:35 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox