pass HOST_ variables, not BUILD_
[buildroot.git] / package / config / kconfig-to-buildroot2.patch
blob0651641ee8844c898218435bf8859448522fee61
1 diff -rduNp config.new.oorig/Makefile config.new/Makefile
2 --- config.new.oorig/Makefile 2008-04-07 11:03:28.000000000 +0200
3 +++ config.new/Makefile 2008-04-07 11:06:30.000000000 +0200
4 @@ -123,6 +123,9 @@ hostprogs-y := conf qconf gconf kxgettex
5 ifeq ($(MAKECMDGOALS),menuconfig)
6 hostprogs-y += mconf
7 endif
8 +ifeq ($(findstring mconf,$(MAKECMDGOALS)),mconf)
9 + hostprogs-y += mconf
10 +endif
12 ifeq ($(MAKECMDGOALS),xconfig)
13 qconf-target := 1
14 @@ -181,8 +184,8 @@ $(obj)/.tmp_qtcheck:
15 done; \
16 if [ -z "$$dir" ]; then \
17 echo "*"; \
18 - echo "* Unable to find the QT3 installation. Please make sure that"; \
19 - echo "* the QT3 development package is correctly installed and"; \
20 + echo "* Unable to find the QT installation. Please make sure that"; \
21 + echo "* the QT development package is correctly installed and"; \
22 echo "* either install pkg-config or set the QTDIR environment"; \
23 echo "* variable to the correct location."; \
24 echo "*"; \
25 diff -rduNp config.new.oorig/conf.c config.new/conf.c
26 --- config.new.oorig/conf.c 2008-04-07 11:03:28.000000000 +0200
27 +++ config.new/conf.c 2008-04-07 11:06:30.000000000 +0200
28 @@ -545,7 +545,7 @@ int main(int ac, char **av)
29 exit(1);
31 conf_parse(name);
32 - //zconfdump(stdout);
33 + /*zconfdump(stdout);*/
34 switch (input_mode) {
35 case set_default:
36 if (!defconfig_file)
37 @@ -560,11 +560,11 @@ int main(int ac, char **av)
38 case ask_silent:
39 if (stat(".config", &tmpstat)) {
40 printf(_("***\n"
41 - "*** You have not yet configured your kernel!\n"
42 - "*** (missing kernel .config file)\n"
43 + "*** You have not yet configured Buildroot!\n"
44 + "*** (missing .config file)\n"
45 "***\n"
46 "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
47 - "*** \"make menuconfig\" or \"make xconfig\").\n"
48 + "*** \"make menuconfig\" or \"make config\").\n"
49 "***\n"));
50 exit(1);
52 @@ -607,7 +607,7 @@ int main(int ac, char **av)
53 } else if (conf_get_changed()) {
54 name = getenv("KCONFIG_NOSILENTUPDATE");
55 if (name && *name) {
56 - fprintf(stderr, _("\n*** Kernel configuration requires explicit update.\n\n"));
57 + fprintf(stderr, _("\n*** Buildroot configuration requires explicit update.\n\n"));
58 return 1;
60 } else
61 @@ -618,12 +618,12 @@ int main(int ac, char **av)
62 check_conf(&rootmenu);
63 } while (conf_cnt);
64 if (conf_write(NULL)) {
65 - fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
66 + fprintf(stderr, _("\n*** Error during writing of the Buildroot configuration.\n\n"));
67 return 1;
69 skip_check:
70 - if (input_mode == ask_silent && conf_write_autoconf()) {
71 - fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
72 + if (/*input_mode == ask_silent &&*/ conf_write_autoconf()) {
73 + fprintf(stderr, _("\n*** Error during writing of the Buildroot configuration.\n\n"));
74 return 1;
77 diff -rduNp config.new.oorig/confdata.c config.new/confdata.c
78 --- config.new.oorig/confdata.c 2008-04-07 11:03:28.000000000 +0200
79 +++ config.new/confdata.c 2008-04-07 11:06:30.000000000 +0200
80 @@ -11,6 +11,7 @@
81 #include <string.h>
82 #include <time.h>
83 #include <unistd.h>
84 +#include <libgen.h>
86 #define LKC_DIRECT_LINK
87 #include "lkc.h"
88 @@ -21,7 +22,7 @@ static void conf_warning(const char *fmt
89 static const char *conf_filename;
90 static int conf_lineno, conf_warnings, conf_unsaved;
92 -const char conf_defname[] = "arch/$ARCH/defconfig";
93 +const char conf_defname[] = ".defconfig";
95 static void conf_warning(const char *fmt, ...)
97 @@ -36,7 +37,7 @@ static void conf_warning(const char *fmt
99 const char *conf_get_configname(void)
101 - char *name = getenv("KCONFIG_CONFIG");
102 + char *name = getenv("BUILDROOT_CONFIG");
104 return name ? name : ".config";
106 @@ -212,22 +213,22 @@ load:
107 sym = NULL;
108 switch (line[0]) {
109 case '#':
110 - if (memcmp(line + 2, "CONFIG_", 7))
111 + if (line[1]!=' ')
112 continue;
113 - p = strchr(line + 9, ' ');
114 + p = strchr(line + 2, ' ');
115 if (!p)
116 continue;
117 *p++ = 0;
118 if (strncmp(p, "is not set", 10))
119 continue;
120 if (def == S_DEF_USER) {
121 - sym = sym_find(line + 9);
122 + sym = sym_find(line + 2);
123 if (!sym) {
124 - conf_warning("trying to assign nonexistent symbol %s", line + 9);
125 + conf_warning("trying to assign nonexistent symbol %s", line + 2);
126 break;
128 } else {
129 - sym = sym_lookup(line + 9, 0);
130 + sym = sym_lookup(line + 2, 0);
131 if (sym->type == S_UNKNOWN)
132 sym->type = S_BOOLEAN;
134 @@ -245,12 +246,8 @@ load:
137 break;
138 - case 'C':
139 - if (memcmp(line, "CONFIG_", 7)) {
140 - conf_warning("unexpected data");
141 - continue;
143 - p = strchr(line + 7, '=');
144 + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z':
145 + p = strchr(line, '=');
146 if (!p)
147 continue;
148 *p++ = 0;
149 @@ -261,13 +258,13 @@ load:
150 *p2 = 0;
152 if (def == S_DEF_USER) {
153 - sym = sym_find(line + 7);
154 + sym = sym_find(line);
155 if (!sym) {
156 - conf_warning("trying to assign nonexistent symbol %s", line + 7);
157 + conf_warning("trying to assign nonexistent symbol %s", line);
158 break;
160 } else {
161 - sym = sym_lookup(line + 7, 0);
162 + sym = sym_lookup(line, 0);
163 if (sym->type == S_UNKNOWN)
164 sym->type = S_OTHER;
166 @@ -440,7 +437,7 @@ int conf_write(const char *name)
167 if (!out)
168 return 1;
170 - sym = sym_lookup("KERNELVERSION", 0);
171 + sym = sym_lookup("BR2_VERSION", 0);
172 sym_calc_value(sym);
173 time(&now);
174 env = getenv("KCONFIG_NOTIMESTAMP");
175 @@ -449,10 +446,8 @@ int conf_write(const char *name)
177 fprintf(out, _("#\n"
178 "# Automatically generated make config: don't edit\n"
179 - "# Linux kernel version: %s\n"
180 "%s%s"
181 "#\n"),
182 - sym_get_string_value(sym),
183 use_timestamp ? "# " : "",
184 use_timestamp ? ctime(&now) : "");
186 @@ -486,19 +481,19 @@ int conf_write(const char *name)
187 case S_TRISTATE:
188 switch (sym_get_tristate_value(sym)) {
189 case no:
190 - fprintf(out, "# CONFIG_%s is not set\n", sym->name);
191 + fprintf(out, "# %s is not set\n", sym->name);
192 break;
193 case mod:
194 - fprintf(out, "CONFIG_%s=m\n", sym->name);
195 + fprintf(out, "%s=m\n", sym->name);
196 break;
197 case yes:
198 - fprintf(out, "CONFIG_%s=y\n", sym->name);
199 + fprintf(out, "%s=y\n", sym->name);
200 break;
202 break;
203 case S_STRING:
204 str = sym_get_string_value(sym);
205 - fprintf(out, "CONFIG_%s=\"", sym->name);
206 + fprintf(out, "%s=\"", sym->name);
207 while (1) {
208 l = strcspn(str, "\"\\");
209 if (l) {
210 @@ -514,12 +509,12 @@ int conf_write(const char *name)
211 case S_HEX:
212 str = sym_get_string_value(sym);
213 if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
214 - fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
215 + fprintf(out, "%s=%s\n", sym->name, str);
216 break;
218 case S_INT:
219 str = sym_get_string_value(sym);
220 - fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
221 + fprintf(out, "%s=%s\n", sym->name, str);
222 break;
225 @@ -559,7 +554,7 @@ int conf_write(const char *name)
227 int conf_split_config(void)
229 - char *name, path[128];
230 + char *name, path[128], *opwd, *dir, *_name;
231 char *s, *d, c;
232 struct symbol *sym;
233 struct stat sb;
234 @@ -570,8 +565,20 @@ int conf_split_config(void)
235 name = "include/config/auto.conf";
236 conf_read_simple(name, S_DEF_AUTO);
238 - if (chdir("include/config"))
239 + opwd = malloc(256);
240 + _name = strdup(name);
241 + if (opwd == NULL || _name == NULL)
242 return 1;
243 + opwd = getcwd(opwd, 256);
244 + dir = dirname(_name);
245 + if (dir == NULL) {
246 + res = 1;
247 + goto err;
249 + if (chdir(dir)) {
250 + res = 1;
251 + goto err;
254 res = 0;
255 for_all_symbols(i, sym) {
256 @@ -664,9 +671,11 @@ int conf_split_config(void)
257 close(fd);
259 out:
260 - if (chdir("../.."))
261 - return 1;
263 + if (chdir(opwd))
264 + res = 1;
265 +err:
266 + free(opwd);
267 + free(_name);
268 return res;
271 @@ -681,7 +690,7 @@ int conf_write_autoconf(void)
273 sym_clear_all_valid();
275 - file_write_dep("include/config/auto.conf.cmd");
276 + file_write_dep(".config.cmd");
278 if (conf_split_config())
279 return 1;
280 @@ -696,22 +705,19 @@ int conf_write_autoconf(void)
281 return 1;
284 - sym = sym_lookup("KERNELVERSION", 0);
285 + sym = sym_lookup("BR2_VERSION", 0);
286 sym_calc_value(sym);
287 time(&now);
288 fprintf(out, "#\n"
289 "# Automatically generated make config: don't edit\n"
290 - "# Linux kernel version: %s\n"
291 "# %s"
292 "#\n",
293 - sym_get_string_value(sym), ctime(&now));
294 + ctime(&now));
295 fprintf(out_h, "/*\n"
296 " * Automatically generated C config: don't edit\n"
297 - " * Linux kernel version: %s\n"
298 " * %s"
299 - " */\n"
300 - "#define AUTOCONF_INCLUDED\n",
301 - sym_get_string_value(sym), ctime(&now));
302 + " */\n",
303 + ctime(&now));
305 for_all_symbols(i, sym) {
306 sym_calc_value(sym);
307 @@ -724,19 +730,19 @@ int conf_write_autoconf(void)
308 case no:
309 break;
310 case mod:
311 - fprintf(out, "CONFIG_%s=m\n", sym->name);
312 - fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name);
313 + fprintf(out, "%s=m\n", sym->name);
314 + fprintf(out_h, "#define %s_MODULE 1\n", sym->name);
315 break;
316 case yes:
317 - fprintf(out, "CONFIG_%s=y\n", sym->name);
318 - fprintf(out_h, "#define CONFIG_%s 1\n", sym->name);
319 + fprintf(out, "%s=y\n", sym->name);
320 + fprintf(out_h, "#define %s 1\n", sym->name);
321 break;
323 break;
324 case S_STRING:
325 str = sym_get_string_value(sym);
326 - fprintf(out, "CONFIG_%s=\"", sym->name);
327 - fprintf(out_h, "#define CONFIG_%s \"", sym->name);
328 + fprintf(out, "%s=\"", sym->name);
329 + fprintf(out_h, "#define %s \"", sym->name);
330 while (1) {
331 l = strcspn(str, "\"\\");
332 if (l) {
333 @@ -756,14 +762,14 @@ int conf_write_autoconf(void)
334 case S_HEX:
335 str = sym_get_string_value(sym);
336 if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
337 - fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
338 - fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str);
339 + fprintf(out, "%s=%s\n", sym->name, str);
340 + fprintf(out_h, "#define %s 0x%s\n", sym->name, str);
341 break;
343 case S_INT:
344 str = sym_get_string_value(sym);
345 - fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
346 - fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str);
347 + fprintf(out, "%s=%s\n", sym->name, str);
348 + fprintf(out_h, "#define %s %s\n", sym->name, str);
349 break;
350 default:
351 break;
352 diff -rduNp config.new.oorig/expr.c config.new/expr.c
353 --- config.new.oorig/expr.c 2008-04-07 11:03:28.000000000 +0200
354 +++ config.new/expr.c 2008-04-07 11:06:30.000000000 +0200
355 @@ -331,7 +331,7 @@ struct expr *expr_trans_bool(struct expr
356 e->right.expr = expr_trans_bool(e->right.expr);
357 break;
358 case E_UNEQUAL:
359 - // FOO!=n -> FOO
360 + /* FOO!=n -> FOO */
361 if (e->left.sym->type == S_TRISTATE) {
362 if (e->right.sym == &symbol_no) {
363 e->type = E_SYMBOL;
364 @@ -380,19 +380,19 @@ struct expr *expr_join_or(struct expr *e
365 if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
366 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
367 (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) {
368 - // (a='y') || (a='m') -> (a!='n')
369 + /* (a='y') || (a='m') -> (a!='n') */
370 return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_no);
372 if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
373 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
374 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) {
375 - // (a='y') || (a='n') -> (a!='m')
376 + /* (a='y') || (a='n') -> (a!='m') */
377 return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_mod);
379 if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
380 ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
381 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) {
382 - // (a='m') || (a='n') -> (a!='y')
383 + /* (a='m') || (a='n') -> (a!='y') */
384 return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes);
387 @@ -443,29 +443,29 @@ struct expr *expr_join_and(struct expr *
389 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) ||
390 (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes))
391 - // (a) && (a='y') -> (a='y')
392 + /* (a) && (a='y') -> (a='y') */
393 return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
395 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) ||
396 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no))
397 - // (a) && (a!='n') -> (a)
398 + /* (a) && (a!='n') -> (a) */
399 return expr_alloc_symbol(sym1);
401 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) ||
402 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod))
403 - // (a) && (a!='m') -> (a='y')
404 + /* (a) && (a!='m') -> (a='y') */
405 return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
407 if (sym1->type == S_TRISTATE) {
408 if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) {
409 - // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
410 + /* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */
411 sym2 = e1->right.sym;
412 if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
413 return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
414 : expr_alloc_symbol(&symbol_no);
416 if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) {
417 - // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
418 + /* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */
419 sym2 = e2->right.sym;
420 if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
421 return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
422 @@ -474,19 +474,19 @@ struct expr *expr_join_and(struct expr *
423 if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
424 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
425 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes)))
426 - // (a!='y') && (a!='n') -> (a='m')
427 + /* (a!='y') && (a!='n') -> (a='m') */
428 return expr_alloc_comp(E_EQUAL, sym1, &symbol_mod);
430 if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
431 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
432 (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes)))
433 - // (a!='y') && (a!='m') -> (a='n')
434 + /* (a!='y') && (a!='m') -> (a='n') */
435 return expr_alloc_comp(E_EQUAL, sym1, &symbol_no);
437 if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
438 ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
439 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod)))
440 - // (a!='m') && (a!='n') -> (a='m')
441 + /* (a!='m') && (a!='n') -> (a='m') */
442 return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
444 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) ||
445 @@ -579,7 +579,7 @@ static void expr_eliminate_dups2(enum ex
446 switch (e1->type) {
447 case E_OR:
448 expr_eliminate_dups2(e1->type, &e1, &e1);
449 - // (FOO || BAR) && (!FOO && !BAR) -> n
450 + /* (FOO || BAR) && (!FOO && !BAR) -> n */
451 tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
452 tmp2 = expr_copy(e2);
453 tmp = expr_extract_eq_and(&tmp1, &tmp2);
454 @@ -594,7 +594,7 @@ static void expr_eliminate_dups2(enum ex
455 break;
456 case E_AND:
457 expr_eliminate_dups2(e1->type, &e1, &e1);
458 - // (FOO && BAR) || (!FOO || !BAR) -> y
459 + /* (FOO && BAR) || (!FOO || !BAR) -> y */
460 tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
461 tmp2 = expr_copy(e2);
462 tmp = expr_extract_eq_or(&tmp1, &tmp2);
463 @@ -703,7 +703,7 @@ struct expr *expr_transform(struct expr
464 case E_NOT:
465 switch (e->left.expr->type) {
466 case E_NOT:
467 - // !!a -> a
468 + /* !!a -> a */
469 tmp = e->left.expr->left.expr;
470 free(e->left.expr);
471 free(e);
472 @@ -712,14 +712,14 @@ struct expr *expr_transform(struct expr
473 break;
474 case E_EQUAL:
475 case E_UNEQUAL:
476 - // !a='x' -> a!='x'
477 + /* !a='x' -> a!='x' */
478 tmp = e->left.expr;
479 free(e);
480 e = tmp;
481 e->type = e->type == E_EQUAL ? E_UNEQUAL : E_EQUAL;
482 break;
483 case E_OR:
484 - // !(a || b) -> !a && !b
485 + /* !(a || b) -> !a && !b */
486 tmp = e->left.expr;
487 e->type = E_AND;
488 e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
489 @@ -728,7 +728,7 @@ struct expr *expr_transform(struct expr
490 e = expr_transform(e);
491 break;
492 case E_AND:
493 - // !(a && b) -> !a || !b
494 + /* !(a && b) -> !a || !b */
495 tmp = e->left.expr;
496 e->type = E_OR;
497 e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
498 @@ -738,7 +738,7 @@ struct expr *expr_transform(struct expr
499 break;
500 case E_SYMBOL:
501 if (e->left.expr->left.sym == &symbol_yes) {
502 - // !'y' -> 'n'
503 + /* !'y' -> 'n' */
504 tmp = e->left.expr;
505 free(e);
506 e = tmp;
507 @@ -747,7 +747,7 @@ struct expr *expr_transform(struct expr
508 break;
510 if (e->left.expr->left.sym == &symbol_mod) {
511 - // !'m' -> 'm'
512 + /* !'m' -> 'm' */
513 tmp = e->left.expr;
514 free(e);
515 e = tmp;
516 @@ -756,7 +756,7 @@ struct expr *expr_transform(struct expr
517 break;
519 if (e->left.expr->left.sym == &symbol_no) {
520 - // !'n' -> 'y'
521 + /* !'n' -> 'y' */
522 tmp = e->left.expr;
523 free(e);
524 e = tmp;
525 diff -rduNp config.new.oorig/expr.h config.new/expr.h
526 --- config.new.oorig/expr.h 2008-04-07 11:03:28.000000000 +0200
527 +++ config.new/expr.h 2008-04-07 11:06:30.000000000 +0200
528 @@ -65,7 +65,7 @@ enum symbol_type {
530 enum {
531 S_DEF_USER, /* main user value */
532 - S_DEF_AUTO,
533 + S_DEF_AUTO
536 struct symbol {
537 diff -rduNp config.new.oorig/gconf.c config.new/gconf.c
538 --- config.new.oorig/gconf.c 2008-04-07 11:03:28.000000000 +0200
539 +++ config.new/gconf.c 2008-04-07 11:06:30.000000000 +0200
540 @@ -268,8 +268,8 @@ void init_main_window(const gchar * glad
541 /*"style", PANGO_STYLE_OBLIQUE, */
542 NULL);
544 - sprintf(title, _("Linux Kernel v%s Configuration"),
545 - getenv("KERNELVERSION"));
546 + sprintf(title, _("Buildroot v%s Configuration"),
547 + getenv("BR2_VERSION"));
548 gtk_window_set_title(GTK_WINDOW(main_wnd), title);
550 gtk_widget_show(main_wnd);
551 diff -rduNp config.new.oorig/gconf.glade config.new/gconf.glade
552 --- config.new.oorig/gconf.glade 2008-04-07 11:03:28.000000000 +0200
553 +++ config.new/gconf.glade 2008-04-07 11:06:30.000000000 +0200
554 @@ -5,7 +5,7 @@
556 <widget class="GtkWindow" id="window1">
557 <property name="visible">True</property>
558 - <property name="title" translatable="yes">Gtk Kernel Configurator</property>
559 + <property name="title" translatable="yes">Gtk Buildroot Configurator</property>
560 <property name="type">GTK_WINDOW_TOPLEVEL</property>
561 <property name="window_position">GTK_WIN_POS_NONE</property>
562 <property name="modal">False</property>
563 diff -rduNp config.new.oorig/kconfig-to-buildroot2.patch config.new/kconfig-to-buildroot2.patch
564 --- config.new.oorig/kconfig-to-buildroot2.patch 1970-01-01 01:00:00.000000000 +0100
565 +++ config.new/kconfig-to-buildroot2.patch 2008-04-07 11:12:30.000000000 +0200
566 @@ -0,0 +1,562 @@
567 +diff -rduNp config.new.oorig/Makefile config.new/Makefile
568 +--- config.new.oorig/Makefile 2008-04-07 11:03:28.000000000 +0200
569 ++++ config.new/Makefile 2008-04-07 11:06:30.000000000 +0200
570 +@@ -123,6 +123,9 @@ hostprogs-y := conf qconf gconf kxgettex
571 + ifeq ($(MAKECMDGOALS),menuconfig)
572 + hostprogs-y += mconf
573 + endif
574 ++ifeq ($(findstring mconf,$(MAKECMDGOALS)),mconf)
575 ++ hostprogs-y += mconf
576 ++endif
578 + ifeq ($(MAKECMDGOALS),xconfig)
579 + qconf-target := 1
580 +@@ -181,8 +184,8 @@ $(obj)/.tmp_qtcheck:
581 + done; \
582 + if [ -z "$$dir" ]; then \
583 + echo "*"; \
584 +- echo "* Unable to find the QT3 installation. Please make sure that"; \
585 +- echo "* the QT3 development package is correctly installed and"; \
586 ++ echo "* Unable to find the QT installation. Please make sure that"; \
587 ++ echo "* the QT development package is correctly installed and"; \
588 + echo "* either install pkg-config or set the QTDIR environment"; \
589 + echo "* variable to the correct location."; \
590 + echo "*"; \
591 +diff -rduNp config.new.oorig/conf.c config.new/conf.c
592 +--- config.new.oorig/conf.c 2008-04-07 11:03:28.000000000 +0200
593 ++++ config.new/conf.c 2008-04-07 11:06:30.000000000 +0200
594 +@@ -545,7 +545,7 @@ int main(int ac, char **av)
595 + exit(1);
597 + conf_parse(name);
598 +- //zconfdump(stdout);
599 ++ /*zconfdump(stdout);*/
600 + switch (input_mode) {
601 + case set_default:
602 + if (!defconfig_file)
603 +@@ -560,11 +560,11 @@ int main(int ac, char **av)
604 + case ask_silent:
605 + if (stat(".config", &tmpstat)) {
606 + printf(_("***\n"
607 +- "*** You have not yet configured your kernel!\n"
608 +- "*** (missing kernel .config file)\n"
609 ++ "*** You have not yet configured Buildroot!\n"
610 ++ "*** (missing .config file)\n"
611 + "***\n"
612 + "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
613 +- "*** \"make menuconfig\" or \"make xconfig\").\n"
614 ++ "*** \"make menuconfig\" or \"make config\").\n"
615 + "***\n"));
616 + exit(1);
618 +@@ -607,7 +607,7 @@ int main(int ac, char **av)
619 + } else if (conf_get_changed()) {
620 + name = getenv("KCONFIG_NOSILENTUPDATE");
621 + if (name && *name) {
622 +- fprintf(stderr, _("\n*** Kernel configuration requires explicit update.\n\n"));
623 ++ fprintf(stderr, _("\n*** Buildroot configuration requires explicit update.\n\n"));
624 + return 1;
626 + } else
627 +@@ -618,12 +618,12 @@ int main(int ac, char **av)
628 + check_conf(&rootmenu);
629 + } while (conf_cnt);
630 + if (conf_write(NULL)) {
631 +- fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
632 ++ fprintf(stderr, _("\n*** Error during writing of the Buildroot configuration.\n\n"));
633 + return 1;
635 + skip_check:
636 +- if (input_mode == ask_silent && conf_write_autoconf()) {
637 +- fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
638 ++ if (/*input_mode == ask_silent &&*/ conf_write_autoconf()) {
639 ++ fprintf(stderr, _("\n*** Error during writing of the Buildroot configuration.\n\n"));
640 + return 1;
643 +diff -rduNp config.new.oorig/confdata.c config.new/confdata.c
644 +--- config.new.oorig/confdata.c 2008-04-07 11:03:28.000000000 +0200
645 ++++ config.new/confdata.c 2008-04-07 11:06:30.000000000 +0200
646 +@@ -11,6 +11,7 @@
647 + #include <string.h>
648 + #include <time.h>
649 + #include <unistd.h>
650 ++#include <libgen.h>
652 + #define LKC_DIRECT_LINK
653 + #include "lkc.h"
654 +@@ -21,7 +22,7 @@ static void conf_warning(const char *fmt
655 + static const char *conf_filename;
656 + static int conf_lineno, conf_warnings, conf_unsaved;
658 +-const char conf_defname[] = "arch/$ARCH/defconfig";
659 ++const char conf_defname[] = ".defconfig";
661 + static void conf_warning(const char *fmt, ...)
663 +@@ -36,7 +37,7 @@ static void conf_warning(const char *fmt
665 + const char *conf_get_configname(void)
667 +- char *name = getenv("KCONFIG_CONFIG");
668 ++ char *name = getenv("BUILDROOT_CONFIG");
670 + return name ? name : ".config";
672 +@@ -212,22 +213,22 @@ load:
673 + sym = NULL;
674 + switch (line[0]) {
675 + case '#':
676 +- if (memcmp(line + 2, "CONFIG_", 7))
677 ++ if (line[1]!=' ')
678 + continue;
679 +- p = strchr(line + 9, ' ');
680 ++ p = strchr(line + 2, ' ');
681 + if (!p)
682 + continue;
683 + *p++ = 0;
684 + if (strncmp(p, "is not set", 10))
685 + continue;
686 + if (def == S_DEF_USER) {
687 +- sym = sym_find(line + 9);
688 ++ sym = sym_find(line + 2);
689 + if (!sym) {
690 +- conf_warning("trying to assign nonexistent symbol %s", line + 9);
691 ++ conf_warning("trying to assign nonexistent symbol %s", line + 2);
692 + break;
694 + } else {
695 +- sym = sym_lookup(line + 9, 0);
696 ++ sym = sym_lookup(line + 2, 0);
697 + if (sym->type == S_UNKNOWN)
698 + sym->type = S_BOOLEAN;
700 +@@ -245,12 +246,8 @@ load:
703 + break;
704 +- case 'C':
705 +- if (memcmp(line, "CONFIG_", 7)) {
706 +- conf_warning("unexpected data");
707 +- continue;
708 +- }
709 +- p = strchr(line + 7, '=');
710 ++ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z':
711 ++ p = strchr(line, '=');
712 + if (!p)
713 + continue;
714 + *p++ = 0;
715 +@@ -261,13 +258,13 @@ load:
716 + *p2 = 0;
718 + if (def == S_DEF_USER) {
719 +- sym = sym_find(line + 7);
720 ++ sym = sym_find(line);
721 + if (!sym) {
722 +- conf_warning("trying to assign nonexistent symbol %s", line + 7);
723 ++ conf_warning("trying to assign nonexistent symbol %s", line);
724 + break;
726 + } else {
727 +- sym = sym_lookup(line + 7, 0);
728 ++ sym = sym_lookup(line, 0);
729 + if (sym->type == S_UNKNOWN)
730 + sym->type = S_OTHER;
732 +@@ -440,7 +437,7 @@ int conf_write(const char *name)
733 + if (!out)
734 + return 1;
736 +- sym = sym_lookup("KERNELVERSION", 0);
737 ++ sym = sym_lookup("BR2_VERSION", 0);
738 + sym_calc_value(sym);
739 + time(&now);
740 + env = getenv("KCONFIG_NOTIMESTAMP");
741 +@@ -449,10 +446,8 @@ int conf_write(const char *name)
743 + fprintf(out, _("#\n"
744 + "# Automatically generated make config: don't edit\n"
745 +- "# Linux kernel version: %s\n"
746 + "%s%s"
747 + "#\n"),
748 +- sym_get_string_value(sym),
749 + use_timestamp ? "# " : "",
750 + use_timestamp ? ctime(&now) : "");
752 +@@ -486,19 +481,19 @@ int conf_write(const char *name)
753 + case S_TRISTATE:
754 + switch (sym_get_tristate_value(sym)) {
755 + case no:
756 +- fprintf(out, "# CONFIG_%s is not set\n", sym->name);
757 ++ fprintf(out, "# %s is not set\n", sym->name);
758 + break;
759 + case mod:
760 +- fprintf(out, "CONFIG_%s=m\n", sym->name);
761 ++ fprintf(out, "%s=m\n", sym->name);
762 + break;
763 + case yes:
764 +- fprintf(out, "CONFIG_%s=y\n", sym->name);
765 ++ fprintf(out, "%s=y\n", sym->name);
766 + break;
768 + break;
769 + case S_STRING:
770 + str = sym_get_string_value(sym);
771 +- fprintf(out, "CONFIG_%s=\"", sym->name);
772 ++ fprintf(out, "%s=\"", sym->name);
773 + while (1) {
774 + l = strcspn(str, "\"\\");
775 + if (l) {
776 +@@ -514,12 +509,12 @@ int conf_write(const char *name)
777 + case S_HEX:
778 + str = sym_get_string_value(sym);
779 + if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
780 +- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
781 ++ fprintf(out, "%s=%s\n", sym->name, str);
782 + break;
784 + case S_INT:
785 + str = sym_get_string_value(sym);
786 +- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
787 ++ fprintf(out, "%s=%s\n", sym->name, str);
788 + break;
791 +@@ -559,7 +554,7 @@ int conf_write(const char *name)
793 + int conf_split_config(void)
795 +- char *name, path[128];
796 ++ char *name, path[128], *opwd, *dir, *_name;
797 + char *s, *d, c;
798 + struct symbol *sym;
799 + struct stat sb;
800 +@@ -570,8 +565,20 @@ int conf_split_config(void)
801 + name = "include/config/auto.conf";
802 + conf_read_simple(name, S_DEF_AUTO);
804 +- if (chdir("include/config"))
805 ++ opwd = malloc(256);
806 ++ _name = strdup(name);
807 ++ if (opwd == NULL || _name == NULL)
808 + return 1;
809 ++ opwd = getcwd(opwd, 256);
810 ++ dir = dirname(_name);
811 ++ if (dir == NULL) {
812 ++ res = 1;
813 ++ goto err;
814 ++ }
815 ++ if (chdir(dir)) {
816 ++ res = 1;
817 ++ goto err;
818 ++ }
820 + res = 0;
821 + for_all_symbols(i, sym) {
822 +@@ -664,9 +671,11 @@ int conf_split_config(void)
823 + close(fd);
825 + out:
826 +- if (chdir("../.."))
827 +- return 1;
829 ++ if (chdir(opwd))
830 ++ res = 1;
831 ++err:
832 ++ free(opwd);
833 ++ free(_name);
834 + return res;
837 +@@ -681,7 +690,7 @@ int conf_write_autoconf(void)
839 + sym_clear_all_valid();
841 +- file_write_dep("include/config/auto.conf.cmd");
842 ++ file_write_dep(".config.cmd");
844 + if (conf_split_config())
845 + return 1;
846 +@@ -696,22 +705,19 @@ int conf_write_autoconf(void)
847 + return 1;
850 +- sym = sym_lookup("KERNELVERSION", 0);
851 ++ sym = sym_lookup("BR2_VERSION", 0);
852 + sym_calc_value(sym);
853 + time(&now);
854 + fprintf(out, "#\n"
855 + "# Automatically generated make config: don't edit\n"
856 +- "# Linux kernel version: %s\n"
857 + "# %s"
858 + "#\n",
859 +- sym_get_string_value(sym), ctime(&now));
860 ++ ctime(&now));
861 + fprintf(out_h, "/*\n"
862 + " * Automatically generated C config: don't edit\n"
863 +- " * Linux kernel version: %s\n"
864 + " * %s"
865 +- " */\n"
866 +- "#define AUTOCONF_INCLUDED\n",
867 +- sym_get_string_value(sym), ctime(&now));
868 ++ " */\n",
869 ++ ctime(&now));
871 + for_all_symbols(i, sym) {
872 + sym_calc_value(sym);
873 +@@ -724,19 +730,19 @@ int conf_write_autoconf(void)
874 + case no:
875 + break;
876 + case mod:
877 +- fprintf(out, "CONFIG_%s=m\n", sym->name);
878 +- fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name);
879 ++ fprintf(out, "%s=m\n", sym->name);
880 ++ fprintf(out_h, "#define %s_MODULE 1\n", sym->name);
881 + break;
882 + case yes:
883 +- fprintf(out, "CONFIG_%s=y\n", sym->name);
884 +- fprintf(out_h, "#define CONFIG_%s 1\n", sym->name);
885 ++ fprintf(out, "%s=y\n", sym->name);
886 ++ fprintf(out_h, "#define %s 1\n", sym->name);
887 + break;
889 + break;
890 + case S_STRING:
891 + str = sym_get_string_value(sym);
892 +- fprintf(out, "CONFIG_%s=\"", sym->name);
893 +- fprintf(out_h, "#define CONFIG_%s \"", sym->name);
894 ++ fprintf(out, "%s=\"", sym->name);
895 ++ fprintf(out_h, "#define %s \"", sym->name);
896 + while (1) {
897 + l = strcspn(str, "\"\\");
898 + if (l) {
899 +@@ -756,14 +762,14 @@ int conf_write_autoconf(void)
900 + case S_HEX:
901 + str = sym_get_string_value(sym);
902 + if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
903 +- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
904 +- fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str);
905 ++ fprintf(out, "%s=%s\n", sym->name, str);
906 ++ fprintf(out_h, "#define %s 0x%s\n", sym->name, str);
907 + break;
909 + case S_INT:
910 + str = sym_get_string_value(sym);
911 +- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
912 +- fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str);
913 ++ fprintf(out, "%s=%s\n", sym->name, str);
914 ++ fprintf(out_h, "#define %s %s\n", sym->name, str);
915 + break;
916 + default:
917 + break;
918 +diff -rduNp config.new.oorig/expr.c config.new/expr.c
919 +--- config.new.oorig/expr.c 2008-04-07 11:03:28.000000000 +0200
920 ++++ config.new/expr.c 2008-04-07 11:06:30.000000000 +0200
921 +@@ -331,7 +331,7 @@ struct expr *expr_trans_bool(struct expr
922 + e->right.expr = expr_trans_bool(e->right.expr);
923 + break;
924 + case E_UNEQUAL:
925 +- // FOO!=n -> FOO
926 ++ /* FOO!=n -> FOO */
927 + if (e->left.sym->type == S_TRISTATE) {
928 + if (e->right.sym == &symbol_no) {
929 + e->type = E_SYMBOL;
930 +@@ -380,19 +380,19 @@ struct expr *expr_join_or(struct expr *e
931 + if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
932 + ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
933 + (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) {
934 +- // (a='y') || (a='m') -> (a!='n')
935 ++ /* (a='y') || (a='m') -> (a!='n') */
936 + return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_no);
938 + if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
939 + ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
940 + (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) {
941 +- // (a='y') || (a='n') -> (a!='m')
942 ++ /* (a='y') || (a='n') -> (a!='m') */
943 + return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_mod);
945 + if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
946 + ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
947 + (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) {
948 +- // (a='m') || (a='n') -> (a!='y')
949 ++ /* (a='m') || (a='n') -> (a!='y') */
950 + return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes);
953 +@@ -443,29 +443,29 @@ struct expr *expr_join_and(struct expr *
955 + if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) ||
956 + (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes))
957 +- // (a) && (a='y') -> (a='y')
958 ++ /* (a) && (a='y') -> (a='y') */
959 + return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
961 + if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) ||
962 + (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no))
963 +- // (a) && (a!='n') -> (a)
964 ++ /* (a) && (a!='n') -> (a) */
965 + return expr_alloc_symbol(sym1);
967 + if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) ||
968 + (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod))
969 +- // (a) && (a!='m') -> (a='y')
970 ++ /* (a) && (a!='m') -> (a='y') */
971 + return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
973 + if (sym1->type == S_TRISTATE) {
974 + if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) {
975 +- // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
976 ++ /* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */
977 + sym2 = e1->right.sym;
978 + if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
979 + return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
980 + : expr_alloc_symbol(&symbol_no);
982 + if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) {
983 +- // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
984 ++ /* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */
985 + sym2 = e2->right.sym;
986 + if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
987 + return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
988 +@@ -474,19 +474,19 @@ struct expr *expr_join_and(struct expr *
989 + if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
990 + ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
991 + (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes)))
992 +- // (a!='y') && (a!='n') -> (a='m')
993 ++ /* (a!='y') && (a!='n') -> (a='m') */
994 + return expr_alloc_comp(E_EQUAL, sym1, &symbol_mod);
996 + if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
997 + ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
998 + (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes)))
999 +- // (a!='y') && (a!='m') -> (a='n')
1000 ++ /* (a!='y') && (a!='m') -> (a='n') */
1001 + return expr_alloc_comp(E_EQUAL, sym1, &symbol_no);
1003 + if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
1004 + ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
1005 + (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod)))
1006 +- // (a!='m') && (a!='n') -> (a='m')
1007 ++ /* (a!='m') && (a!='n') -> (a='m') */
1008 + return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
1010 + if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) ||
1011 +@@ -579,7 +579,7 @@ static void expr_eliminate_dups2(enum ex
1012 + switch (e1->type) {
1013 + case E_OR:
1014 + expr_eliminate_dups2(e1->type, &e1, &e1);
1015 +- // (FOO || BAR) && (!FOO && !BAR) -> n
1016 ++ /* (FOO || BAR) && (!FOO && !BAR) -> n */
1017 + tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
1018 + tmp2 = expr_copy(e2);
1019 + tmp = expr_extract_eq_and(&tmp1, &tmp2);
1020 +@@ -594,7 +594,7 @@ static void expr_eliminate_dups2(enum ex
1021 + break;
1022 + case E_AND:
1023 + expr_eliminate_dups2(e1->type, &e1, &e1);
1024 +- // (FOO && BAR) || (!FOO || !BAR) -> y
1025 ++ /* (FOO && BAR) || (!FOO || !BAR) -> y */
1026 + tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
1027 + tmp2 = expr_copy(e2);
1028 + tmp = expr_extract_eq_or(&tmp1, &tmp2);
1029 +@@ -703,7 +703,7 @@ struct expr *expr_transform(struct expr
1030 + case E_NOT:
1031 + switch (e->left.expr->type) {
1032 + case E_NOT:
1033 +- // !!a -> a
1034 ++ /* !!a -> a */
1035 + tmp = e->left.expr->left.expr;
1036 + free(e->left.expr);
1037 + free(e);
1038 +@@ -712,14 +712,14 @@ struct expr *expr_transform(struct expr
1039 + break;
1040 + case E_EQUAL:
1041 + case E_UNEQUAL:
1042 +- // !a='x' -> a!='x'
1043 ++ /* !a='x' -> a!='x' */
1044 + tmp = e->left.expr;
1045 + free(e);
1046 + e = tmp;
1047 + e->type = e->type == E_EQUAL ? E_UNEQUAL : E_EQUAL;
1048 + break;
1049 + case E_OR:
1050 +- // !(a || b) -> !a && !b
1051 ++ /* !(a || b) -> !a && !b */
1052 + tmp = e->left.expr;
1053 + e->type = E_AND;
1054 + e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
1055 +@@ -728,7 +728,7 @@ struct expr *expr_transform(struct expr
1056 + e = expr_transform(e);
1057 + break;
1058 + case E_AND:
1059 +- // !(a && b) -> !a || !b
1060 ++ /* !(a && b) -> !a || !b */
1061 + tmp = e->left.expr;
1062 + e->type = E_OR;
1063 + e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
1064 +@@ -738,7 +738,7 @@ struct expr *expr_transform(struct expr
1065 + break;
1066 + case E_SYMBOL:
1067 + if (e->left.expr->left.sym == &symbol_yes) {
1068 +- // !'y' -> 'n'
1069 ++ /* !'y' -> 'n' */
1070 + tmp = e->left.expr;
1071 + free(e);
1072 + e = tmp;
1073 +@@ -747,7 +747,7 @@ struct expr *expr_transform(struct expr
1074 + break;
1076 + if (e->left.expr->left.sym == &symbol_mod) {
1077 +- // !'m' -> 'm'
1078 ++ /* !'m' -> 'm' */
1079 + tmp = e->left.expr;
1080 + free(e);
1081 + e = tmp;
1082 +@@ -756,7 +756,7 @@ struct expr *expr_transform(struct expr
1083 + break;
1085 + if (e->left.expr->left.sym == &symbol_no) {
1086 +- // !'n' -> 'y'
1087 ++ /* !'n' -> 'y' */
1088 + tmp = e->left.expr;
1089 + free(e);
1090 + e = tmp;
1091 +diff -rduNp config.new.oorig/expr.h config.new/expr.h
1092 +--- config.new.oorig/expr.h 2008-04-07 11:03:28.000000000 +0200
1093 ++++ config.new/expr.h 2008-04-07 11:06:30.000000000 +0200
1094 +@@ -65,7 +65,7 @@ enum symbol_type {
1096 + enum {
1097 + S_DEF_USER, /* main user value */
1098 +- S_DEF_AUTO,
1099 ++ S_DEF_AUTO
1100 + };
1102 + struct symbol {
1103 +diff -rduNp config.new.oorig/gconf.c config.new/gconf.c
1104 +--- config.new.oorig/gconf.c 2008-04-07 11:03:28.000000000 +0200
1105 ++++ config.new/gconf.c 2008-04-07 11:06:30.000000000 +0200
1106 +@@ -268,8 +268,8 @@ void init_main_window(const gchar * glad
1107 + /*"style", PANGO_STYLE_OBLIQUE, */
1108 + NULL);
1110 +- sprintf(title, _("Linux Kernel v%s Configuration"),
1111 +- getenv("KERNELVERSION"));
1112 ++ sprintf(title, _("Buildroot v%s Configuration"),
1113 ++ getenv("BR2_VERSION"));
1114 + gtk_window_set_title(GTK_WINDOW(main_wnd), title);
1116 + gtk_widget_show(main_wnd);
1117 +diff -rduNp config.new.oorig/gconf.glade config.new/gconf.glade
1118 +--- config.new.oorig/gconf.glade 2008-04-07 11:03:28.000000000 +0200
1119 ++++ config.new/gconf.glade 2008-04-07 11:06:30.000000000 +0200
1120 +@@ -5,7 +5,7 @@
1122 + <widget class="GtkWindow" id="window1">
1123 + <property name="visible">True</property>
1124 +- <property name="title" translatable="yes">Gtk Kernel Configurator</property>
1125 ++ <property name="title" translatable="yes">Gtk Buildroot Configurator</property>
1126 + <property name="type">GTK_WINDOW_TOPLEVEL</property>
1127 + <property name="window_position">GTK_WIN_POS_NONE</property>
1128 + <property name="modal">False</property>
1129 diff -rduNp config.new.oorig/mconf.c config.new/mconf.c
1130 --- config.new.oorig/mconf.c 2008-04-07 11:03:28.000000000 +0200
1131 +++ config.new/mconf.c 2008-04-07 11:09:01.000000000 +0200
1132 @@ -29,10 +29,9 @@
1133 static const char mconf_readme[] = N_(
1134 "Overview\n"
1135 "--------\n"
1136 -"Some kernel features may be built directly into the kernel.\n"
1137 -"Some may be made into loadable runtime modules. Some features\n"
1138 +"Some features may be built directly into Buildroot. Some features\n"
1139 "may be completely removed altogether. There are also certain\n"
1140 -"kernel parameters which are not really features, but must be\n"
1141 +"parameters which are not really features, but must be\n"
1142 "entered in as decimal or hexadecimal numbers or possibly text.\n"
1143 "\n"
1144 "Menu items beginning with following braces represent features that\n"
1145 @@ -119,7 +118,7 @@ static const char mconf_readme[] = N_(
1146 "-----------------------------\n"
1147 "Menuconfig supports the use of alternate configuration files for\n"
1148 "those who, for various reasons, find it necessary to switch\n"
1149 -"between different kernel configurations.\n"
1150 +"between different configurations.\n"
1151 "\n"
1152 "At the end of the main menu you will find two options. One is\n"
1153 "for saving the current configuration to a file of your choosing.\n"
1154 @@ -152,7 +151,7 @@ static const char mconf_readme[] = N_(
1155 "\n"
1156 "Optional personality available\n"
1157 "------------------------------\n"
1158 -"If you prefer to have all of the kernel options listed in a single\n"
1159 +"If you prefer to have all of the options listed in a single\n"
1160 "menu, rather than the default multimenu hierarchy, run the menuconfig\n"
1161 "with MENUCONFIG_MODE environment variable set to single_menu. Example:\n"
1162 "\n"
1163 @@ -182,9 +181,9 @@ menu_instructions[] = N_(
1164 "Arrow keys navigate the menu. "
1165 "<Enter> selects submenus --->. "
1166 "Highlighted letters are hotkeys. "
1167 - "Pressing <Y> includes, <N> excludes, <M> modularizes features. "
1168 + "Pressing <Y> selectes a feature, while <N> will exclude a feature. "
1169 "Press <Esc><Esc> to exit, <?> for Help, </> for Search. "
1170 - "Legend: [*] built-in [ ] excluded <M> module < > module capable"),
1171 + "Legend: [*] feature is selected [ ] feature is excluded"),
1172 radiolist_instructions[] = N_(
1173 "Use the arrow keys to navigate this window or "
1174 "press the hotkey of the item you wish to select "
1175 @@ -204,18 +203,18 @@ setmod_text[] = N_(
1176 "This feature depends on another which has been configured as a module.\n"
1177 "As a result, this feature will be built as a module."),
1178 nohelp_text[] = N_(
1179 - "There is no help available for this kernel option.\n"),
1180 + "There is no help available for this option.\n"),
1181 load_config_text[] = N_(
1182 "Enter the name of the configuration file you wish to load. "
1183 "Accept the name shown to restore the configuration you "
1184 "last retrieved. Leave blank to abort."),
1185 load_config_help[] = N_(
1186 "\n"
1187 - "For various reasons, one may wish to keep several different kernel\n"
1188 + "For various reasons, one may wish to keep several different Buildroot\n"
1189 "configurations available on a single machine.\n"
1190 "\n"
1191 "If you have saved a previous configuration in a file other than the\n"
1192 - "kernel's default, entering the name of the file here will allow you\n"
1193 + "Buildroot's default, entering the name of the file here will allow you\n"
1194 "to modify that configuration.\n"
1195 "\n"
1196 "If you are uncertain, then you have probably never used alternate\n"
1197 @@ -225,7 +224,7 @@ save_config_text[] = N_(
1198 "as an alternate. Leave blank to abort."),
1199 save_config_help[] = N_(
1200 "\n"
1201 - "For various reasons, one may wish to keep different kernel\n"
1202 + "For various reasons, one may wish to keep different Buildroot\n"
1203 "configurations available on a single machine.\n"
1204 "\n"
1205 "Entering a file name here will allow you to later retrieve, modify\n"
1206 @@ -405,10 +404,10 @@ static void set_config_filename(const ch
1207 int size;
1208 struct symbol *sym;
1210 - sym = sym_lookup("KERNELVERSION", 0);
1211 + sym = sym_lookup("BR2_VERSION", 0);
1212 sym_calc_value(sym);
1213 size = snprintf(menu_backtitle, sizeof(menu_backtitle),
1214 - _("%s - Linux Kernel v%s Configuration"),
1215 + _("%s - buildroot v%s Configuration"),
1216 config_filename, sym_get_string_value(sym));
1217 if (size >= sizeof(menu_backtitle))
1218 menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
1219 @@ -935,7 +934,7 @@ int main(int ac, char **av)
1220 if (conf_get_changed())
1221 res = dialog_yesno(NULL,
1222 _("Do you wish to save your "
1223 - "new kernel configuration?\n"
1224 + "new Buildroot configuration?\n"
1225 "<ESC><ESC> to continue."),
1226 6, 60);
1227 else
1228 @@ -947,22 +946,22 @@ int main(int ac, char **av)
1229 case 0:
1230 if (conf_write(filename)) {
1231 fprintf(stderr, _("\n\n"
1232 - "Error during writing of the kernel configuration.\n"
1233 - "Your kernel configuration changes were NOT saved."
1234 + "Error during writing of the Buildroot configuration.\n"
1235 + "Your Buildroot configuration changes were NOT saved."
1236 "\n\n"));
1237 return 1;
1239 case -1:
1240 printf(_("\n\n"
1241 - "*** End of Linux kernel configuration.\n"
1242 - "*** Execute 'make' to build the kernel or try 'make help'."
1243 + "*** End of Buildroot configuration.\n"
1244 + "*** Execute 'make' to build Buildroot or try 'make help'."
1245 "\n\n"));
1246 break;
1247 default:
1248 fprintf(stderr, _("\n\n"
1249 - "Your kernel configuration changes were NOT saved."
1250 + "Your Buildroot configuration changes were NOT saved."
1251 "\n\n"));
1254 - return 0;
1255 + return conf_write_autoconf();
1257 diff -rduNp config.new.oorig/symbol.c config.new/symbol.c
1258 --- config.new.oorig/symbol.c 2008-04-07 11:03:28.000000000 +0200
1259 +++ config.new/symbol.c 2008-04-07 11:06:30.000000000 +0200
1260 @@ -61,10 +61,10 @@ void sym_init(void)
1261 if (p)
1262 sym_add_default(sym, p);
1264 - sym = sym_lookup("KERNELVERSION", 0);
1265 + sym = sym_lookup("BR2_VERSION", 0);
1266 sym->type = S_STRING;
1267 sym->flags |= SYMBOL_AUTO;
1268 - p = getenv("KERNELVERSION");
1269 + p = getenv("BR2_VERSION");
1270 if (p)
1271 sym_add_default(sym, p);
1273 diff -rduNp config.new.oorig/util.c config.new/util.c
1274 --- config.new.oorig/util.c 2008-04-07 11:03:28.000000000 +0200
1275 +++ config.new/util.c 2008-04-07 11:06:30.000000000 +0200
1276 @@ -26,6 +26,109 @@ struct file *file_lookup(const char *nam
1277 return file;
1280 +static char* br2_symbol_printer(const char * const in)
1282 + ssize_t i, j, len = strlen(in);
1283 + char *ret;
1284 + if (len < 1)
1285 + return NULL;
1286 + ret = malloc(len);
1287 + if (!ret) {
1288 + printf("Out of memory!");
1289 + exit(1);
1291 + memset(ret, 0, len);
1292 + i = j = 0;
1293 + if (strncmp("BR2_", in, 4) == 0)
1294 + i += 4;
1295 + if (strncmp("PACKAGE_", in + i, 8) == 0)
1296 + i += 8;
1297 + else if (strncmp("TARGET_", in + i, 7) == 0)
1298 + i += 7;
1299 + while (i <= len)
1300 + ret[j++] = tolower(in[i++]);
1301 + return ret;
1304 +/* write dependencies of the infividual config-symbols */
1305 +static int write_make_deps(const char *name)
1307 + struct menu *menu;
1308 + struct symbol *sym;
1309 + struct property *prop, *p;
1310 + unsigned done;
1311 + const char * const name_tmp = "..make.deps.tmp";
1312 + FILE *out;
1313 + if (!name)
1314 + name = ".auto.deps";
1315 + out = fopen(name_tmp, "w");
1316 + if (!out)
1317 + return 1;
1318 + fprintf(out, "# ATTENTION! This does not handle 'depends', just 'select'! \n"
1319 + "# See package/config/util.c write_make_deps()\n#\n");
1320 + menu = &rootmenu;//rootmenu.list;
1321 + while (menu) {
1322 + sym = menu->sym;
1323 + if (!sym) {
1324 + if (!menu_is_visible(menu))
1325 + goto next;
1326 + } else if (!(sym->flags & SYMBOL_CHOICE)) {
1327 + sym_calc_value(sym);
1328 + if (sym->type == S_BOOLEAN
1329 + && sym_get_tristate_value(sym) != no) {
1330 + done = 0;
1331 + for_all_prompts(sym, prop) {
1332 + struct expr *e;
1333 +//printf("\nname=%s\n", sym->name);
1334 + for_all_properties(sym, p, P_SELECT) {
1335 + e = p->expr;
1336 + if (e && e->left.sym->name) {
1337 + if (!done) {
1338 + fprintf(out, "%s: $(BASE_TARGETS)", br2_symbol_printer(sym->name));
1339 + done = 1;
1341 +//printf("SELECTS %s\n",e->left.sym->name);
1342 + fprintf(out, " %s",br2_symbol_printer(e->left.sym->name));
1345 + if (done)
1346 + fprintf(out, "\n");
1347 +#if 0
1348 + e = sym->rev_dep.expr;
1349 + if (e && e->type == E_SYMBOL
1350 + && e->left.sym->name) {
1351 + fprintf(out, "%s: %s", br2_symbol_printer(e->left.sym->name),
1352 + br2_symbol_printer(sym->name));
1353 +printf("%s is Selected BY: %s", sym->name, e->left.sym->name);
1355 +#endif
1359 +next:
1360 + if (menu->list) {
1361 + menu = menu->list;
1362 + continue;
1364 + if (menu->next)
1365 + menu = menu->next;
1366 + else while ((menu = menu->parent)) {
1367 + if (menu->next) {
1368 + menu = menu->next;
1369 + break;
1373 + fclose(out);
1374 + rename(name_tmp, name);
1375 + printf(_("#\n"
1376 + "# make dependencies written to %s\n"
1377 + "# ATTENTION buildroot devels!\n"
1378 + "# See top of this file before playing with this auto-preprequisites!\n"
1379 + "#\n"), name);
1380 + return 0;
1383 /* write a dependency file as used by kbuild to track dependencies */
1384 int file_write_dep(const char *name)
1386 @@ -44,12 +147,13 @@ int file_write_dep(const char *name)
1387 else
1388 fprintf(out, "\t%s\n", file->name);
1390 - fprintf(out, "\ninclude/config/auto.conf: \\\n"
1391 + fprintf(out, "\n$(BR2_DEPENDS_DIR)/config/auto.conf: \\\n"
1392 "\t$(deps_config)\n\n"
1393 "$(deps_config): ;\n");
1394 fclose(out);
1395 rename("..config.tmp", name);
1396 - return 0;
1398 + return write_make_deps(NULL);
1402 diff -rduNp config.new.oorig/zconf.tab.c_shipped config.new/zconf.tab.c_shipped
1403 --- config.new.oorig/zconf.tab.c_shipped 2008-04-07 11:03:28.000000000 +0200
1404 +++ config.new/zconf.tab.c_shipped 2008-04-07 11:06:30.000000000 +0200
1405 @@ -2248,7 +2248,7 @@ void conf_parse(const char *name)
1406 modules_sym = sym_lookup(NULL, 0);
1407 modules_sym->type = S_BOOLEAN;
1408 modules_sym->flags |= SYMBOL_AUTO;
1409 - rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
1410 + rootmenu.prompt = menu_add_prompt(P_MENU, "Buildroot Configuration", NULL);
1412 #if YYDEBUG
1413 if (getenv("ZCONF_DEBUG"))
1414 diff -rduNp config.new.oorig/zconf.y config.new/zconf.y
1415 --- config.new.oorig/zconf.y 2008-04-07 11:03:28.000000000 +0200
1416 +++ config.new/zconf.y 2008-04-07 11:06:30.000000000 +0200
1417 @@ -473,7 +473,7 @@ void conf_parse(const char *name)
1418 modules_sym = sym_lookup(NULL, 0);
1419 modules_sym->type = S_BOOLEAN;
1420 modules_sym->flags |= SYMBOL_AUTO;
1421 - rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
1422 + rootmenu.prompt = menu_add_prompt(P_MENU, "Buildroot Configuration", NULL);
1424 #if YYDEBUG
1425 if (getenv("ZCONF_DEBUG"))
1426 diff --git config.new.oorig/mconf.c config.new/mconf.c
1427 --- config.new.oorig/mconf.c
1428 +++ config.new/mconf.c
1429 @@ -743,7 +743,7 @@ static void show_help(struct menu *menu)
1430 if (menu_has_help(menu))
1432 if (sym->name) {
1433 - str_printf(&help, "CONFIG_%s:\n\n", sym->name);
1434 + str_printf(&help, "%s:\n\n", sym->name);
1435 str_append(&help, _(menu_get_help(menu)));
1436 str_append(&help, "\n");