[BusyBox] builtin echo for ash

Mike Frysinger vapier at gentoo.org
Sun Aug 7 00:46:01 UTC 2005


On Saturday 06 August 2005 11:55 am, Paul Fox wrote:
>  > >  > > one other implementation question:  moving the echo code into
>  > >  > > libbb/bb_echo.c now requires that CONFIG_FANCY_ECHO be accessible
>  > >  > > from somewhere other than just the coreutils config menu, since
>  > >  > > you might want to configure the builtin echo without configuring
>  > >  > > the echo applet.  i wasn't sure how to handle this, so i simply
>  > >  > > duplicated the CONFIG_FANCY_ECHO option into the ash config menu.
>  > >  > > this isn't right -- what should i do instead?
>  > >  >
>  > >  > i dont think the duplication will be that big of a deal ... but i
>  > >  > dont
>  > >
>  > > know
>  > >
>  > >  > kconfig will handle it :)
>  > >
>  > > busybox menuconfig handles it surprisingly well -- not only does
>  > > it only emit one instance of the option, but it's impossible to
>  > > set the two instances of the option to different values.  whether
>  > > it was intentional or not, it's exactly the right behavior.  i just
>  > > don't like duplicating the menu text in two places.
>  >
>  > you could create a config option (ex. CONFIG_BB_ECHO) that is not
>  > selectable by menuconfig and use select CONFIG_BB_ECHO for the 2 cases
>  > you need it
>
> i'm not sure i quite follow what you're suggesting.  i think it's important
> to be able to configure the applet and the builtin separately.  i suspect
> the easiest/safest/least surprising thing to do is just what i've done --
> duplicate the Config.in menu entries, and comment the duplication.

i'm pretty sure he's talking about back end changes here ... frontend would be 
the same for the user ...

config CONFIG_COREUTILS_ECHO
    bool "echo"
    select CONFIG_ECHO
...
config CONFIG_ASH_ECHO
    bool "echo"
    select CONFIG_ECHO
...

and then in the source code, we would use CONFIG_ECHO to determine whether to 
include bb_echo()
-mike



More information about the busybox mailing list