aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/Makefile5
-rw-r--r--scripts/kconfig/conf.c1
-rw-r--r--scripts/kconfig/lex.zconf.c_shipped2
-rw-r--r--scripts/kconfig/lkc.h1
-rw-r--r--scripts/kconfig/lxdialog/dialog.h1
-rw-r--r--scripts/kconfig/lxdialog/util.c9
-rw-r--r--scripts/kconfig/mconf.c43
-rw-r--r--scripts/kconfig/menu.c2
-rw-r--r--scripts/kconfig/qconf.cc5
-rw-r--r--scripts/kconfig/qconf.h2
-rw-r--r--scripts/kconfig/symbol.c13
-rw-r--r--scripts/kconfig/zconf.l2
-rw-r--r--scripts/kconfig/zconf.tab.c_shipped6
-rw-r--r--scripts/kconfig/zconf.y6
14 files changed, 65 insertions, 33 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 7e7e147875bf..fb2bb3099dd9 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -140,6 +140,7 @@ endif
140 140
141clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \ 141clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \
142 .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c 142 .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c
143clean-files += mconf qconf gconf
143 144
144# Needed for systems without gettext 145# Needed for systems without gettext
145KBUILD_HAVE_NLS := $(shell \ 146KBUILD_HAVE_NLS := $(shell \
@@ -183,8 +184,8 @@ $(obj)/.tmp_qtcheck:
183 done; \ 184 done; \
184 if [ -z "$$dir" ]; then \ 185 if [ -z "$$dir" ]; then \
185 echo "*"; \ 186 echo "*"; \
186 echo "* Unable to find the QT installation. Please make sure that"; \ 187 echo "* Unable to find the QT3 installation. Please make sure that"; \
187 echo "* the QT development package is correctly installed and"; \ 188 echo "* the QT3 development package is correctly installed and"; \
188 echo "* either install pkg-config or set the QTDIR environment"; \ 189 echo "* either install pkg-config or set the QTDIR environment"; \
189 echo "* variable to the correct location."; \ 190 echo "* variable to the correct location."; \
190 echo "*"; \ 191 echo "*"; \
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 124b341a18c0..1199baf866ca 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -558,6 +558,7 @@ int main(int ac, char **av)
558 if (stat(".config", &tmpstat)) { 558 if (stat(".config", &tmpstat)) {
559 printf(_("***\n" 559 printf(_("***\n"
560 "*** You have not yet configured your kernel!\n" 560 "*** You have not yet configured your kernel!\n"
561 "*** (missing kernel .config file)\n"
561 "***\n" 562 "***\n"
562 "*** Please run some configurator (e.g. \"make oldconfig\" or\n" 563 "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
563 "*** \"make menuconfig\" or \"make xconfig\").\n" 564 "*** \"make menuconfig\" or \"make xconfig\").\n"
diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/lex.zconf.c_shipped
index 800f8c71c407..0fdc9049296f 100644
--- a/scripts/kconfig/lex.zconf.c_shipped
+++ b/scripts/kconfig/lex.zconf.c_shipped
@@ -2264,7 +2264,7 @@ FILE *zconf_fopen(const char *name)
2264 FILE *f; 2264 FILE *f;
2265 2265
2266 f = fopen(name, "r"); 2266 f = fopen(name, "r");
2267 if (!f && name[0] != '/') { 2267 if (!f && name != NULL && name[0] != '/') {
2268 env = getenv(SRCTREE); 2268 env = getenv(SRCTREE);
2269 if (env) { 2269 if (env) {
2270 sprintf(fullname, "%s/%s", env, name); 2270 sprintf(fullname, "%s/%s", env, name);
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 9b2706a41548..8a07ee4f6bd4 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -64,6 +64,7 @@ int zconf_lineno(void);
64char *zconf_curname(void); 64char *zconf_curname(void);
65 65
66/* confdata.c */ 66/* confdata.c */
67const char *conf_get_configname(void);
67char *conf_get_default_confname(void); 68char *conf_get_default_confname(void);
68void sym_set_change_count(int count); 69void sym_set_change_count(int count);
69void sym_add_change_count(int count); 70void sym_add_change_count(int count);
diff --git a/scripts/kconfig/lxdialog/dialog.h b/scripts/kconfig/lxdialog/dialog.h
index fd695e1070f7..7e17eba75ae8 100644
--- a/scripts/kconfig/lxdialog/dialog.h
+++ b/scripts/kconfig/lxdialog/dialog.h
@@ -188,6 +188,7 @@ int on_key_esc(WINDOW *win);
188int on_key_resize(void); 188int on_key_resize(void);
189 189
190void init_dialog(const char *backtitle); 190void init_dialog(const char *backtitle);
191void set_dialog_backtitle(const char *backtitle);
191void reset_dialog(void); 192void reset_dialog(void);
192void end_dialog(void); 193void end_dialog(void);
193void attr_clear(WINDOW * win, int height, int width, chtype attr); 194void attr_clear(WINDOW * win, int height, int width, chtype attr);
diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c
index d54440fc166c..a1bddefe73d0 100644
--- a/scripts/kconfig/lxdialog/util.c
+++ b/scripts/kconfig/lxdialog/util.c
@@ -272,6 +272,11 @@ void init_dialog(const char *backtitle)
272 color_setup(getenv("MENUCONFIG_COLOR")); 272 color_setup(getenv("MENUCONFIG_COLOR"));
273} 273}
274 274
275void set_dialog_backtitle(const char *backtitle)
276{
277 dlg.backtitle = backtitle;
278}
279
275void reset_dialog(void) 280void reset_dialog(void)
276{ 281{
277 initscr(); /* Init curses */ 282 initscr(); /* Init curses */
@@ -336,7 +341,7 @@ void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x)
336 newl = 1; 341 newl = 1;
337 word = tempstr; 342 word = tempstr;
338 while (word && *word) { 343 while (word && *word) {
339 sp = index(word, ' '); 344 sp = strchr(word, ' ');
340 if (sp) 345 if (sp)
341 *sp++ = 0; 346 *sp++ = 0;
342 347
@@ -348,7 +353,7 @@ void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x)
348 if (wlen > room || 353 if (wlen > room ||
349 (newl && wlen < 4 && sp 354 (newl && wlen < 4 && sp
350 && wlen + 1 + strlen(sp) > room 355 && wlen + 1 + strlen(sp) > room
351 && (!(sp2 = index(sp, ' ')) 356 && (!(sp2 = strchr(sp, ' '))
352 || wlen + 1 + (sp2 - sp) > room))) { 357 || wlen + 1 + (sp2 - sp) > room))) {
353 cur_y++; 358 cur_y++;
354 cur_x = x; 359 cur_x = x;
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 3f9a1321b3e6..d0e4fa594fc7 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -26,7 +26,6 @@
26#include "lkc.h" 26#include "lkc.h"
27#include "lxdialog/dialog.h" 27#include "lxdialog/dialog.h"
28 28
29static char menu_backtitle[128];
30static const char mconf_readme[] = N_( 29static const char mconf_readme[] = N_(
31"Overview\n" 30"Overview\n"
32"--------\n" 31"--------\n"
@@ -271,7 +270,6 @@ search_help[] = N_(
271 " USB$ => find all CONFIG_ symbols ending with USB\n" 270 " USB$ => find all CONFIG_ symbols ending with USB\n"
272 "\n"); 271 "\n");
273 272
274static char filename[PATH_MAX+1] = ".config";
275static int indent; 273static int indent;
276static struct termios ios_org; 274static struct termios ios_org;
277static int rows = 0, cols = 0; 275static int rows = 0, cols = 0;
@@ -395,6 +393,28 @@ static struct gstr get_relations_str(struct symbol **sym_arr)
395 return res; 393 return res;
396} 394}
397 395
396static char filename[PATH_MAX+1];
397static void set_config_filename(const char *config_filename)
398{
399 static char menu_backtitle[PATH_MAX+128];
400 int size;
401 struct symbol *sym;
402
403 sym = sym_lookup("KERNELVERSION", 0);
404 sym_calc_value(sym);
405 size = snprintf(menu_backtitle, sizeof(menu_backtitle),
406 _("%s - Linux Kernel v%s Configuration"),
407 config_filename, sym_get_string_value(sym));
408 if (size >= sizeof(menu_backtitle))
409 menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
410 set_dialog_backtitle(menu_backtitle);
411
412 size = snprintf(filename, sizeof(filename), "%s", config_filename);
413 if (size >= sizeof(filename))
414 filename[sizeof(filename)-1] = '\0';
415}
416
417
398static void search_conf(void) 418static void search_conf(void)
399{ 419{
400 struct symbol **sym_arr; 420 struct symbol **sym_arr;
@@ -816,8 +836,10 @@ static void conf_load(void)
816 case 0: 836 case 0:
817 if (!dialog_input_result[0]) 837 if (!dialog_input_result[0])
818 return; 838 return;
819 if (!conf_read(dialog_input_result)) 839 if (!conf_read(dialog_input_result)) {
840 set_config_filename(dialog_input_result);
820 return; 841 return;
842 }
821 show_textbox(NULL, _("File does not exist!"), 5, 38); 843 show_textbox(NULL, _("File does not exist!"), 5, 38);
822 break; 844 break;
823 case 1: 845 case 1:
@@ -840,8 +862,10 @@ static void conf_save(void)
840 case 0: 862 case 0:
841 if (!dialog_input_result[0]) 863 if (!dialog_input_result[0])
842 return; 864 return;
843 if (!conf_write(dialog_input_result)) 865 if (!conf_write(dialog_input_result)) {
866 set_config_filename(dialog_input_result);
844 return; 867 return;
868 }
845 show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60); 869 show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60);
846 break; 870 break;
847 case 1: 871 case 1:
@@ -860,7 +884,6 @@ static void conf_cleanup(void)
860 884
861int main(int ac, char **av) 885int main(int ac, char **av)
862{ 886{
863 struct symbol *sym;
864 char *mode; 887 char *mode;
865 int res; 888 int res;
866 889
@@ -871,11 +894,6 @@ int main(int ac, char **av)
871 conf_parse(av[1]); 894 conf_parse(av[1]);
872 conf_read(NULL); 895 conf_read(NULL);
873 896
874 sym = sym_lookup("KERNELVERSION", 0);
875 sym_calc_value(sym);
876 sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"),
877 sym_get_string_value(sym));
878
879 mode = getenv("MENUCONFIG_MODE"); 897 mode = getenv("MENUCONFIG_MODE");
880 if (mode) { 898 if (mode) {
881 if (!strcasecmp(mode, "single_menu")) 899 if (!strcasecmp(mode, "single_menu"))
@@ -886,7 +904,8 @@ int main(int ac, char **av)
886 atexit(conf_cleanup); 904 atexit(conf_cleanup);
887 init_wsize(); 905 init_wsize();
888 reset_dialog(); 906 reset_dialog();
889 init_dialog(menu_backtitle); 907 init_dialog(NULL);
908 set_config_filename(conf_get_configname());
890 do { 909 do {
891 conf(&rootmenu); 910 conf(&rootmenu);
892 dialog_clear(); 911 dialog_clear();
@@ -903,7 +922,7 @@ int main(int ac, char **av)
903 922
904 switch (res) { 923 switch (res) {
905 case 0: 924 case 0:
906 if (conf_write(NULL)) { 925 if (conf_write(filename)) {
907 fprintf(stderr, _("\n\n" 926 fprintf(stderr, _("\n\n"
908 "Error during writing of the kernel configuration.\n" 927 "Error during writing of the kernel configuration.\n"
909 "Your kernel configuration changes were NOT saved." 928 "Your kernel configuration changes were NOT saved."
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index c86c27f2c761..f14aeac67d4f 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -203,7 +203,7 @@ void sym_check_prop(struct symbol *sym)
203 else if (sym2->type == S_UNKNOWN) 203 else if (sym2->type == S_UNKNOWN)
204 prop_warn(prop, 204 prop_warn(prop,
205 "'select' used by config symbol '%s' " 205 "'select' used by config symbol '%s' "
206 "refer to undefined symbol '%s'", 206 "refers to undefined symbol '%s'",
207 sym->name, sym2->name); 207 sym->name, sym2->name);
208 else if (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE) 208 else if (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE)
209 prop_warn(prop, 209 prop_warn(prop,
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 512c2f5c341d..f2a23a9c3938 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1182,7 +1182,7 @@ void ConfigInfoView::contentsContextMenuEvent(QContextMenuEvent *e)
1182 Parent::contentsContextMenuEvent(e); 1182 Parent::contentsContextMenuEvent(e);
1183} 1183}
1184 1184
1185ConfigSearchWindow::ConfigSearchWindow(QWidget* parent, const char *name) 1185ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *name)
1186 : Parent(parent, name), result(NULL) 1186 : Parent(parent, name), result(NULL)
1187{ 1187{
1188 setCaption("Search Config"); 1188 setCaption("Search Config");
@@ -1206,6 +1206,9 @@ ConfigSearchWindow::ConfigSearchWindow(QWidget* parent, const char *name)
1206 info = new ConfigInfoView(split, name); 1206 info = new ConfigInfoView(split, name);
1207 connect(list->list, SIGNAL(menuChanged(struct menu *)), 1207 connect(list->list, SIGNAL(menuChanged(struct menu *)),
1208 info, SLOT(setInfo(struct menu *))); 1208 info, SLOT(setInfo(struct menu *)));
1209 connect(list->list, SIGNAL(menuChanged(struct menu *)),
1210 parent, SLOT(setMenuLink(struct menu *)));
1211
1209 layout1->addWidget(split); 1212 layout1->addWidget(split);
1210 1213
1211 if (name) { 1214 if (name) {
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index 6fc1c5f14425..b3b5657b6b35 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -279,7 +279,7 @@ class ConfigSearchWindow : public QDialog {
279 Q_OBJECT 279 Q_OBJECT
280 typedef class QDialog Parent; 280 typedef class QDialog Parent;
281public: 281public:
282 ConfigSearchWindow(QWidget* parent, const char *name = 0); 282 ConfigSearchWindow(ConfigMainWindow* parent, const char *name = 0);
283 283
284public slots: 284public slots:
285 void saveSettings(void); 285 void saveSettings(void);
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 8f06c474d800..c35dcc5d6189 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -786,13 +786,15 @@ static struct symbol *sym_check_expr_deps(struct expr *e)
786 return NULL; 786 return NULL;
787} 787}
788 788
789/* return NULL when dependencies are OK */
789struct symbol *sym_check_deps(struct symbol *sym) 790struct symbol *sym_check_deps(struct symbol *sym)
790{ 791{
791 struct symbol *sym2; 792 struct symbol *sym2;
792 struct property *prop; 793 struct property *prop;
793 794
794 if (sym->flags & SYMBOL_CHECK) { 795 if (sym->flags & SYMBOL_CHECK) {
795 printf("Warning! Found recursive dependency: %s", sym->name); 796 fprintf(stderr, "%s:%d:error: found recursive dependency: %s",
797 sym->prop->file->name, sym->prop->lineno, sym->name);
796 return sym; 798 return sym;
797 } 799 }
798 if (sym->flags & SYMBOL_CHECKED) 800 if (sym->flags & SYMBOL_CHECKED)
@@ -816,13 +818,8 @@ struct symbol *sym_check_deps(struct symbol *sym)
816 goto out; 818 goto out;
817 } 819 }
818out: 820out:
819 if (sym2) { 821 if (sym2)
820 printf(" %s", sym->name); 822 fprintf(stderr, " -> %s%s", sym->name, sym2 == sym? "\n": "");
821 if (sym2 == sym) {
822 printf("\n");
823 sym2 = NULL;
824 }
825 }
826 sym->flags &= ~SYMBOL_CHECK; 823 sym->flags &= ~SYMBOL_CHECK;
827 return sym2; 824 return sym2;
828} 825}
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index cfa46077c6b4..187d38ccadd5 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -265,7 +265,7 @@ FILE *zconf_fopen(const char *name)
265 FILE *f; 265 FILE *f;
266 266
267 f = fopen(name, "r"); 267 f = fopen(name, "r");
268 if (!f && name[0] != '/') { 268 if (!f && name != NULL && name[0] != '/') {
269 env = getenv(SRCTREE); 269 env = getenv(SRCTREE);
270 if (env) { 270 if (env) {
271 sprintf(fullname, "%s/%s", env, name); 271 sprintf(fullname, "%s/%s", env, name);
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped
index d777fe85627f..9a06b6771eee 100644
--- a/scripts/kconfig/zconf.tab.c_shipped
+++ b/scripts/kconfig/zconf.tab.c_shipped
@@ -2132,9 +2132,11 @@ void conf_parse(const char *name)
2132 } 2132 }
2133 menu_finalize(&rootmenu); 2133 menu_finalize(&rootmenu);
2134 for_all_symbols(i, sym) { 2134 for_all_symbols(i, sym) {
2135 sym_check_deps(sym); 2135 if (sym_check_deps(sym))
2136 zconfnerrs++;
2136 } 2137 }
2137 2138 if (zconfnerrs)
2139 exit(1);
2138 sym_set_change_count(1); 2140 sym_set_change_count(1);
2139} 2141}
2140 2142
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 04a5864c03b1..92eb02bdf9c5 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -501,9 +501,11 @@ void conf_parse(const char *name)
501 } 501 }
502 menu_finalize(&rootmenu); 502 menu_finalize(&rootmenu);
503 for_all_symbols(i, sym) { 503 for_all_symbols(i, sym) {
504 sym_check_deps(sym); 504 if (sym_check_deps(sym))
505 zconfnerrs++;
505 } 506 }
506 507 if (zconfnerrs)
508 exit(1);
507 sym_set_change_count(1); 509 sym_set_change_count(1);
508} 510}
509 511