summaryrefslogtreecommitdiff
path: root/package/config/kconfig-to-buildroot2.patch
blob: 0132ce8d4ec8de16e8b37aa70e4757615f50b844 (plain)
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
diff -rdup kernel-config/conf.c config/conf.c
--- kernel-config/conf.c	2007-09-22 00:38:23.000000000 +0200
+++ config/conf.c	2007-09-23 15:35:12.000000000 +0200
@@ -542,7 +542,7 @@ int main(int ac, char **av)
 		exit(1);
 	}
 	conf_parse(name);
-	//zconfdump(stdout);
+	/*zconfdump(stdout);*/
 	switch (input_mode) {
 	case set_default:
 		if (!defconfig_file)
@@ -557,11 +557,11 @@ int main(int ac, char **av)
 	case ask_silent:
 		if (stat(".config", &tmpstat)) {
 			printf(_("***\n"
-				"*** You have not yet configured your kernel!\n"
-				"*** (missing kernel .config file)\n"
+				"*** You have not yet configured Buildroot!\n"
+				"*** (missing .config file)\n"
 				"***\n"
 				"*** Please run some configurator (e.g. \"make oldconfig\" or\n"
-				"*** \"make menuconfig\" or \"make xconfig\").\n"
+				"*** \"make menuconfig\" or \"make config\").\n"
 				"***\n"));
 			exit(1);
 		}
@@ -604,7 +604,7 @@ int main(int ac, char **av)
 	} else if (conf_get_changed()) {
 		name = getenv("KCONFIG_NOSILENTUPDATE");
 		if (name && *name) {
-			fprintf(stderr, _("\n*** Kernel configuration requires explicit update.\n\n"));
+			fprintf(stderr, _("\n*** Buildroot configuration requires explicit update.\n\n"));
 			return 1;
 		}
 	} else
@@ -615,12 +615,12 @@ int main(int ac, char **av)
 		check_conf(&rootmenu);
 	} while (conf_cnt);
 	if (conf_write(NULL)) {
-		fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
+		fprintf(stderr, _("\n*** Error during writing of the Buildroot configuration.\n\n"));
 		return 1;
 	}
 skip_check:
-	if (input_mode == ask_silent && conf_write_autoconf()) {
-		fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
+	if (/*input_mode == ask_silent &&*/ conf_write_autoconf()) {
+		fprintf(stderr, _("\n*** Error during writing of the Buildroot configuration.\n\n"));
 		return 1;
 	}
 
diff -rdup kernel-config/confdata.c config/confdata.c
--- kernel-config/confdata.c	2007-09-22 00:38:23.000000000 +0200
+++ config/confdata.c	2007-09-23 15:33:26.000000000 +0200
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
+#include <libgen.h>
 
 #define LKC_DIRECT_LINK
 #include "lkc.h"
@@ -21,7 +22,7 @@ static void conf_warning(const char *fmt
 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, ...)
 {
@@ -150,22 +151,22 @@ load:
 		sym = NULL;
 		switch (line[0]) {
 		case '#':
-			if (memcmp(line + 2, "CONFIG_", 7))
+			if (line[1]!=' ')
 				continue;
-			p = strchr(line + 9, ' ');
+			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 + 9);
+				sym = sym_find(line + 2);
 				if (!sym) {
-					conf_warning("trying to assign nonexistent symbol %s", line + 9);
+					conf_warning("trying to assign nonexistent symbol %s", line + 2);
 					break;
 				}
 			} else {
-				sym = sym_lookup(line + 9, 0);
+				sym = sym_lookup(line + 2, 0);
 				if (sym->type == S_UNKNOWN)
 					sym->type = S_BOOLEAN;
 			}
@@ -183,12 +184,8 @@ load:
 				;
 			}
 			break;
-		case 'C':
-			if (memcmp(line, "CONFIG_", 7)) {
-				conf_warning("unexpected data");
-				continue;
-			}
-			p = strchr(line + 7, '=');
+		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':
+			p = strchr(line, '=');
 			if (!p)
 				continue;
 			*p++ = 0;
