Am Mittwoch, den 12.02.2014, 12:30 -0600 schrieb mrnuke:
Thoughts,
No.
comments,
Really?
concerns,
I like solving things at compile time that can be solved at compile time (and in fact even earlier, if possible). No need to store "Mister stole my lollipop" if the board is guaranteed to ship with one.
A simple solution to your problem would be to store everything as AST in object files and letting the linker resolv everything - that would fit your "static library" requirement while still having Kconfig options work. So it's rather arbitrary. (and the fun thing is, our toolchain is even capable of that given the right switches, so it's not purely theoretical)
Having a coreboot that determines at runtime again and again and again what kind of device it's running on is quite a departure from the design so far.
Also, to dissect your example, what's the difference between: void function(bool has_lollipop) { if (has_lollipop) printk(BIOS_YUMMY, "Sucking on a lollipop\n"); else printk(BIOS_INFO, "Mister stole my lollipop\n"); }
and
void function(bool has_lollipop) { if (CONFIG_EXISTS(CONFIG_HAS_LOLLIPOP)) printk(BIOS_YUMMY, "Sucking on a lollipop\n"); else printk(BIOS_INFO, "Mister stole my lollipop\n"); }
from a stilistic point of view? (except for the upper case - which we could fix, if we want...) It's a huge difference in what ends up in the binary.
paint ideas?
Turquoise, please.
Patrick