Peter Samuelson wrote:
> 
> There are lots of instances of things like
> 
>   if [ "$CONFIG_FOO" = "y" -o "$CONFIG_FOO" = "m" ]; then
>      dep_tristate 'Bar' CONFIG_BAR $CONFIG_FOO
>      ...
>   fi
> 
> which can be replaced by
> 
>   dep_if CONFIG_FOO
>      tristate 'Bar' CONFIG_BAR
>      ...
>   dep_fi

Yes, this is a common case.

> but few, if any, instances of
> 
>   if [ "$CONFIG_FOO" = "y" -o "$CONFIG_FOO" = "m" ]; then
>      tristate 'Bar' CONFIG_BAR
>   fi
> 
> which would require the more complex
> 
>   dep_if CONFIG_FOO=y or CONFIG_FOO=m
>      tristate 'Bar' CONFIG_BAR
>   dep_fi

There are other ways to use "if" statements not covered by these two
cases, for example a couple of minutes of manual scanning reveals...

int  '  default tagged command queue depth' CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS 8
if [ "$CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS" = "0" ]; then
   bool '  not allow targets to disconnect' CONFIG_SCSI_NCR53C8XX_NO_DISCONNECT
fi

...and...

if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then
  define_bool CONFIG_ACPI y
  define_bool CONFIG_ACPI_EFI y
  define_bool CONFIG_ACPI_INTERPRETER y
  define_bool CONFIG_ACPI_KERNEL_CONFIG y
fi

...and...

bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG
if [ "$CONFIG_HOTPLUG" = "y" ]; then
   source drivers/pcmcia/Config.in
else
   define_bool CONFIG_PCMCIA n
fi

How are you going to deal with these?

> (Not to mention the possibility that such instances are buggy and
> should have been a dep_tristate in the first place.)

Agreed.

> > Oh no, the dreaded flag day.
> 
> Heh.  No, a flag day is where BIGNUM things have to be patched at once
> because there's no migration path.  In this case there *is* a
> migration path, so the only things that break on The Day are things
> the gcml2 checker (and a grep through the makefiles for suspicious
> things like 'ifdef') has warned us about but we didn't bother to fix.

Ok, so not "The Day" but "The Several Weeks During Which Things Mostly
Still Work".

BTW the gcml2 checker isn't checking for this kind of bug, although there's
no reason it couldn't.

Greg.
-- 
the price of civilisation today is a courageous willingness to prevail,
with force, if necessary, against whatever vicious and uncomprehending
enemies try to strike it down.     - Roger Sandall, The Age, 28Sep2001.


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel

Reply via email to