@@ -199,13 +196,13 @@ load:
 					*p2 = 0;
 			}
 			if (def == S_DEF_USER) {
-				sym = sym_find(line + 7);
+				sym = sym_find(line);
 				if (!sym) {
-					conf_warning("trying to assign nonexistent symbol %s", line + 7);
+					conf_warning("trying to assign nonexistent symbol %s", line);
 					break;
 				}
 			} else {
-				sym = sym_lookup(line + 7, 0);
+				sym = sym_lookup(line, 0);
 				if (sym->type == S_UNKNOWN)
 					sym->type = S_OTHER;
 			}
@@ -416,7 +413,7 @@ int conf_write(const char *name)
 	if (!out)
 		return 1;
 
-	sym = sym_lookup("KERNELVERSION", 0);
+	sym = sym_lookup("BR2_VERSION", 0);
 	sym_calc_value(sym);
 	time(&now);
 	env = getenv("KCONFIG_NOTIMESTAMP");
@@ -425,10 +422,8 @@ int conf_write(const char *name)
 
 	fprintf(out, _("#\n"
 		       "# Automatically generated make config: don't edit\n"
-		       "# Linux kernel version: %s\n"
 		       "%s%s"
 		       "#\n"),
-		     sym_get_string_value(sym),
 		     use_timestamp ? "# " : "",
 		     use_timestamp ? ctime(&now) : "");
 
@@ -462,19 +457,19 @@ int conf_write(const char *name)
 			case S_TRISTATE:
 				switch (sym_get_tristate_value(sym)) {
 				case no:
-					fprintf(out, "# CONFIG_%s is not set\n", sym->name);
+					fprintf(out, "# %s is not set\n", sym->name);
 					break;
 				case mod:
-					fprintf(out, "CONFIG_%s=m\n", sym->name);
+					fprintf(out, "%s=m\n", sym->name);
 					break;
 				case yes:
-					fprintf(out, "CONFIG_%s=y\n", sym->name);
+					fprintf(out, "%s=y\n", sym->name);
 					break;
 				}
 				break;
 			case S_STRING:
 				str = sym_get_string_value(sym);
-				fprintf(out, "CONFIG_%s=\"", sym->name);
+				fprintf(out, "%s=\"", sym->name);
 				while (1) {
 					l = strcspn(str, "\"\\");
 					if (l) {
@@ -490,12 +485,12 @@ int conf_write(const char *name)
 			case S_HEX:
 				str = sym_get_string_value(sym);
 				if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
-					fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
+					fprintf(out, "%s=%s\n", sym->name, str);
 					break;
 				}
 			case S_INT:
 				str = sym_get_string_value(sym);
-				fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
+				fprintf(out, "%s=%s\n", sym->name, str);
 				break;
 			}
 		}
@@ -535,7 +530,7 @@ int conf_write(const char *name)
 
 int conf_split_config(void)
 {
-	char *name, path[128];
+	char *name, path[128], *opwd, *dir, *_name;
 	char *s, *d, c;
 	struct symbol *sym;
 	struct stat sb;
@@ -546,8 +541,20 @@ int conf_split_config(void)
 		name = "include/config/auto.conf";
 	conf_read_simple(name, S_DEF_AUTO);
 
-	if (chdir("include/config"))
+	opwd = malloc(256);
+	_name = strdup(name);
+	if (opwd == NULL || _name == NULL)
 		return 1;
+	opwd = getcwd(opwd, 256);
+	dir = dirname(_name);
+	if (dir == NULL) {
+		res = 1;
+		goto err;
+	}
+	if (chdir(dir)) {
+		res = 1;
+		goto err;
+	}
 
 	res = 0;
 	for_all_symbols(i, sym) {
@@ -640,9 +647,11 @@ int conf_split_config(void)
 		close(fd);
 	}
 out:
-	if (chdir("../.."))
-		return 1;
-
+	if (chdir(opwd))
+		res = 1;
+err:
+	free(opwd);
+	free(_name);
 	return res;
 }
 
@@ -657,7 +666,7 @@ int conf_write_autoconf(void)
 
 	sym_clear_all_valid();
 
-	file_write_dep("include/config/auto.conf.cmd");
+	file_write_dep(".config.cmd");
 
 	if (conf_split_config())
 		return 1;
@@ -672,22 +681,19 @@ int conf_write_autoconf(void)
 		return 1;
 	}
 
