2009-07-20 18:50:58 +02:00
---
2009-07-20 19:17:10 +02:00
Makefile | 7 +++
2009-07-20 18:50:58 +02:00
README.buildroot2 | 22 ++++++++++
2009-08-03 10:07:54 +02:00
conf.c | 17 ++++----
2009-07-20 18:50:58 +02:00
confdata.c | 101 ++++++++++++++++++++++++++------------------------
expr.c | 42 ++++++++++----------
gconf.c | 4 -
gconf.glade | 2
mconf.c | 39 +++++++++----------
2009-07-21 18:21:32 +02:00
qconf.cc | 5 +-
2009-07-20 18:50:58 +02:00
util.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++-
zconf.tab.c_shipped | 2
zconf.y | 2
2009-08-03 10:07:54 +02:00
12 files changed, 244 insertions(+), 104 deletions(-)
2009-07-20 18:50:58 +02:00
Index: config/Makefile
===================================================================
--- config.orig/Makefile
+++ config/Makefile
2009-07-20 19:17:10 +02:00
@@ -124,10 +124,17 @@
2008-06-19 10:11:51 +02:00
ifeq ($(MAKECMDGOALS),menuconfig)
hostprogs-y += mconf
endif
+ifeq ($(findstring mconf,$(MAKECMDGOALS)),mconf)
2009-07-20 18:50:58 +02:00
+ hostprogs-y += mconf
2008-06-19 10:11:51 +02:00
+endif
ifeq ($(MAKECMDGOALS),xconfig)
qconf-target := 1
2009-07-20 19:17:10 +02:00
endif
+ifeq ($(findstring qconf,$(MAKECMDGOALS)),qconf)
+ qconf-target := 1
+endif
+
ifeq ($(MAKECMDGOALS),gconfig)
gconf-target := 1
endif
2009-07-20 18:50:58 +02:00
Index: config/README.buildroot2
===================================================================
--- /dev/null
+++ config/README.buildroot2
@@ -0,0 +1,22 @@
+This is a copy of the kconfig code in the kernel (currently 2.6.24.4) tweaked
+to suit Buildroot.
+
+To update:
+ cp -r /usr/src/linux/scripts/kconfig package/config.new
+ cd package/config.new
+ cp /usr/src/linux/Documentation/kbuild/kconfig-language.txt .
+ patch -p1 < ../config/kconfig-to-buildroot2.patch
+ mv Makefile Makefile.kconfig
+ cp ../config/README.buildroot2 .
+ cp ../config/foo.h .
+ cp ../config/Makefile .
+ cp ../config/kconfig-to-buildroot2.patch .
+ cd ..
+ rm -rf config
+ mv config.new config
+
+Then verify the toplevel targets work:
+ config
+ defconfig
+ menuconfig
+ oldconfig
Index: config/conf.c
===================================================================
--- config.orig/conf.c
+++ config/conf.c
@@ -496,13 +496,12 @@
2007-06-28 14:11:12 +02:00
}
2009-07-20 18:50:58 +02:00
name = av[optind];
2007-06-28 14:11:12 +02:00
conf_parse(name);
- //zconfdump(stdout);
2009-07-20 18:50:58 +02:00
if (sync_kconfig) {
name = conf_get_configname();
if (stat(name, &tmpstat)) {
fprintf(stderr, _("***\n"
2007-06-28 12:46:19 +02:00
- "*** You have not yet configured your kernel!\n"
2009-07-20 18:50:58 +02:00
- "*** (missing kernel config file \"%s\")\n"
2007-06-28 12:46:19 +02:00
+ "*** You have not yet configured Buildroot!\n"
2009-07-20 18:50:58 +02:00
+ "*** (missing .config file \"%s\")\n"
2007-06-28 12:46:19 +02:00
"***\n"
"*** Please run some configurator (e.g. \"make oldconfig\" or\n"
2009-07-20 18:50:58 +02:00
"*** \"make menuconfig\" or \"make xconfig\").\n"
@@ -557,7 +556,7 @@
name = getenv("KCONFIG_NOSILENTUPDATE");
if (name && *name) {
fprintf(stderr,
- _("\n*** Kernel configuration requires explicit update.\n\n"));
+ _("\n*** Buildroot configuration requires explicit update.\n\n"));
return 1;
}
}
2009-08-03 10:07:54 +02:00
@@ -600,18 +599,22 @@
2009-07-20 18:50:58 +02:00
* All other commands are only used to generate a config.
*/
if (conf_get_changed() && 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"));
2007-06-28 12:46:19 +02:00
exit(1);
}
2009-07-20 18:50:58 +02:00
if (conf_write_autoconf()) {
- fprintf(stderr, _("\n*** Error during update of the kernel configuration.\n\n"));
+ fprintf(stderr, _("\n*** Error during update of the Buildroot configuration.\n\n"));
2007-06-28 12:46:19 +02:00
return 1;
}
2009-07-20 18:50:58 +02:00
} else {
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"));
exit(1);
}
2009-08-03 10:07:54 +02:00
+ if (conf_write_autoconf()) {
+ fprintf(stderr, _("\n*** Error during update of the Buildroot configuration.\n\n"));
+ return 1;
+ }
2007-06-28 12:46:19 +02:00
}
2009-08-03 10:07:54 +02:00
return 0;
}
2009-07-20 18:50:58 +02:00
Index: config/confdata.c
===================================================================
--- config.orig/confdata.c
+++ config/confdata.c
2007-09-23 16:06:59 +02:00
@@ -11,6 +11,7 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <libgen.h>
#define LKC_DIRECT_LINK
#include "lkc.h"
2009-07-20 18:50:58 +02:00
@@ -21,7 +22,7 @@
2007-06-28 12:46:19 +02:00
static const char *conf_filename;
static int conf_lineno, conf_warnings, conf_unsaved;
-const char conf_defname[] = "arch/$ARCH/defconfig";
2007-09-23 16:06:59 +02:00
+const char conf_defname[] = ".defconfig";
2007-06-28 12:46:19 +02:00
static void conf_warning(const char *fmt, ...)
{
2009-08-03 10:07:54 +02:00
@@ -36,16 +37,14 @@
2008-06-19 10:11:51 +02:00
const char *conf_get_configname(void)
{
- char *name = getenv("KCONFIG_CONFIG");
+ char *name = getenv("BUILDROOT_CONFIG");
return name ? name : ".config";
}
2009-07-20 18:50:58 +02:00
const char *conf_get_autoconfig_name(void)
{
- char *name = getenv("KCONFIG_AUTOCONFIG");
2009-08-03 10:07:54 +02:00
-
2009-07-20 18:50:58 +02:00
- return name ? name : "include/config/auto.conf";
2009-08-03 10:07:54 +02:00
+ return getenv("KCONFIG_AUTOCONFIG");
2009-07-20 18:50:58 +02:00
}
static char *conf_expand_value(const char *in)
2009-08-03 10:07:54 +02:00
@@ -219,22 +218,22 @@
2007-06-28 12:46:19 +02:00
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) {
2009-07-20 18:50:58 +02:00
sym_add_change_count(1);
2007-06-28 12:46:19 +02:00
break;
}
} else {
- sym = sym_lookup(line + 9, 0);
+ sym = sym_lookup(line + 2, 0);
if (sym->type == S_UNKNOWN)
sym->type = S_BOOLEAN;
}
2009-08-03 10:07:54 +02:00
@@ -251,12 +250,8 @@
2007-06-28 12:46:19 +02:00
;
}
break;
- case 'C':
- if (memcmp(line, "CONFIG_", 7)) {
- conf_warning("unexpected data");
- continue;
- }
- p = strchr(line + 7, '=');
2007-06-28 13:53:59 +02:00
+ 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':
2007-06-28 12:46:19 +02:00
+ p = strchr(line, '=');
if (!p)
continue;
*p++ = 0;
2009-08-03 10:07:54 +02:00
@@ -267,13 +262,13 @@
2007-06-28 12:46:19 +02:00
*p2 = 0;
}
if (def == S_DEF_USER) {
- sym = sym_find(line + 7);
+ sym = sym_find(line);
if (!sym) {
2009-07-20 18:50:58 +02:00
sym_add_change_count(1);
2007-06-28 12:46:19 +02:00
break;
}
} else {
- sym = sym_lookup(line + 7, 0);
+ sym = sym_lookup(line, 0);
if (sym->type == S_UNKNOWN)
sym->type = S_OTHER;
}
2009-08-03 10:07:54 +02:00
@@ -443,7 +438,7 @@
2007-06-28 12:46:19 +02:00
if (!out)
return 1;
- sym = sym_lookup("KERNELVERSION", 0);
2007-09-25 13:37:31 +02:00
+ sym = sym_lookup("BR2_VERSION", 0);
2007-06-28 12:46:19 +02:00
sym_calc_value(sym);
time(&now);
env = getenv("KCONFIG_NOTIMESTAMP");
2009-08-03 10:07:54 +02:00
@@ -452,10 +447,8 @@
2007-06-28 12:46:19 +02:00
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) : "");
2009-08-03 10:07:54 +02:00
@@ -489,19 +482,19 @@
2007-06-28 12:46:19 +02:00
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) {
2009-08-03 10:07:54 +02:00
@@ -517,12 +510,12 @@
2007-06-28 12:46:19 +02:00
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;
}
}
2009-08-03 10:07:54 +02:00
@@ -564,6 +557,7 @@
2007-09-23 16:06:59 +02:00
{
2009-07-20 18:50:58 +02:00
const char *name;
char path[128];
+ char *opwd, *dir, *_name;
2007-09-23 16:06:59 +02:00
char *s, *d, c;
struct symbol *sym;
struct stat sb;
2009-08-03 10:07:54 +02:00
@@ -572,8 +566,20 @@
2009-07-20 18:50:58 +02:00
name = conf_get_autoconfig_name();
2007-09-23 16:06:59 +02:00
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) {
2009-08-03 10:07:54 +02:00
@@ -666,9 +672,11 @@
2007-09-23 16:06:59 +02:00
close(fd);
}
out:
- if (chdir("../.."))
- return 1;
-
+ if (chdir(opwd))
+ res = 1;
+err:
+ free(opwd);
+ free(_name);
return res;
}
2009-08-03 10:07:54 +02:00
@@ -683,7 +691,7 @@
2007-09-23 16:06:59 +02:00
sym_clear_all_valid();
- file_write_dep("include/config/auto.conf.cmd");
+ file_write_dep(".config.cmd");
if (conf_split_config())
return 1;
2009-08-03 10:07:54 +02:00
@@ -698,22 +706,19 @@
2007-06-28 12:46:19 +02:00
return 1;
}
- sym = sym_lookup("KERNELVERSION", 0);
2007-09-25 13:37:31 +02:00
+ sym = sym_lookup("BR2_VERSION", 0);
2007-06-28 12:46:19 +02:00
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);
2009-08-03 10:07:54 +02:00
@@ -726,19 +731,19 @@
2007-06-28 12:46:19 +02:00
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) {
2009-08-03 10:07:54 +02:00
@@ -758,14 +763,14 @@
2007-06-28 12:46:19 +02:00
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;
2009-07-20 18:50:58 +02:00
Index: config/expr.c
===================================================================
--- config.orig/expr.c
+++ config/expr.c
@@ -331,7 +331,7 @@
2007-06-28 14:11:12 +02:00
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;
2009-07-20 18:50:58 +02:00
@@ -380,19 +380,19 @@
2007-06-28 14:11:12 +02:00
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);
}
}
2009-07-20 18:50:58 +02:00
@@ -443,29 +443,29 @@
2007-06-28 14:11:12 +02:00
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)
2009-07-20 18:50:58 +02:00
@@ -474,19 +474,19 @@
2007-06-28 14:11:12 +02:00
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) ||
2009-07-20 18:50:58 +02:00
@@ -579,7 +579,7 @@
2007-06-28 14:11:12 +02:00
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);
2009-07-20 18:50:58 +02:00
@@ -594,7 +594,7 @@
2007-06-28 14:11:12 +02:00
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);
2009-07-20 18:50:58 +02:00
@@ -703,7 +703,7 @@
2007-06-28 14:11:12 +02:00
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);
2009-07-20 18:50:58 +02:00
@@ -712,14 +712,14 @@
2007-06-28 14:11:12 +02:00
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);
2009-07-20 18:50:58 +02:00
@@ -728,7 +728,7 @@
2007-06-28 14:11:12 +02:00
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);
2009-07-20 18:50:58 +02:00
@@ -738,7 +738,7 @@
2007-06-28 14:11:12 +02:00
break;
case E_SYMBOL:
if (e->left.expr->left.sym == &symbol_yes) {
- // !'y' -> 'n'
+ /* !'y' -> 'n' */
tmp = e->left.expr;
free(e);
e = tmp;
2009-07-20 18:50:58 +02:00
@@ -747,7 +747,7 @@
2007-06-28 14:11:12 +02:00
break;
}
if (e->left.expr->left.sym == &symbol_mod) {
- // !'m' -> 'm'
+ /* !'m' -> 'm' */
tmp = e->left.expr;
free(e);
e = tmp;
2009-07-20 18:50:58 +02:00
@@ -756,7 +756,7 @@
2007-06-28 14:11:12 +02:00
break;
}
if (e->left.expr->left.sym == &symbol_no) {
- // !'n' -> 'y'
+ /* !'n' -> 'y' */
tmp = e->left.expr;
free(e);
e = tmp;
2009-07-20 18:50:58 +02:00
Index: config/gconf.c
===================================================================
--- config.orig/gconf.c
+++ config/gconf.c
@@ -266,8 +266,8 @@
2007-06-28 12:46:19 +02:00
/*"style", PANGO_STYLE_OBLIQUE, */
NULL);
- sprintf(title, _("Linux Kernel v%s Configuration"),
- getenv("KERNELVERSION"));
+ sprintf(title, _("Buildroot v%s Configuration"),
2007-09-25 13:37:31 +02:00
+ getenv("BR2_VERSION"));
2007-06-28 12:46:19 +02:00
gtk_window_set_title(GTK_WINDOW(main_wnd), title);
gtk_widget_show(main_wnd);
2009-07-20 18:50:58 +02:00
Index: config/gconf.glade
===================================================================
--- config.orig/gconf.glade
+++ config/gconf.glade
2007-06-28 14:11:12 +02:00
@@ -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>
2009-07-20 18:50:58 +02:00
Index: config/mconf.c
===================================================================
--- config.orig/mconf.c
+++ config/mconf.c
@@ -25,10 +25,9 @@
2007-06-28 12:46:19 +02:00
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"
2008-06-19 10:11:51 +02:00
+"Some features may be built directly into Buildroot. Some features\n"
2007-06-28 12:46:19 +02:00
"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"
2008-06-19 10:11:51 +02:00
"Menu items beginning with following braces represent features that\n"
2009-07-20 18:50:58 +02:00
@@ -115,7 +114,7 @@
2007-06-28 12:46:19 +02:00
"-----------------------------\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"
2009-07-20 18:50:58 +02:00
@@ -148,7 +147,7 @@
2007-06-28 12:46:19 +02:00
"\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"
2009-07-20 18:50:58 +02:00
@@ -178,9 +177,9 @@
2007-06-28 12:46:19 +02:00
"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 "
2009-07-20 18:50:58 +02:00
@@ -200,18 +199,18 @@
2007-06-28 12:46:19 +02:00
"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"
2009-07-20 18:50:58 +02:00
@@ -221,7 +220,7 @@
2007-06-28 12:46:19 +02:00
"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"
2009-07-20 18:50:58 +02:00
@@ -364,10 +363,10 @@
2007-09-23 16:06:59 +02:00
int size;
struct symbol *sym;
2007-06-28 12:46:19 +02:00
- sym = sym_lookup("KERNELVERSION", 0);
2007-09-25 13:37:31 +02:00
+ sym = sym_lookup("BR2_VERSION", 0);
2007-06-28 12:46:19 +02:00
sym_calc_value(sym);
2007-09-23 16:06:59 +02:00
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';
2009-07-20 18:50:58 +02:00
@@ -902,7 +901,7 @@
2007-06-28 12:46:19 +02:00
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
2009-07-20 18:50:58 +02:00
@@ -914,23 +913,23 @@
2007-06-28 12:46:19 +02:00
case 0:
2007-09-23 16:06:59 +02:00
if (conf_write(filename)) {
2007-06-28 12:46:19 +02:00
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();
}
2009-07-20 23:47:42 +02:00
Index: config/qconf.cc
===================================================================
--- config.orig/qconf.cc
+++ config/qconf.cc
@@ -1277,8 +1277,7 @@
char title[256];
QDesktopWidget *d = configApp->desktop();
- snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration"),
- getenv("KERNELVERSION"));
+ snprintf(title, sizeof(title), _("Buildroot Configuration"));
setCaption(title);
width = configSettings->readNumEntry("/window width", d->width() - 64);
2009-07-21 18:21:32 +02:00
@@ -1612,6 +1611,7 @@
{
if (!conf_get_changed()) {
e->accept();
+ conf_write_autoconf();
return;
}
QMessageBox mb("qconf", _("Save configuration?"), QMessageBox::Warning,
@@ -1622,6 +1622,7 @@
switch (mb.exec()) {
case QMessageBox::Yes:
conf_write(NULL);
+ conf_write_autoconf();
case QMessageBox::No:
e->accept();
break;
2009-07-20 18:50:58 +02:00
Index: config/util.c
===================================================================
--- config.orig/util.c
+++ config/util.c
@@ -26,6 +26,109 @@
2007-09-23 22:28:53 +02:00
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) {
2007-09-23 22:46:44 +02:00
+ fprintf(out, "%s: $(BASE_TARGETS)", br2_symbol_printer(sym->name));
2007-09-23 22:28:53 +02:00
+ 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)
{
2009-07-20 18:50:58 +02:00
@@ -68,7 +171,7 @@
fprintf(out, "\n$(deps_config): ;\n");
2007-09-23 22:28:53 +02:00
fclose(out);
rename("..config.tmp", name);
- return 0;
+ return write_make_deps(NULL);
}
2009-07-20 18:50:58 +02:00
Index: config/zconf.tab.c_shipped
===================================================================
--- config.orig/zconf.tab.c_shipped
+++ config/zconf.tab.c_shipped
@@ -2259,7 +2259,7 @@
2008-06-19 10:11:51 +02:00
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"))
2009-07-20 18:50:58 +02:00
Index: config/zconf.y
===================================================================
--- config.orig/zconf.y
+++ config/zconf.y
@@ -476,7 +476,7 @@
2008-06-19 10:11:51 +02:00
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"))