From f88d205501e35195444bdd41983e26546af3f56a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 17 Mar 2007 02:37:07 -0400 Subject: menuconfig: dont use obsolete index() function in lxdialog The index() function is obsolete, use strchr() instead. Signed-off-by: Mike Frysinger Signed-off-by: Sam Ravnborg --- scripts/kconfig/lxdialog/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c index d54440fc166..a1a1354ba23 100644 --- a/scripts/kconfig/lxdialog/util.c +++ b/scripts/kconfig/lxdialog/util.c @@ -336,7 +336,7 @@ void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x) newl = 1; word = tempstr; while (word && *word) { - sp = index(word, ' '); + sp = strchr(word, ' '); if (sp) *sp++ = 0; @@ -348,7 +348,7 @@ void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x) if (wlen > room || (newl && wlen < 4 && sp && wlen + 1 + strlen(sp) > room - && (!(sp2 = index(sp, ' ')) + && (!(sp2 = strchr(sp, ' ')) || wlen + 1 + (sp2 - sp) > room))) { cur_y++; cur_x = x; -- cgit v1.2.3 From 63431e75691c410819023ab0e6cd047cbfcf64e2 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Thu, 5 Oct 2006 19:12:59 +0200 Subject: kconfig/xconfig: sync main view with search dialog current menu When changing current menu in search dialog update also main view Signed-off-by: Marco Costalba Signed-off-by: Sam Ravnborg --- scripts/kconfig/qconf.cc | 5 ++++- scripts/kconfig/qconf.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 512c2f5c341..f2a23a9c393 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1182,7 +1182,7 @@ void ConfigInfoView::contentsContextMenuEvent(QContextMenuEvent *e) Parent::contentsContextMenuEvent(e); } -ConfigSearchWindow::ConfigSearchWindow(QWidget* parent, const char *name) +ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *name) : Parent(parent, name), result(NULL) { setCaption("Search Config"); @@ -1206,6 +1206,9 @@ ConfigSearchWindow::ConfigSearchWindow(QWidget* parent, const char *name) info = new ConfigInfoView(split, name); connect(list->list, SIGNAL(menuChanged(struct menu *)), info, SLOT(setInfo(struct menu *))); + connect(list->list, SIGNAL(menuChanged(struct menu *)), + parent, SLOT(setMenuLink(struct menu *))); + layout1->addWidget(split); if (name) { diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index 6fc1c5f1442..b3b5657b6b3 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h @@ -279,7 +279,7 @@ class ConfigSearchWindow : public QDialog { Q_OBJECT typedef class QDialog Parent; public: - ConfigSearchWindow(QWidget* parent, const char *name = 0); + ConfigSearchWindow(ConfigMainWindow* parent, const char *name = 0); public slots: void saveSettings(void); -- cgit v1.2.3 From 95e30f9593ebf39e26227a20ae8d9f160c50fb67 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 18 Mar 2007 10:48:46 +0100 Subject: menuconfig: remember alternate config filename When loading an alternate configuration use that file as current configuration filename. Make the filename visible in the dialog. Default continue to be .config. Inspired by patch from: Cyrill Gorcunov Signed-off-by: Sam Ravnborg Cc: Cyrill Gorcunov --- scripts/kconfig/lxdialog/dialog.h | 1 + scripts/kconfig/lxdialog/util.c | 5 +++++ scripts/kconfig/mconf.c | 43 ++++++++++++++++++++++++++++----------- 3 files changed, 37 insertions(+), 12 deletions(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/lxdialog/dialog.h b/scripts/kconfig/lxdialog/dialog.h index fd695e1070f..7e17eba75ae 100644 --- a/scripts/kconfig/lxdialog/dialog.h +++ b/scripts/kconfig/lxdialog/dialog.h @@ -188,6 +188,7 @@ int on_key_esc(WINDOW *win); int on_key_resize(void); void init_dialog(const char *backtitle); +void set_dialog_backtitle(const char *backtitle); void reset_dialog(void); void end_dialog(void); void 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 a1a1354ba23..a1bddefe73d 100644 --- a/scripts/kconfig/lxdialog/util.c +++ b/scripts/kconfig/lxdialog/util.c @@ -272,6 +272,11 @@ void init_dialog(const char *backtitle) color_setup(getenv("MENUCONFIG_COLOR")); } +void set_dialog_backtitle(const char *backtitle) +{ + dlg.backtitle = backtitle; +} + void reset_dialog(void) { initscr(); /* Init curses */ diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 3f9a1321b3e..462256d72ba 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -26,7 +26,6 @@ #include "lkc.h" #include "lxdialog/dialog.h" -static char menu_backtitle[128]; static const char mconf_readme[] = N_( "Overview\n" "--------\n" @@ -271,7 +270,6 @@ search_help[] = N_( " USB$ => find all CONFIG_ symbols ending with USB\n" "\n"); -static char filename[PATH_MAX+1] = ".config"; static int indent; static struct termios ios_org; static int rows = 0, cols = 0; @@ -395,6 +393,28 @@ static struct gstr get_relations_str(struct symbol **sym_arr) return res; } +static char filename[PATH_MAX+1]; +static void set_config_filename(const char *config_filename) +{ + static char menu_backtitle[PATH_MAX+128]; + int size; + struct symbol *sym; + + sym = sym_lookup("KERNELVERSION", 0); + sym_calc_value(sym); + size = snprintf(menu_backtitle, sizeof(menu_backtitle), + _("%s - Linux Kernel v%s Configuration"), + config_filename, sym_get_string_value(sym)); + if (size >= sizeof(menu_backtitle)) + menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; + set_dialog_backtitle(menu_backtitle); + + size = snprintf(filename, sizeof(filename), "%s", config_filename); + if (size >= sizeof(filename)) + filename[sizeof(filename)-1] = '\0'; +} + + static void search_conf(void) { struct symbol **sym_arr; @@ -816,8 +836,10 @@ static void conf_load(void) case 0: if (!dialog_input_result[0]) return; - if (!conf_read(dialog_input_result)) + if (!conf_read(dialog_input_result)) { + set_config_filename(dialog_input_result); return; + } show_textbox(NULL, _("File does not exist!"), 5, 38); break; case 1: @@ -840,8 +862,10 @@ static void conf_save(void) case 0: if (!dialog_input_result[0]) return; - if (!conf_write(dialog_input_result)) + if (!conf_write(dialog_input_result)) { + set_config_filename(dialog_input_result); return; + } show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60); break; case 1: @@ -860,7 +884,6 @@ static void conf_cleanup(void) int main(int ac, char **av) { - struct symbol *sym; char *mode; int res; @@ -871,11 +894,6 @@ int main(int ac, char **av) conf_parse(av[1]); conf_read(NULL); - sym = sym_lookup("KERNELVERSION", 0); - sym_calc_value(sym); - sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"), - sym_get_string_value(sym)); - mode = getenv("MENUCONFIG_MODE"); if (mode) { if (!strcasecmp(mode, "single_menu")) @@ -886,7 +904,8 @@ int main(int ac, char **av) atexit(conf_cleanup); init_wsize(); reset_dialog(); - init_dialog(menu_backtitle); + init_dialog(NULL); + set_config_filename(".config"); do { conf(&rootmenu); dialog_clear(); @@ -903,7 +922,7 @@ int main(int ac, char **av) switch (res) { case 0: - if (conf_write(NULL)) { + if (conf_write(filename)) { fprintf(stderr, _("\n\n" "Error during writing of the kernel configuration.\n" "Your kernel configuration changes were NOT saved." -- cgit v1.2.3 From d802b50f0d63d2d18d8dae15d7e3285e99e7e7b6 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 1 Apr 2007 22:29:38 +0200 Subject: kconfig/menuconfig: do not hardcode '.config' Export and use the function conf_get_configname() to retreive the default configuration filename. Suggested by: Roman Zippel Signed-off-by: Sam Ravnborg --- scripts/kconfig/lkc.h | 1 + scripts/kconfig/mconf.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 9b2706a4154..8a07ee4f6bd 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -64,6 +64,7 @@ int zconf_lineno(void); char *zconf_curname(void); /* confdata.c */ +const char *conf_get_configname(void); char *conf_get_default_confname(void); void sym_set_change_count(int count); void sym_add_change_count(int count); diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 462256d72ba..d0e4fa594fc 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -905,7 +905,7 @@ int main(int ac, char **av) init_wsize(); reset_dialog(); init_dialog(NULL); - set_config_filename(".config"); + set_config_filename(conf_get_configname()); do { conf(&rootmenu); dialog_clear(); -- cgit v1.2.3 From 145c90475f809060c8601828f14543191e06a0bb Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 1 Apr 2007 23:14:11 +0200 Subject: kbuild: remove kconfig binaries during make mrproper Nigel Cunningham noticed that 'make mrproper' did not remove mconf. Fixed so we now remove all relevant binaries. Signed-off-by: Sam Ravnborg Cc: Nigel Cunningham --- scripts/kconfig/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 7e7e147875b..2e421bd5675 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -140,6 +140,7 @@ endif clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \ .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c +clean-files += mconf qconf gconf # Needed for systems without gettext KBUILD_HAVE_NLS := $(shell \ -- cgit v1.2.3 From 9ae57004ca9c38ff8292c38a475c98b0ebbc0d74 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 29 Apr 2007 21:01:52 +0200 Subject: kconfig: refer to qt3 if we cannot find qt libraries We do not support qt4 (yet) so the simple fix was to warn that qt3 are missing. The better fix would have been to implment qt4 support but that has failed so far. This solves http://bugzilla.kernel.org/show_bug.cgi?id=8277 Signed-off-by: Sam Ravnborg --- scripts/kconfig/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 2e421bd5675..fb2bb3099dd 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -184,8 +184,8 @@ $(obj)/.tmp_qtcheck: done; \ if [ -z "$$dir" ]; then \ echo "*"; \ - echo "* Unable to find the QT installation. Please make sure that"; \ - echo "* the QT development package is correctly installed and"; \ + echo "* Unable to find the QT3 installation. Please make sure that"; \ + echo "* the QT3 development package is correctly installed and"; \ echo "* either install pkg-config or set the QTDIR environment"; \ echo "* variable to the correct location."; \ echo "*"; \ -- cgit v1.2.3 From 7ac1c145250adaccf4dbde77a8f811e937aa43c8 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Wed, 4 Apr 2007 21:58:41 -0700 Subject: kbuild: be more explicit on missing .config file Somewhat in reponse to kernel bugzilla #8197, be more explicit about why 'make all' fails when there is no .config file. Signed-off-by: Randy Dunlap Signed-off-by: Sam Ravnborg --- scripts/kconfig/conf.c | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 124b341a18c..1199baf866c 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -558,6 +558,7 @@ int main(int ac, char **av) if (stat(".config", &tmpstat)) { printf(_("***\n" "*** You have not yet configured your kernel!\n" + "*** (missing kernel .config file)\n" "***\n" "*** Please run some configurator (e.g. \"make oldconfig\" or\n" "*** \"make menuconfig\" or \"make xconfig\").\n" -- cgit v1.2.3 From 1e093ecd4a850ad61b93d84c221e342a67ea9d56 Mon Sep 17 00:00:00 2001 From: "Robert P. J. Day" Date: Mon, 30 Apr 2007 15:44:27 -0400 Subject: kconfig: correct minor typo in Kconfig warning message. Correct a minor spelling mistake in a Kconfig warning message. Signed-off-by: Robert P. J. Day Signed-off-by: Sam Ravnborg --- scripts/kconfig/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index c86c27f2c76..f14aeac67d4 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -203,7 +203,7 @@ void sym_check_prop(struct symbol *sym) else if (sym2->type == S_UNKNOWN) prop_warn(prop, "'select' used by config symbol '%s' " - "refer to undefined symbol '%s'", + "refers to undefined symbol '%s'", sym->name, sym2->name); else if (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE) prop_warn(prop, -- cgit v1.2.3 From 5447d34b080a1e3e312b05a91e87eff4710a1152 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 6 May 2007 09:20:10 +0200 Subject: kconfig: error out if recursive dependencies are found Sample: config FOO bool "This is foo" depends on BAR config BAR bool "This is bar" depends on FOO This will result in following error message: error: found recursive dependency: FOO -> BAR -> FOO And will then exit with exit code equal 1 so make will stop. Inspired by patch from: Adrian Bunk Signed-off-by: Sam Ravnborg Cc: Adrian Bunk Cc: Roman Zippel --- scripts/kconfig/symbol.c | 13 +++++-------- scripts/kconfig/zconf.tab.c_shipped | 6 ++++-- scripts/kconfig/zconf.y | 6 ++++-- 3 files changed, 13 insertions(+), 12 deletions(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 8f06c474d80..c35dcc5d618 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) return NULL; } +/* return NULL when dependencies are OK */ struct symbol *sym_check_deps(struct symbol *sym) { struct symbol *sym2; struct property *prop; if (sym->flags & SYMBOL_CHECK) { - printf("Warning! Found recursive dependency: %s", sym->name); + fprintf(stderr, "%s:%d:error: found recursive dependency: %s", + sym->prop->file->name, sym->prop->lineno, sym->name); return sym; } if (sym->flags & SYMBOL_CHECKED) @@ -816,13 +818,8 @@ struct symbol *sym_check_deps(struct symbol *sym) goto out; } out: - if (sym2) { - printf(" %s", sym->name); - if (sym2 == sym) { - printf("\n"); - sym2 = NULL; - } - } + if (sym2) + fprintf(stderr, " -> %s%s", sym->name, sym2 == sym? "\n": ""); sym->flags &= ~SYMBOL_CHECK; return sym2; } diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped index d777fe85627..9a06b6771ee 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) } menu_finalize(&rootmenu); for_all_symbols(i, sym) { - sym_check_deps(sym); + if (sym_check_deps(sym)) + zconfnerrs++; } - + if (zconfnerrs) + exit(1); sym_set_change_count(1); } diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 04a5864c03b..92eb02bdf9c 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -501,9 +501,11 @@ void conf_parse(const char *name) } menu_finalize(&rootmenu); for_all_symbols(i, sym) { - sym_check_deps(sym); + if (sym_check_deps(sym)) + zconfnerrs++; } - + if (zconfnerrs) + exit(1); sym_set_change_count(1); } -- cgit v1.2.3 From 11de39e2fbbc592018e0a231d0ee773653dcc8d6 Mon Sep 17 00:00:00 2001 From: Marcin Garski Date: Sat, 5 May 2007 22:49:00 +0200 Subject: kconfig: fix mconf segmentation fault I have found small bug in mconf, when you run it without any argument it will sigsegv. Without patch: $ scripts/kconfig/mconf Segmentation fault With patch: $ scripts/kconfig/mconf can't find file (null) Signed-off-by: Marcin Garski Signed-off-by: Sam Ravnborg --- scripts/kconfig/lex.zconf.c_shipped | 2 +- scripts/kconfig/zconf.l | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/lex.zconf.c_shipped index 800f8c71c40..0fdc9049296 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) FILE *f; f = fopen(name, "r"); - if (!f && name[0] != '/') { + if (!f && name != NULL && name[0] != '/') { env = getenv(SRCTREE); if (env) { sprintf(fullname, "%s/%s", env, name); diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index cfa46077c6b..187d38ccadd 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -265,7 +265,7 @@ FILE *zconf_fopen(const char *name) FILE *f; f = fopen(name, "r"); - if (!f && name[0] != '/') { + if (!f && name != NULL && name[0] != '/') { env = getenv(SRCTREE); if (env) { sprintf(fullname, "%s/%s", env, name); -- cgit v1.2.3