-	sym = sym_lookup("KERNELVERSION", 0);
+	sym = sym_lookup("BR2_VERSION", 0);
 	sym_calc_value(sym);
 	time(&now);
 	fprintf(out, "#\n"
 		     "# Automatically generated make config: don't edit\n"
-		     "# Linux kernel version: %s\n"
 		     "# %s"
 		     "#\n",
-		     sym_get_string_value(sym), ctime(&now));
+		     ctime(&now));
 	fprintf(out_h, "/*\n"
 		       " * Automatically generated C config: don't edit\n"
-		       " * Linux kernel version: %s\n"
 		       " * %s"
-		       " */\n"
-		       "#define AUTOCONF_INCLUDED\n",
-		       sym_get_string_value(sym), ctime(&now));
+		       " */\n",
+		       ctime(&now));
 
 	for_all_symbols(i, sym) {
 		sym_calc_value(sym);
@@ -700,19 +706,19 @@ int conf_write_autoconf(void)
 			case no:
 				break;
 			case mod:
-				fprintf(out, "CONFIG_%s=m\n", sym->name);
-				fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name);
+				fprintf(out, "%s=m\n", sym->name);
+				fprintf(out_h, "#define %s_MODULE 1\n", sym->name);
 				break;
 			case yes:
-				fprintf(out, "CONFIG_%s=y\n", sym->name);
-				fprintf(out_h, "#define CONFIG_%s 1\n", sym->name);
+				fprintf(out, "%s=y\n", sym->name);
+				fprintf(out_h, "#define %s 1\n", sym->name);
 				break;
 			}
 			break;
 		case S_STRING:
 			str = sym_get_string_value(sym);
-			fprintf(out, "CONFIG_%s=\"", sym->name);
-			fprintf(out_h, "#define CONFIG_%s \"", sym->name);
+			fprintf(out, "%s=\"", sym->name);
+			fprintf(out_h, "#define %s \"", sym->name);
 			while (1) {
 				l = strcspn(str, "\"\\");
 				if (l) {
@@ -732,14 +738,14 @@ int conf_write_autoconf(void)
 		case S_HEX:
 			str = sym_get_string_value(sym);
 			if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
-				fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
-				fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str);
+				fprintf(out, "%s=%s\n", 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, "CONFIG_%s=%s\n", sym->name, str);
-			fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str);
+			fprintf(out, "%s=%s\n", sym->name, str);
+			fprintf(out_h, "#define %s %s\n", sym->name, str);
 			break;
 		default:
 			break;
diff -rdup kernel-config/expr.c config/expr.c
--- kernel-config/expr.c	2007-09-22 00:38:23.000000000 +0200
+++ config/expr.c	2007-09-23 15:33:26.000000000 +0200
@@ -331,7 +331,7 @@ struct expr *expr_trans_bool(struct expr
 		e->right.expr = expr_trans_bool(e->right.expr);
 		break;
 	case E_UNEQUAL:
-		// FOO!=n -> FOO
+		/* FOO!=n -> FOO */
 		if (e->left.sym->type == S_TRISTATE) {
 			if (e->right.sym == &symbol_no) {
 				e->type = E_SYMBOL;
@@ -380,19 +380,19 @@ struct expr *expr_join_or(struct expr *e
 		if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
 		    ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
 		     (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) {
-			// (a='y') || (a='m') -> (a!='n')
+			/* (a='y') || (a='m') -> (a!='n') */
 			return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_no);
 		}
 		if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
 		    ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
 		     (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) {
-			// (a='y') || (a='n') -> (a!='m')
+			/* (a='y') || (a='n') -> (a!='m') */
 			return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_mod);
 		}
 		if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
 		    ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
 		     (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) {
-			// (a='m') || (a='n') -> (a!='y')
+			/* (a='m') || (a='n') -> (a!='y') */
 			return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes);
 		}
 	}
@@ -443,29 +443,29 @@ struct expr *expr_join_and(struct expr *
 
 	if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) ||
 	    (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes))
-		// (a) && (a='y') -> (a='y')
+		/* (a) && (a='y') -> (a='y') */
 		return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
 
 	if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) ||
 	    (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no))
-		// (a) && (a!='n') -> (a)
+		/* (a) && (a!='n') -> (a) */
 		return expr_alloc_symbol(sym1);
 
 	if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) ||
 	    (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod))
