2004-10-24 23:44:04

by J.A. Magallon

[permalink] [raw]
Subject: kbuild dependencies and layout

Hi all...

I'm trying to make a small modification to the Kconfig files, but I can't
get the menu layout match what I want.

Say I want this logic:

menu "A support"
config A_1
tristate "A-1"
config A_2
tristate "A-2"
config A_GENERIC_FEATURE_1
bool "AF1"
depends on A_1 || A_2
config A_GENERIC_FEATURE_2
bool "AF2"
depends on A_1 || A_2
endmenu

A_GENERIC_FEATURE_1 is valid for both submodels. Logic is right, but
gconfig insists on putting AF1 as a subentry of A_2, instead of hanging
it in the menu. I would like:

A support
\- A-1
\- A-2
\- AF1 (visible only when A-1 or A-2 are selected)
\- AF2 (visible only when A-1 or A-2 are selected)

but I get

A support
\- A-1
\- A-2
\- AF1 (visible only when A-1 or A-2 are selected)
\- AF2 (visible only when A-1 or A-2 are selected)

(ie, both optional features haged on A-2)

What am I doing wrong ? Is there any way to defeat the auto-layout
based on depedencies of kbuild ?

TIA

--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandrakelinux release 10.1 (Community) for i586
Linux 2.6.9-jam1 (gcc 3.4.1 (Mandrakelinux 10.1 3.4.1-4mdk)) #1



2004-10-25 14:12:42

by Roman Zippel

[permalink] [raw]
Subject: Re: kbuild dependencies and layout

Hi,

On Sun, 24 Oct 2004, J.A. Magallon wrote:

> A_GENERIC_FEATURE_1 is valid for both submodels. Logic is right, but
> gconfig insists on putting AF1 as a subentry of A_2, instead of hanging
> it in the menu. I would like:
>
> A support
> \- A-1
> \- A-2
> \- AF1 (visible only when A-1 or A-2 are selected)
> \- AF2 (visible only when A-1 or A-2 are selected)

Could you please post a real example? There are two possibilities and it
depends on the context.
Part of the problem might also be that gconfig uses by default the full
tree mode, that doesn't automatically expands the new options, otherwise
I don't really see a problem with indenting these two suboptions.

bye, Roman

2004-10-26 01:50:13

by J.A. Magallon

[permalink] [raw]
Subject: Re: kbuild dependencies and layout


On 2004.10.25, Roman Zippel wrote:
> Hi,
>
> On Sun, 24 Oct 2004, J.A. Magallon wrote:
>
> > A_GENERIC_FEATURE_1 is valid for both submodels. Logic is right, but
> > gconfig insists on putting AF1 as a subentry of A_2, instead of hanging
> > it in the menu. I would like:
> >
> > A support
> > \- A-1
> > \- A-2
> > \- AF1 (visible only when A-1 or A-2 are selected)
> > \- AF2 (visible only when A-1 or A-2 are selected)
>
> Could you please post a real example? There are two possibilities and it
> depends on the context.

I'm trying to cleanup the config for Promise IDE, see

http://marc.theaimsgroup.com/?l=linux-kernel&m=109849081408193&w=2

Original code in drivers/ide/Kconfig for 2.6.9-mm1:

config BLK_DEV_PDC202XX_OLD
tristate "PROMISE PDC202{46|62|65|67} support"
config PDC202XX_BURST
bool "Special UDMA Feature"
depends on BLK_DEV_PDC202XX_OLD
config BLK_DEV_PDC202XX_NEW
tristate "PROMISE PDC202{68|69|70|71|75|76|77} support"
config PDC202XX_FORCE
bool "Enable controller even if disabled by BIOS"
depends on BLK_DEV_PDC202XX_NEW

(helps stripped...)
I want to make PDC202XX_BURST and PDC202XX_FORCE be selectable if any of
_OLD or _NEW is selected. So I wrote:

menu "Promise PDC support"
config BLK_DEV_PDC202XX_OLD
tristate "PROMISE PDC202{46|62|65|67} support"
config BLK_DEV_PDC202XX_NEW
tristate "PROMISE PDC202{68|69|70|71|75|76|77} support"
config PDC202XX_BURST
bool "Special UDMA Feature"
depends on BLK_DEV_PDC202XX_OLD || BLK_DEV_PDC202XX_NEW
config PDC202XX_FORCE
bool "Enable controller even if disabled by BIOS"
depends on BLK_DEV_PDC202XX_OLD || BLK_DEV_PDC202XX_NEW
endmenu

Result (menuconfig) is:

x x <M> PROMISE PDC202{46|62|65|67} support x x
x x < > PROMISE PDC202{68|69|70|71|75|76|77} support x x
x x [ ] Special UDMA Feature (NEW) x x
x x [ ] Enable controller even if disabled by BIOS (NEW) x x

ie, the two flags are grouped inside the PDC_NEW config, instead of at
the same level.

I tried grouping things under submenus in several ways, with dummy config
variables, anyways it always ends up grouped below PDC_NEW, instead that at
the same level that both PDCs...

I have no idea on how to do it...

Any clue ?

TIA

--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandrakelinux release 10.1 (Community) for i586
Linux 2.6.9-jam1 (gcc 3.4.1 (Mandrakelinux 10.1 3.4.1-4mdk)) #1


2004-10-27 00:19:47

by Roman Zippel

[permalink] [raw]
Subject: Re: kbuild dependencies and layout

Hi,

On Mon, 25 Oct 2004, J.A. Magallon wrote:

> (helps stripped...)
> I want to make PDC202XX_BURST and PDC202XX_FORCE be selectable if any of
> _OLD or _NEW is selected. So I wrote:
>
> menu "Promise PDC support"
> config BLK_DEV_PDC202XX_OLD
> tristate "PROMISE PDC202{46|62|65|67} support"
> config BLK_DEV_PDC202XX_NEW tristate "PROMISE PDC202{68|69|70|71|75|76|77}
> support"
> config PDC202XX_BURST
> bool "Special UDMA Feature"
> depends on BLK_DEV_PDC202XX_OLD || BLK_DEV_PDC202XX_NEW
> config PDC202XX_FORCE
> bool "Enable controller even if disabled by BIOS"
> depends on BLK_DEV_PDC202XX_OLD || BLK_DEV_PDC202XX_NEW
> endmenu

Usually it already helps if the main options have some additional
dependencies like "depends on PCI", which in this case is not needed
anymore.
The other possibility is to put a dummy config symbol inbetween:

config PDC202XX_DUMMY
bool

if it neither has prompt nor a default, it won't be saved, but I'd rather
would like to avoid that for a minor esthetic problem.

bye, Roman