[U-Boot] [RFC PATCH] Provide a mechanism to avoid using #ifdef everywhere

Wolfgang Denk
2013-02-19T19:14:12Z

Dear Simon Glass,

In message <CAPnjgZ2NvwAB0t4v=41BaVxqMaCgAU7XBTTbM1ZRT0fTA_40tA@mail.gmail.com> you wrote:
>
> > You are wrong. This includes a number of functions, and macros, too,
> > for example:
...
> That's a very manageable and small series of patches I think if we
> want to use either. I do like an obvious name, and we already have
> CONFIG_...

I think we really need to define a new, so far unused name space for
these, and reserve it for such purpose.

> Yes this will definitely increase the time. The current brute force
> 'sed' of all headers isn't very efficient. How impossible would it be
> to regenerate this only when someone adds a new CONFIG, and then check
> it into the source?

Doesn't work - assume you are hacking on your new code (without
checking in) - and if runs haywire because the needed re-scan is not
done...

> > Does not the already existing "include/autoconf.mk" contain this
> > information? In any case, please check "tools/scripts/define2mk.sed"
>
> It only has a list of CONFIG variables that are enabled for the board.
> The C code will then get compile errors if it uses a config that is
> not enabled. So we need to define all the others to be 0 so that the
> code still compiles.

I see.

Thanks.

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The human race is faced with a cruel choice: work or daytime tele-
vision.