CONFIG_* defines

Rob Landley rob at landley.net
Wed Sep 7 00:18:58 UTC 2005


On Tuesday 06 September 2005 11:36, Bernhard Fischer wrote:

> >3)
> >include/config/feature/ ... bla-bla is unstandardization
>
> regarding that 3). Can you please explain that a little bit?
>
>
> We could just move the CONFIG_* namespace to something different,
> for example BUSYBOX_APPLET_* and BUSYBOX_APPLET_*_{FOO,BAZ,...}
> I know that the cons -- several patches in the bugtracker may not apply
> cleanly any more etc. -- were already brought up..
>
> Just as an example, i'm attaching an applet runlevel(8). The only thing
> which would need to be touched would be bbconfig for it to allow
> BUSYBOX_* along the by then old/legacy CONFIG_* entries in .config.
>
> PS:
> thanks for applying the typo fix for libunarchive, vodz.

I'm not quite sure what vodz means by #3, but in terms of moving the CONFIG_ 
namespace:

I've been slowly switching things over to the ENABLE_* macros, which instead 
of being defined or undefined are always defined, but to 0 or 1.  That way 
they can be used in normal if() statements.  Since it's a constant, the 
compiler's "dead code elimination" optimization (a very old and very simple 
optimization, one even fabrice bellard's "tiny C compiler" does) can chop 
them out.

This is much easier to read and maintain than nested #ifdefs in the middle of 
C functions...

Rob



More information about the busybox mailing list