kumquat-buildroot/support/kconfig/patches/03-change-config-option-prefix.patch
Thomas Petazzoni 6997e461fd support/kconfig: upgrade to 3.9-rc2
Our kconfig code is updated to the version of kernel 3.9-rc2. No major
issues during the migration, except:

 * Some conflicts when applying 03-change-config-option-prefix.patch
   due to upstream kernel changes.

 * The need of adding a new patch, 15-fix-qconf-moc-rule.patch, to fix
   the make rule that generates the moc file for the Qt-based
   interface.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-11 09:30:39 +02:00

173 lines
4.0 KiB
Diff

---
confdata.c | 57 +++++++++++++++++++++++++++++----------------------------
lkc.h | 2 +-
menu.c | 2 +-
3 files changed, 31 insertions(+), 30 deletions(-)
Index: b/confdata.c
===================================================================
--- a/confdata.c
+++ b/confdata.c
@@ -13,6 +13,7 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <libgen.h>
#include "lkc.h"
@@ -25,7 +26,7 @@
static const char *conf_filename;
static int conf_lineno, conf_warnings, conf_unsaved;
-const char conf_defname[] = "arch/$ARCH/defconfig";
+const char conf_defname[] = ".defconfig";
static void conf_warning(const char *fmt, ...)
{
@@ -63,7 +64,7 @@
const char *conf_get_configname(void)
{
- char *name = getenv("KCONFIG_CONFIG");
+ char *name = getenv("BUILDROOT_CONFIG");
return name ? name : ".config";
}
@@ -309,20 +310,20 @@
if (line[0] == '#') {
if (memcmp(line + 2, CONFIG_, strlen(CONFIG_)))
continue;
- p = strchr(line + 2 + strlen(CONFIG_), ' ');
+ p = strchr(line + 2, ' ');
if (!p)
continue;
*p++ = 0;
if (strncmp(p, "is not set", 10))
continue;
if (def == S_DEF_USER) {
- sym = sym_find(line + 2 + strlen(CONFIG_));
+ sym = sym_find(line + 2);
if (!sym) {
sym_add_change_count(1);
goto setsym;
}
} else {
- sym = sym_lookup(line + 2 + strlen(CONFIG_), 0);
+ sym = sym_lookup(line + 2, 0);
if (sym->type == S_UNKNOWN)
sym->type = S_BOOLEAN;
}
@@ -338,8 +339,8 @@
default:
;
}
- } else if (memcmp(line, CONFIG_, strlen(CONFIG_)) == 0) {
- p = strchr(line + strlen(CONFIG_), '=');
+ } else if (isupper(line[0])) {
+ p = strchr(line, '=');
if (!p)
continue;
*p++ = 0;
@@ -350,13 +351,13 @@
*p2 = 0;
}
if (def == S_DEF_USER) {
- sym = sym_find(line + strlen(CONFIG_));
+ sym = sym_find(line);
if (!sym) {
sym_add_change_count(1);
goto setsym;
}
} else {
- sym = sym_lookup(line + strlen(CONFIG_), 0);
+ sym = sym_lookup(line, 0);
if (sym->type == S_UNKNOWN)
sym->type = S_OTHER;
}
@@ -484,8 +485,8 @@
bool skip_unset = (arg != NULL);
if (!skip_unset)
- fprintf(fp, "# %s%s is not set\n",
- CONFIG_, sym->name);
+ fprintf(fp, "# %s is not set\n",
+ sym->name);
return;
}
break;
@@ -493,7 +494,7 @@
break;
}
- fprintf(fp, "%s%s=%s\n", CONFIG_, sym->name, value);
+ fprintf(fp, "%s=%s\n", sym->name, value);
}
static void
@@ -543,8 +544,8 @@
suffix = "_MODULE";
/* fall through */
default:
- fprintf(fp, "#define %s%s%s 1\n",
- CONFIG_, sym->name, suffix);
+ fprintf(fp, "#define %s%s 1\n",
+ sym->name, suffix);
}
break;
}
@@ -553,14 +554,14 @@
if (value[0] != '0' || (value[1] != 'x' && value[1] != 'X'))
prefix = "0x";
- fprintf(fp, "#define %s%s %s%s\n",
- CONFIG_, sym->name, prefix, value);
+ fprintf(fp, "#define %s %s%s\n",
+ sym->name, prefix, value);
break;
}
case S_STRING:
case S_INT:
- fprintf(fp, "#define %s%s %s\n",
- CONFIG_, sym->name, value);
+ fprintf(fp, "#define %s %s\n",
+ sym->name, value);
break;
default:
break;
@@ -606,7 +607,7 @@
{
if (sym->type == S_TRISTATE && *value != 'n')
- fprintf(fp, "%s%s=%c\n", CONFIG_, sym->name, (char)toupper(*value));
+ fprintf(fp, "%s=%c\n", sym->name, (char)toupper(*value));
}
static struct conf_printer tristate_printer_cb =
Index: b/lkc.h
===================================================================
--- a/lkc.h
+++ b/lkc.h
@@ -37,7 +37,7 @@
#define N_(text) (text)
#ifndef CONFIG_
-#define CONFIG_ "CONFIG_"
+#define CONFIG_ "BR2_"
#endif
static inline const char *CONFIG_prefix(void)
{
Index: b/menu.c
===================================================================
--- a/menu.c
+++ b/menu.c
@@ -635,7 +635,7 @@
if (menu_has_help(menu)) {
if (sym->name)
- str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
+ str_printf(help, "%s:\n\n", sym->name);
help_text = menu_get_help(menu);
}
str_printf(help, "%s\n", _(help_text));