-Switch CONFIG_SYMBOLS to ENABLE_SYMBOLS
-
- In busybox 1.0 and earlier, configuration was done by CONFIG_SYMBOLS
- that were either defined or undefined to indicate whether the symbol was
- selected in the .config file. They were used with #ifdefs, ala:
-
- #ifdef CONFIG_SYMBOL
- if (other_test) {
- do_code();
- }
- #endif
-
- In 1.1, we have new ENABLE_SYMBOLS which are always defined (as 0 or 1),
- meaning you can still use them for preprocessor tests by replacing
- "#ifdef CONFIG_SYMBOL" with "#if ENABLE_SYMBOL". But more importantly, we
- can use them as a true or false test in normal C code:
-
- if (ENABLE_SYMBOL && other_test) {
- do_code();
- }
-
- (Optimizing away if() statements that resolve to a constant value
- is known as "dead code elimination", an optimization so old and simple that
- Turbo Pascal for DOS did it twenty years ago. Even modern mini-compilers
- like the Tiny C Compiler (tcc) and the Small Device C Compiler (SDCC)
- perform dead code elimination.)
-
- Right now, busybox.h is #including both "config.h" (defining the
- CONFIG_SYMBOLS) and "bb_config.h" (defining the ENABLE_SYMBOLS). At some
- point in the future, it would be nice to wean ourselves off of the
- CONFIG versions. (Among other things, some defective build environments
- leak the Linux kernel's CONFIG_SYMBOLS into the system's standard #include
- files. We've experienced collisions before.)
----