CONFIG_* defines
Bernhard Fischer
rep.nop at aon.at
Fri Sep 9 18:12:52 UTC 2005
On Fri, Sep 09, 2005 at 07:10:55PM +0400, Vladimir N. Oleynik wrote:
>I wrote:
>
>>>The Busybox has an old problem.
>>>after any usage make config, may be change FEATURE_* only
>>>1) recompiling applets/* always, but may be not require
>>>2) do not recompile applets, used this feature
>>
>>
>>Result of my two-day work.
>
>3-day
>
>>Special internal busybox`s mkdep
>>ftp://ftp.simtreas.ru/pub/my/bb/new/bb_mkdep.tgz
>
>ftp://ftp.simtreas.ru/pub/my/bb/new/bb_mkdep.c.gz
>now.
>One file, without flex. Only main() exported ;-)
>3-level for(;;) without "goto" and without any flags! ;-)
>More fast and small.
>
>>usage from $TOPDIR after "make *config*" as
>>
>>$ mkdir config
>>
>>$ ./bb_mkdep -c .config -I include -I coreutils -I e2fsprogs -I
>>e2fsprogs/blkid -I e2fsprogs/e2p -I e2fsprogs/ext2fs -I e2fsprogs/uuid
>>-I init -I networking -I networking/libiproute/linux -I networking/udhcp
>>-I shell -I util-linux -I coreutils/libcoreutils -k config -d `find .
>>-name "*.c" | grep -v ^./scripts/`
>> > .bb_depend
>>
>>Brrrr.
>>
>>Result:
>>
>>- config/*.h files generated from c-source and from .config keys
>> (see trivial.l source for trivial insert key regexp)
>>- .bb_depend with dependeces for include to Makefile without standart
>><includes>
I like it :)
Just an idea..
The only thing which is missing is to also emit dependencies to the
object files from libbb.a (L_*()).
[ libbb et al provide functions. Each file in libbb may either contain a
single function, or several functions. In the latter case for each symbol
in the .c file, one obj is created (see the L_* defines) and added to
the archive. Linking does/may discard unreferenced symbols so all unused
symbols will not take up space in the final binary. ]
Provided with these dependencies, we can build a static libbb.a which
only includes the functions which are actually _used_ by the selected
applets thus decreasing the compile-time of the static busybox binary
(resp it's static libraries) quite a lot.
As said, just an idea..
>>
>>Very fast, very trivial. config/*.h file updated if .config key real
>>changed.
cheers,
More information about the busybox
mailing list