[BusyBox] Re: ifconfig: Clean up. [PATCH]
Rob Landley
rob at landley.net
Tue Jul 26 12:04:23 UTC 2005
On Tuesday 26 July 2005 05:12, Rob Landley wrote:
> On Tuesday 26 July 2005 01:55, Shaun Jackman wrote:
> > On 7/25/05, Rob Landley <rob at landley.net> wrote:
> > > > I'd to spell do_cleanup as DO_CLEANUP. If I saw...
> > > > if (DO_CLEANUP)
> > > > ... I'd understand it was a conditional compilation. If I saw...
> > > > if (do_cleanup)
> > >
> > > I was actually thinking of a static const int.
> >
> > Getting back to the original thread of conversation, here's an
> > implementation of my previous idea. I rather like the consistency this
> > method offers.
>
> If we're going to do this (and I suppose the fact that
> CONFIG_FEATURE_CLEAN_UP is a symbol we're already familiar with outweights
> the fact it's a bit verbose and loud), then we really should have the build
> process generate these programmatically. I.E. add the following to the
> config.h generator in the build file:
>
> sed -e 's/#undef CONFIG_\(.*\)/#define CONFIG_\1 0/' -i config.h
>
> Note that this misses "USING_CROSS_COMPILER", and that I personally don't
> care.
>
> Rob
Sigh. Static const int is right. (There are two thousand, seven hundred, and
fourteen occurrencess of "#ifdef" or "#ifndef" in the current busybox
code...)
Okay, slightly more tricky sed invocation then. And actually getting the sed
infocation called reliably when config.h is autogenerated by a binary in the
scripts directory (why does the scripts directory have compiled binaries in
it) that's called from plenty of other places than the actual
include/config.h rule means that the easiest thing to do is make a
bb_config.h and change the busybox code to use that...
Luckily, only four places actually #include config.h (busybox.h, libbb.h, and
for some strange reason decompress_uncompress.c and decompress_unzip.c, and
I'd call those last two bugs...)
Rob
More information about the busybox
mailing list