Commit 67957803 authored by Adam Wujek's avatar Adam Wujek 💬

sw:rt:scripts:kconfig: for bool config items generate HAS_ defines

Useful for embedded software to avoid inclusion of not used code,
which code will be compiled no matter the Kconfig item was selected or
not. It should guarantee at least compiling code.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent f6f2b5b9
......@@ -549,6 +549,8 @@ header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
switch (*value) {
case 'n':
fprintf(fp, "#define %s%s%s 0\n",
HAS_, sym->name, suffix);
break;
case 'm':
suffix = "_MODULE";
......@@ -556,6 +558,8 @@ header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
default:
fprintf(fp, "#define %s%s%s 1\n",
CONFIG_, sym->name, suffix);
fprintf(fp, "#define %s%s%s 1\n",
HAS_, sym->name, suffix);
}
break;
}
......
......@@ -34,6 +34,10 @@ extern "C" {
#define _(text) gettext(text)
#define N_(text) (text)
#ifndef HAS_
#define HAS_ "HAS_"
#endif
#ifndef CONFIG_
#define CONFIG_ "CONFIG_"
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment