Change kconfig to emit disabled symbols in autoconf.h.
authorKevin O'Connor <kevin@koconnor.net>
Thu, 27 Jan 2011 01:09:39 +0000 (20:09 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 29 Jan 2011 14:44:24 +0000 (09:44 -0500)
Always emit CONFIG_X definitions in autoconf.h - set them to 0 when
they are disabled.

tools/kconfig/confdata.c

index 61c35bf2d9cb93d690a40eafb0227006bec46151..f110bf56b2c9cc5c505e92706e3dc7cb26c1633d 100644 (file)
@@ -830,8 +830,15 @@ int conf_write_autoconf(void)
 
        for_all_symbols(i, sym) {
                sym_calc_value(sym);
-               if (!(sym->flags & SYMBOL_WRITE) || !sym->name)
+               if (!sym->name)
                        continue;
+               if (!(sym->flags & SYMBOL_WRITE)) {
+                       if (sym->type == S_BOOLEAN || sym->type == S_HEX
+                           || sym->type == S_INT)
+                               fprintf(out_h, "#define %s%s 0\n",
+                                       CONFIG_, sym->name);
+                       continue;
+               }
 
                /* write symbol to config file */
                conf_write_symbol(sym, out, false);
@@ -842,6 +849,8 @@ int conf_write_autoconf(void)
                case S_TRISTATE:
                        switch (sym_get_tristate_value(sym)) {
                        case no:
+                               fprintf(out_h, "#define %s%s 0\n",
+                                   CONFIG_, sym->name);
                                break;
                        case mod:
                                fprintf(tristate, "%s%s=M\n",