From 779b99c42bae1e503efb8a6ee2dd90fdbae896b5 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 18 Nov 2020 21:06:16 -0500 Subject: [PATCH] kconfiglib: Update kconfiglib.py to always emit symbols Emit all symbols (even ones disabled) to the autoconf.h header file. Signed-off-by: Kevin O'Connor --- lib/kconfiglib/kconfiglib.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/kconfiglib/kconfiglib.py b/lib/kconfiglib/kconfiglib.py index c67895ce..fb5e4b76 100644 --- a/lib/kconfiglib/kconfiglib.py +++ b/lib/kconfiglib/kconfiglib.py @@ -1475,8 +1475,8 @@ class Kconfig(object): # instead, to avoid accessing the internal _write_to_conf variable # (though it's likely to keep working). val = sym.str_value - if not sym._write_to_conf: - continue + #if not sym._write_to_conf: + # continue if sym.orig_type in _BOOL_TRISTATE: if val == "y": @@ -1485,6 +1485,9 @@ class Kconfig(object): elif val == "m": add("#define {}{}_MODULE 1\n" .format(self.config_prefix, sym.name)) + else: + add("#define {}{} 0\n" + .format(self.config_prefix, sym.name)) elif sym.orig_type is STRING: add('#define {}{} "{}"\n' @@ -1494,6 +1497,8 @@ class Kconfig(object): if sym.orig_type is HEX and \ not val.startswith(("0x", "0X")): val = "0x" + val + if not val: + val = "0" add("#define {}{} {}\n" .format(self.config_prefix, sym.name, val))