I was following example 2 of the OpenWRT examples (https://github.com/mwarning/openwrt-examples) and have a question about the config.in in this example.
Contents of config.in:
menu "Configuration"
depends on PACKAGE_example2a
config EXAMPLE2_ENABLE_FOO
bool "Enable Feature Foo"
depends on PACKAGE_example2a
default y
config EXAMPLE2_ENABLE_BAR
bool "Enable feature Bar"
depends on PACKAGE_example2a
default n
endmenu
The application Example2 contains the following:
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hi, this is example2.\n");
#if defined(FOO)
printf("Feature foo was selected.\n");
#endif
#if defined(BAR)
printf("Feature bar was selected.\n");
#endif
}
Based on the description in the example and what I see, this gives 2 sub-options Foo and Bar when running "make menuconfig" and select the Example2 package.
However, after selecting an option (either Foo or Bar), after "make" and run the program (in a VDI image running Virtual Box), it always prints only the first line ("this is example 2"), and none of the "Feature X was selected" lines was printed.
Am I correct in expecting that once you select an option (Foo or Bar), this would become a flag at compilation time so the compiled code would contain the corresponding "Feature X was selected" line ?
And why am I not seeing "Feature X was selected" regardless of the option I chose ?
Thanks