-		// (a) && (a!='m') -> (a='y')
+		/* (a) && (a!='m') -> (a='y') */
 		return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
 
 	if (sym1->type == S_TRISTATE) {
 		if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) {
-			// (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
+			/* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */
 			sym2 = e1->right.sym;
 			if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
 				return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
 							     : expr_alloc_symbol(&symbol_no);
 		}
 		if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) {
-			// (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
+			/* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */
 			sym2 = e2->right.sym;
 			if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
 				return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
@@ -474,19 +474,19 @@ struct expr *expr_join_and(struct expr *
 		if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
 			   ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
 			    (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes)))
-			// (a!='y') && (a!='n') -> (a='m')
+			/* (a!='y') && (a!='n') -> (a='m') */
 			return expr_alloc_comp(E_EQUAL, sym1, &symbol_mod);
 
 		if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
 			   ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
 			    (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes)))
-			// (a!='y') && (a!='m') -> (a='n')
+			/* (a!='y') && (a!='m') -> (a='n') */
 			return expr_alloc_comp(E_EQUAL, sym1, &symbol_no);
 
 		if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
 			   ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
 			    (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod)))
-			// (a!='m') && (a!='n') -> (a='m')
+			/* (a!='m') && (a!='n') -> (a='m') */
 			return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
 
 		if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) ||
