portability touch-up (and ~15k size-savings)

Bernhard Fischer rep.nop at aon.at
Thu May 25 20:13:33 UTC 2006


On Thu, May 25, 2006 at 03:40:33PM -0400, Rich Felker wrote:
>On Thu, May 25, 2006 at 06:26:35PM +0200, Bernhard Fischer wrote:
>> Hi,
>> 
>> I have introduced one central knob to turn off long options..
>> 
>>    text	   data	    bss	    dec	    hex	filename
>>  881507	  11420	 646244	1539171	 177c63	busybox_old
>>  866387	  11196	 645732	1523315	 173e73	busybox.no_getopt_long
>> 
>> This patch is part of my ongoing effort to make busybox a little more
>> portable (resp. less linux-centric).
>> Unfortunately the portability diff is getting relatively big
>> (69962 bytes)..
>
>:)))))
>
>I like this direction. Is your combined portability diff based on lots
>of the patches I've sent, or other things you've found?

It's solely other stuff (looks like i managed to forget to attach it the
first time; attached now -- including the run_parts shrink).
I need to look at fixing getopt_ulflags to ignore long options (resp
getopt_long) before i can apply these snippets, and the final version
may drop the -D__need_getopt, although i'd prefer to leave that in for
sanity.
>
>BTW about getopt_long... it might be worth dropping getopt entirely
>and making a lightweight libbb function for handling options (both
>short and long). The bloated GNU permutation thing is only needed if
>the calling app wants to use the standard getopt loop idiom for
>command line parsing; without that requirement the code could probably
>be much smaller and still duplicate the commandline semantics.

Not sure about the details (i.e. what *is* 'the reordering'? Never
bothered to actually look ;) but aren't most of the applets relying on
arbitrary ordering of the args?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bb.portability.09c.diff.bz2
Type: application/octet-stream
Size: 17316 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060525/b9934457/attachment.obj 


More information about the busybox mailing list