1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
---
confdata.c | 57 +++++++++++++++++++++++++++++----------------------------
lkc.h | 2 +-
menu.c | 2 +-
3 files changed, 31 insertions(+), 30 deletions(-)
Index: config/confdata.c
===================================================================
--- config.orig/confdata.c
+++ config/confdata.c
@@ -12,6 +12,7 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <libgen.h>
#define LKC_DIRECT_LINK
#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";
}
@@ -249,20 +250,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;
}
@@ -278,8 +279,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;
@@ -290,13 +291,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;
}
@@ -423,9 +424,9 @@
{
int l;
if (headerfile)
- fprintf(out, "#define %s%s \"", CONFIG_, name);
+ fprintf(out, "#define %s \"", name);
else
- fprintf(out, "%s%s=\"", CONFIG_, name);
+ fprintf(out, "%s=\"", name);
while (1) {
l = strcspn(str, "\"\\");
@@ -450,14 +451,14 @@
switch (sym_get_tristate_value(sym)) {
case no:
if (write_no)
- fprintf(out, "# %s%s is not set\n",
- CONFIG_, sym->name);
+ fprintf(out, "# %s is not set\n",
+ sym->name);
break;
case mod:
- fprintf(out, "%s%s=m\n", CONFIG_, sym->name);
+ fprintf(out, "%s=m\n", sym->name);
break;
case yes:
- fprintf(out, "%s%s=y\n", CONFIG_, sym->name);
+ fprintf(out, "%s=y\n", sym->name);
break;
}
break;
@@ -467,7 +468,7 @@
case S_HEX:
case S_INT:
str = sym_get_string_value(sym);
- fprintf(out, "%s%s=%s\n", CONFIG_, sym->name, str);
+ fprintf(out, "%s=%s\n", sym->name, str);
break;
case S_OTHER:
case S_UNKNOWN:
@@ -844,17 +845,17 @@
case no:
break;
case mod:
- fprintf(tristate, "%s%s=M\n",
- CONFIG_, sym->name);
- fprintf(out_h, "#define %s%s_MODULE 1\n",
- CONFIG_, sym->name);
+ fprintf(tristate, "%s=M\n",
+ sym->name);
+ fprintf(out_h, "#define %s_MODULE 1\n",
+ sym->name);
break;
case yes:
if (sym->type == S_TRISTATE)
- fprintf(tristate,"%s%s=Y\n",
- CONFIG_, sym->name);
- fprintf(out_h, "#define %s%s 1\n",
- CONFIG_, sym->name);
+ fprintf(tristate,"%s=Y\n",
+ sym->name);
+ fprintf(out_h, "#define %s 1\n",
+ sym->name);
break;
}
break;
@@ -864,14 +865,14 @@
case S_HEX:
str = sym_get_string_value(sym);
if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
- fprintf(out_h, "#define %s%s 0x%s\n",
- CONFIG_, sym->name, str);
+ fprintf(out_h, "#define %s 0x%s\n",
+ sym->name, str);
break;
}
case S_INT:
str = sym_get_string_value(sym);
- fprintf(out_h, "#define %s%s %s\n",
- CONFIG_, sym->name, str);
+ fprintf(out_h, "#define %s %s\n",
+ sym->name, str);
break;
default:
break;
Index: config/lkc.h
===================================================================
--- config.orig/lkc.h
+++ config/lkc.h
@@ -42,7 +42,7 @@
#define N_(text) (text)
#ifndef CONFIG_
-#define CONFIG_ "CONFIG_"
+#define CONFIG_ "BR2_"
#endif
#define TF_COMMAND 0x0001
Index: config/menu.c
===================================================================
--- config.orig/menu.c
+++ config/menu.c
@@ -597,7 +597,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);
str_append(help, _(menu_get_help(menu)));
str_append(help, "\n");
}
|