@@ -579,7 +579,7 @@ static void expr_eliminate_dups2(enum ex
 	switch (e1->type) {
 	case E_OR:
 		expr_eliminate_dups2(e1->type, &e1, &e1);
-		// (FOO || BAR) && (!FOO && !BAR) -> n
+		/* (FOO || BAR) && (!FOO && !BAR) -> n */
 		tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
 		tmp2 = expr_copy(e2);
 		tmp = expr_extract_eq_and(&tmp1, &tmp2);
@@ -594,7 +594,7 @@ static void expr_eliminate_dups2(enum ex
 		break;
 	case E_AND:
 		expr_eliminate_dups2(e1->type, &e1, &e1);
-		// (FOO && BAR) || (!FOO || !BAR) -> y
+		/* (FOO && BAR) || (!FOO || !BAR) -> y */
 		tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
 		tmp2 = expr_copy(e2);
 		tmp = expr_extract_eq_or(&tmp1, &tmp2);
@@ -703,7 +703,7 @@ struct expr *expr_transform(struct expr 
 	case E_NOT:
 		switch (e->left.expr->type) {
 		case E_NOT:
-			// !!a -> a
+			/* !!a -> a */
 			tmp = e->left.expr->left.expr;
 			free(e->left.expr);
 			free(e);
@@ -712,14 +712,14 @@ struct expr *expr_transform(struct expr 
 			break;
 		case E_EQUAL:
 		case E_UNEQUAL:
-			// !a='x' -> a!='x'
+			/* !a='x' -> a!='x' */
 			tmp = e->left.expr;
 			free(e);
 			e = tmp;
 			e->type = e->type == E_EQUAL ? E_UNEQUAL : E_EQUAL;
 			break;
 		case E_OR:
-			// !(a || b) -> !a && !b
+			/* !(a || b) -> !a && !b */
 			tmp = e->left.expr;
 			e->type = E_AND;
 			e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
@@ -728,7 +728,7 @@ struct expr *expr_transform(struct expr 
 			e = expr_transform(e);
 			break;
 		case E_AND:
-			// !(a && b) -> !a || !b
+			/* !(a && b) -> !a || !b */
 			tmp = e->left.expr;
 			e->type = E_OR;
 			e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
@@ -738,7 +738,7 @@ struct expr *expr_transform(struct expr 
 			break;
 		case E_SYMBOL:
 			if (e->left.expr->left.sym == &symbol_yes) {
-				// !'y' -> 'n'
+				/* !'y' -> 'n' */
 				tmp = e->left.expr;
 				free(e);
 				e = tmp;
@@ -747,7 +747,7 @@ struct expr *expr_transform(struct expr 
 				break;
 			}
 			if (e->left.expr->left.sym == &symbol_mod) {
-				// !'m' -> 'm'
+				/* !'m' -> 'm' */
 				tmp = e->left.expr;
 				free(e);
 				e = tmp;
@@ -756,7 +756,7 @@ struct expr *expr_transform(struct expr 
 				break;
 			}
 			if (e->left.expr->left.sym == &symbol_no) {
-				// !'n' -> 'y'
+				/* !'n' -> 'y' */
 				tmp = e->left.expr;
 				free(e);
 				e = tmp;
diff -rdup kernel-config/expr.h config/expr.h
--- kernel-config/expr.h	2007-09-22 00:38:23.000000000 +0200
+++ config/expr.h	2007-09-23 15:33:26.000000000 +0200
@@ -65,7 +65,7 @@ enum symbol_type {
 
 enum {
 	S_DEF_USER,		/* main user value */
-	S_DEF_AUTO,
+	S_DEF_AUTO
 };
 
 struct symbol {
diff -rdup kernel-config/gconf.c config/gconf.c
--- kernel-config/gconf.c	2007-09-22 00:38:23.000000000 +0200
+++ config/gconf.c	2007-09-23 15:33:26.000000000 +0200
@@ -271,8 +271,8 @@ void init_main_window(const gchar * glad
 					  /*"style", PANGO_STYLE_OBLIQUE, */
 					  NULL);
 
-	sprintf(title, _("Linux Kernel v%s Configuration"),
-		getenv("KERNELVERSION"));
+	sprintf(title, _("Buildroot v%s Configuration"),
+		getenv("BR2_VERSION"));
 	gtk_window_set_title(GTK_WINDOW(main_wnd), title);
 
 	gtk_widget_show(main_wnd);
diff -rdup kernel-config/gconf.glade config/gconf.glade
--- kernel-config/gconf.glade	2007-09-22 00:38:23.000000000 +0200
+++ config/gconf.glade	2007-09-23 15:33:26.000000000 +0200
@@ -5,7 +5,7 @@
 
 <widget class="GtkWindow" id="window1">
   <property name="visible">True</property>
-  <property name="title" translatable="yes">Gtk Kernel Configurator</property>
+  <property name="title" translatable="yes">Gtk Buildroot Configurator</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="window_position">GTK_WIN_POS_NONE</property>
   <property name="modal">False</property>
diff -rdup kernel-config/mconf.c config/mconf.c
--- kernel-config/mconf.c	2007-09-22 00:38:23.000000000 +0200
+++ config/mconf.c	2007-09-23 15:36:33.000000000 +0200
@@ -29,20 +29,18 @@
 static const char mconf_readme[] = N_(
 "Overview\n"
 "--------\n"
-"Some kernel features may be built directly into the kernel.\n"
-"Some may be made into loadable runtime modules.  Some features\n"
+"Some features may be built directly into Buildroot.  Some features\n"
 "may be completely removed altogether.  There are also certain\n"
-"kernel parameters which are not really features, but must be\n"
+"parameters which are not really features, but must be\n"
 "entered in as decimal or hexadecimal numbers or possibly text.\n"
 "\n"
-"Menu items beginning with [*], <M> or [ ] represent features\n"
-"configured to be built in, modularized or removed respectively.\n"
-"Pointed brackets <> represent module capable features.\n"
+"Menu items beginning with [*] or [ ] represent features\n"
+"configured to be built in or removed respectively.\n"
 "\n"
 "To change any of these features, highlight it with the cursor\n"
-"keys and press <Y> to build it in, <M> to make it a module or\n"
-"<N> to removed it.  You may also press the <Space Bar> to cycle\n"
-"through the available options (ie. Y->N->M->Y).\n"
+"keys and press <Y> to build it in or <N> to removed it.\n"
+"You may also press the <Space Bar> to cycle\n"
+"through the available options (ie. Y->N->Y).\n"
 "\n"
 "Some additional keyboard hints:\n"
 "\n"
@@ -115,7 +113,7 @@ static const char mconf_readme[] = N_(
 "-----------------------------\n"
 "Menuconfig supports the use of alternate configuration files for\n"
 "those who, for various reasons, find it necessary to switch\n"
-"between different kernel configurations.\n"
+"between different configurations.\n"
 "\n"
 "At the end of the main menu you will find two options.  One is\n"
 "for saving the current configuration to a file of your choosing.\n"
@@ -148,7 +146,7 @@ static const char mconf_readme[] = N_(
 "\n"
 "Optional personality available\n"
 "------------------------------\n"
-"If you prefer to have all of the kernel options listed in a single\n"
+"If you prefer to have all of the options listed in a single\n"
 "menu, rather than the default multimenu hierarchy, run the menuconfig\n"
 "with MENUCONFIG_MODE environment variable set to single_menu. Example:\n"
 "\n"
@@ -178,9 +176,9 @@ menu_instructions[] = N_(
 	"Arrow keys navigate the menu.  "
 	"<Enter> selects submenus --->.  "
 	"Highlighted letters are hotkeys.  "
-	"Pressing <Y> includes, <N> excludes, <M> modularizes features.  "
+	"Pressing <Y> selectes a feature, while <N> will exclude a feature.  "
 	"Press <Esc><Esc> to exit, <?> for Help, </> for Search.  "
-	"Legend: [*] built-in  [ ] excluded  <M> module  < > module capable"),
+	"Legend: [*] feature is selected  [ ] feature is excluded"),
 radiolist_instructions[] = N_(
 	"Use the arrow keys to navigate this window or "
 	"press the hotkey of the item you wish to select "
@@ -200,18 +198,18 @@ setmod_text[] = N_(
 	"This feature depends on another which has been configured as a module.\n"
 	"As a result, this feature will be built as a module."),
 nohelp_text[] = N_(
-	"There is no help available for this kernel option.\n"),
+	"There is no help available for this option.\n"),
 load_config_text[] = N_(
 	"Enter the name of the configuration file you wish to load.  "
 	"Accept the name shown to restore the configuration you "
 	"last retrieved.  Leave blank to abort."),
 load_config_help[] = N_(
 	"\n"
-	"For various reasons, one may wish to keep several different kernel\n"
+	"For various reasons, one may wish to keep several different Buildroot\n"
 	"configurations available on a single machine.\n"
 	"\n"
 	"If you have saved a previous configuration in a file other than the\n"
-	"kernel's default, entering the name of the file here will allow you\n"
+	"Buildroot's default, entering the name of the file here will allow you\n"
 	"to modify that configuration.\n"
 	"\n"
 	"If you are uncertain, then you have probably never used alternate\n"
@@ -221,7 +219,7 @@ save_config_text[] = N_(
 	"as an alternate.  Leave blank to abort."),
 save_config_help[] = N_(
 	"\n"
-	"For various reasons, one may wish to keep different kernel\n"
+	"For various reasons, one may wish to keep different Buildroot\n"
 	"configurations available on a single machine.\n"
 	"\n"
 	"Entering a file name here will allow you to later retrieve, modify\n"
@@ -400,10 +398,10 @@ static void set_config_filename(const ch
 	int size;
 	struct symbol *sym;
 
-	sym = sym_lookup("KERNELVERSION", 0);
+	sym = sym_lookup("BR2_VERSION", 0);
 	sym_calc_value(sym);
 	size = snprintf(menu_backtitle, sizeof(menu_backtitle),
-	                _("%s - Linux Kernel v%s Configuration"),
+	                _("%s - buildroot v%s Configuration"),
 		        config_filename, sym_get_string_value(sym));
 	if (size >= sizeof(menu_backtitle))
 		menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
@@ -912,7 +910,7 @@ int main(int ac, char **av)
 		if (conf_get_changed())
 			res = dialog_yesno(NULL,
 					   _("Do you wish to save your "
-					     "new kernel configuration?\n"
+					     "new Buildroot configuration?\n"
 					     "<ESC><ESC> to continue."),
 					   6, 60);
 		else
@@ -924,22 +922,22 @@ int main(int ac, char **av)
 	case 0:
 		if (conf_write(filename)) {
 			fprintf(stderr, _("\n\n"
-				"Error during writing of the kernel configuration.\n"
-				"Your kernel configuration changes were NOT saved."
+				"Error during writing of the Buildroot configuration.\n"
+				"Your Buildroot configuration changes were NOT saved."
 				"\n\n"));
 			return 1;
 		}
 	case -1:
 		printf(_("\n\n"
-			"*** End of Linux kernel configuration.\n"
-			"*** Execute 'make' to build the kernel or try 'make help'."
+			"*** End of Buildroot configuration.\n"
+			"*** Execute 'make' to build Buildroot or try 'make help'."
 			"\n\n"));
 		break;
 	default:
 		fprintf(stderr, _("\n\n"
-			"Your kernel configuration changes were NOT saved."
+			"Your Buildroot configuration changes were NOT saved."
 			"\n\n"));
 	}
 
-	return 0;
+	return conf_write_autoconf();
 }
diff -rdup kernel-config/symbol.c config/symbol.c
--- kernel-config/symbol.c	2007-09-22 00:38:23.000000000 +0200
+++ config/symbol.c	2007-09-23 15:33:26.000000000 +0200
@@ -61,10 +61,10 @@ void sym_init(void)
 	if (p)
 		sym_add_default(sym, p);
 
-	sym = sym_lookup("KERNELVERSION", 0);
+	sym = sym_lookup("BR2_VERSION", 0);
 	sym->type = S_STRING;
 	sym->flags |= SYMBOL_AUTO;
-	p = getenv("KERNELVERSION");
+	p = getenv("BR2_VERSION");
 	if (p)
 		sym_add_default(sym, p);
 
diff -rdup kernel-config/zconf.tab.c_shipped config/zconf.tab.c_shipped
--- kernel-config/zconf.tab.c_shipped	2007-09-22 00:38:23.000000000 +0200
+++ config/zconf.tab.c_shipped	2007-09-23 15:33:26.000000000 +0200
@@ -2115,7 +2115,7 @@ void conf_parse(const char *name)
 	modules_sym = sym_lookup(NULL, 0);
 	modules_sym->type = S_BOOLEAN;
 	modules_sym->flags |= SYMBOL_AUTO;
-	rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
+	rootmenu.prompt = menu_add_prompt(P_MENU, "Buildroot Configuration", NULL);
 
 #if YYDEBUG
 	if (getenv("ZCONF_DEBUG"))
diff -rdup kernel-config/zconf.y config/zconf.y
--- kernel-config/zconf.y	2007-09-22 00:38:23.000000000 +0200
+++ config/zconf.y	2007-09-23 15:33:26.000000000 +0200
@@ -484,7 +484,7 @@ void conf_parse(const char *name)
 	modules_sym = sym_lookup(NULL, 0);
 	modules_sym->type = S_BOOLEAN;
 	modules_sym->flags |= SYMBOL_AUTO;
-	rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
+	rootmenu.prompt = menu_add_prompt(P_MENU, "Buildroot Configuration", NULL);
 
 #if YYDEBUG
 	if (getenv("ZCONF_DEBUG"))
--- kernel-config/Makefile	2007-09-22 00:38:23.000000000 +0200
+++ config/Makefile	2007-07-27 20:09:15.000000000 +0200
@@ -120,6 +120,9 @@
 ifeq ($(MAKECMDGOALS),menuconfig)
 	hostprogs-y += mconf
 endif
+ifeq ($(findstring mconf,$(MAKECMDGOALS)),mconf)
+	hostprogs-y += mconf
+endif
 
 ifeq ($(MAKECMDGOALS),xconfig)
 	qconf-target := 1
@@ -184,8 +186,8 @@
 	  done; \
 	  if [ -z "$$dir" ]; then \
 	    echo "*"; \
-	    echo "* Unable to find the QT3 installation. Please make sure that"; \
-	    echo "* the QT3 development package is correctly installed and"; \
+	    echo "* Unable to find the QT installation. Please make sure that"; \
+	    echo "* the QT development package is correctly installed and"; \
 	    echo "* either install pkg-config or set the QTDIR environment"; \
 	    echo "* variable to the correct location."; \
 	    echo "*"; \
--- kernel-config/util.c	2007-09-22 00:38:23.000000000 +0200
+++ config/util.c	2007-09-23 15:57:18.000000000 +0200
@@ -44,7 +44,7 @@
 		else
 			fprintf(out, "\t%s\n", file->name);
 	}
-	fprintf(out, "\ninclude/config/auto.conf: \\\n"
+	fprintf(out, "\n$(BR2_DEPENDS_DIR)/config/auto.conf: \\\n"
 		     "\t$(deps_config)\n\n"
 		     "$(deps_config): ;\n");
 	fclose(out);
--- kernel-config/confdata.c	2007-09-23 15:33:26.000000000 +0200
+++ config/confdata.c	2007-09-23 16:10:52.000000000 +0200
@@ -37,7 +37,7 @@
 
 const char *conf_get_configname(void)
 {
-	char *name = getenv("KCONFIG_CONFIG");
+	char *name = getenv("BUILDROOT_CONFIG");
 
 	return name ? name : ".config";
 }
Index: util.c
===================================================================
--- kernel-config/util.c	(revision 19969)
+++ config/util.c	(working copy)
@@ -26,6 +26,109 @@ struct file *file_lookup(const char *nam
 	return file;
 }
 
+static char* br2_symbol_printer(const char * const in)
+{
+	ssize_t i, j, len = strlen(in);
+	char *ret;
+	if (len < 1)
+		return NULL;
+	ret = malloc(len);
+	if (!ret) {
+		printf("Out of memory!");
+		exit(1);
+	}
+	memset(ret, 0, len);
+	i = j = 0;
+	if (strncmp("BR2_", in, 4) == 0)
+		i += 4;
+	if (strncmp("PACKAGE_", in + i, 8) == 0)
+		i += 8;
+	else if (strncmp("TARGET_", in + i, 7) == 0)
+		i += 7;
+	while (i <= len)
+		ret[j++] = tolower(in[i++]);
+	return ret;
+}
+
+/* write dependencies of the infividual config-symbols */
+static int write_make_deps(const char *name)
+{
+	struct menu *menu;
+	struct symbol *sym;
+	struct property *prop, *p;
+	unsigned done;
+	const char * const name_tmp = "..make.deps.tmp";
+	FILE *out;
+	if (!name)
+		name = ".auto.deps";
+	out = fopen(name_tmp, "w");
+	if (!out)
+		return 1;
+	fprintf(out, "# ATTENTION! This does not handle 'depends', just 'select'! \n"
+		"# See package/config/util.c write_make_deps()\n#\n");
+	menu = &rootmenu;//rootmenu.list;
+	while (menu) {
+		sym = menu->sym;
+		if (!sym) {
+			if (!menu_is_visible(menu))
+				goto next;
+		} else if (!(sym->flags & SYMBOL_CHOICE)) {
+			sym_calc_value(sym);
+			if (sym->type == S_BOOLEAN
+			    && sym_get_tristate_value(sym) != no) {
+			    done = 0;
+			    for_all_prompts(sym, prop) {
+			        struct expr *e;
+//printf("\nname=%s\n", sym->name);
+			        for_all_properties(sym, p, P_SELECT) {
+				    e = p->expr;
+				    if (e && e->left.sym->name) {
+				        if (!done) {
+					    fprintf(out, "%s: $(BASE_TARGETS)", br2_symbol_printer(sym->name));
+					    done = 1;
+					}
+//printf("SELECTS %s\n",e->left.sym->name);
+					fprintf(out, " %s",br2_symbol_printer(e->left.sym->name));
+				    }
+				}
+				if (done)
+				    fprintf(out, "\n");
+#if 0
+				e = sym->rev_dep.expr;
+				if (e && e->type == E_SYMBOL
+					&& e->left.sym->name) {
+				    fprintf(out, "%s: %s", br2_symbol_printer(e->left.sym->name),
+						br2_symbol_printer(sym->name));
+printf("%s is Selected BY: %s", sym->name, e->left.sym->name);
+				}
+#endif
+			    }
+			}
+		}
+next:
+		if (menu->list) {
+			menu = menu->list;
+			continue;
+		}
+		if (menu->next)
+			menu = menu->next;
+		else while ((menu = menu->parent)) {
+			if (menu->next) {
+				menu = menu->next;
+				break;
+			}
+		}
+	}
+	fclose(out);
+	rename(name_tmp, name);
+	printf(_("#\n"
+		 "# make dependencies written to %s\n"
+		 "# ATTENTION buildroot devels!\n"
+		 "# See top of this file before playing with this auto-preprequisites!\n"
+		 "#\n"), name);
+	return 0;
+}
+
 /* write a dependency file as used by kbuild to track dependencies */
 int file_write_dep(const char *name)
 {
@@ -49,7 +152,8 @@ int file_write_dep(const char *name)
 		     "$(deps_config): ;\n");
 	fclose(out);
 	rename("..config.tmp", name);
-	return 0;
+
+	return write_make_deps(NULL);
 }