From d7c67a2e93334f7d290ba5fc2b2129b9d8ecd84f Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 11 Jun 2012 19:29:41 -0500 Subject: kconfig/nconf: fix compile with ncurses reentrant API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ESCDELAY is a global variable which is replaced by getter and setter functions with NCURSES_REENTRANT. This fixes the following error: nconf.c: In function ‘main’: nconf.c:1506:2: error: lvalue required as left operand of assignment Signed-off-by: Yaakov Selkowitz Signed-off-by: Michal Marek --- scripts/kconfig/nconf.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 8c0eb65978c9..d945de5c43ac 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -1503,7 +1503,11 @@ int main(int ac, char **av) } notimeout(stdscr, FALSE); +#if NCURSES_REENTRANT + set_escdelay(1); +#else ESCDELAY = 1; +#endif /* set btns menu */ curses_menu = new_menu(curses_menu_items); -- cgit v1.2.3 From 84354256bff5e95ed3dd8d42b4d7322044c979d7 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 12 Jun 2012 19:05:02 -0500 Subject: kconfig: check ncursesw headers first in check-lxdialog Commit 8c41e5e363db55d91aa3b1cdce4ab02ad9821de7 added a check for ncursesw/curses.h for the case where ncurses and ncursesw are build separately but only one is installed. But if both are installed, the headers ncurses/curses.h and ncursesw/curses.h differ, and since libncursesw will be found first, so should ncursesw/curses.h. Signed-off-by: Yaakov Selkowitz Signed-off-by: Michal Marek --- scripts/kconfig/lxdialog/check-lxdialog.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh index 82cc3a85e7f8..b75820bbdd3a 100644 --- a/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -19,12 +19,12 @@ ldflags() # Where is ncurses.h? ccflags() { - if [ -f /usr/include/ncurses/ncurses.h ]; then + if [ -f /usr/include/ncursesw/curses.h ]; then + echo '-I/usr/include/ncursesw -DCURSES_LOC=""' + elif [ -f /usr/include/ncurses/ncurses.h ]; then echo '-I/usr/include/ncurses -DCURSES_LOC=""' elif [ -f /usr/include/ncurses/curses.h ]; then echo '-I/usr/include/ncurses -DCURSES_LOC=""' - elif [ -f /usr/include/ncursesw/curses.h ]; then - echo '-I/usr/include/ncursesw -DCURSES_LOC=""' elif [ -f /usr/include/ncurses.h ]; then echo '-DCURSES_LOC=""' else -- cgit v1.2.3 From 3725f3ed1246301059eaa1c978ad7133fe567433 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 12 Jun 2012 19:05:15 -0500 Subject: kconfig: fix check-lxdialog for DLL platforms Import libraries on Cygwin and MinGW/MSYS use the .dll.a suffix, so checking this suffix is necessary to make sure ncurses will still be found when built without static libraries. Signed-off-by: Yaakov Selkowitz Signed-off-by: Michal Marek --- scripts/kconfig/lxdialog/check-lxdialog.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh index b75820bbdd3a..e3b12c010417 100644 --- a/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -4,7 +4,7 @@ # What library to link ldflags() { - for ext in so a dylib ; do + for ext in so a dll.a dylib ; do for lib in ncursesw ncurses curses ; do $cc -print-file-name=lib${lib}.${ext} | grep -q / if [ $? -eq 0 ]; then -- cgit v1.2.3 From 48485949b4d44a24c81caf9ab4dc32005f3aa67e Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 4 Jul 2012 15:23:29 -0500 Subject: xconfig: use pkgconfig to find moc Various schemes exist to allow parallel installations of multiple major versions of Qt (4.x with the previous 3.x and/or the upcoming 5.x). QtCore.pc includes a moc_location variable which should be a more reliable way to find moc. Signed-off-by: Yaakov Selkowitz Signed-off-by: Michal Marek --- scripts/kconfig/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 79662658fb91..5e2176cba4a6 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -260,8 +260,8 @@ $(obj)/.tmp_qtcheck: else \ cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \ libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \ - binpath="\$$(shell pkg-config QtCore --variable=prefix)"; \ - moc="$$binpath/bin/moc"; \ + moc="\$$(shell pkg-config QtCore --variable=moc_location)"; \ + [ -n "$$moc" ] || moc="\$$(shell pkg-config QtCore --variable=prefix)/bin/moc"; \ fi; \ echo "KC_QT_CFLAGS=$$cflags" > $@; \ echo "KC_QT_LIBS=$$libs" >> $@; \ -- cgit v1.2.3 From ebca026a793b2958d7e59df4730c1159a55e9fe2 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 4 Jul 2012 18:31:11 -0500 Subject: xconfig: add quiet rule for moc Also add a dependency on .tmp_qtcheck for KC_QT_MOC. Signed-off-by: Yaakov Selkowitz Signed-off-by: Michal Marek --- scripts/kconfig/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 5e2176cba4a6..cf1171f0f02b 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -298,8 +298,11 @@ $(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c $(obj)/qconf.o: $(obj)/qconf.moc -$(obj)/%.moc: $(src)/%.h - $(KC_QT_MOC) -i $< -o $@ +quiet_cmd_moc = MOC $@ + cmd_moc = $(KC_QT_MOC) -i $< -o $@ + +$(obj)/%.moc: $(src)/%.h $(obj)/.tmp_qtcheck + $(call cmd,moc) # Extract gconf menu items for I18N support $(obj)/gconf.glade.h: $(obj)/gconf.glade -- cgit v1.2.3 From 92b72e8bcbb0d21457b53887bf41db3527258253 Mon Sep 17 00:00:00 2001 From: Paul Bolle Date: Sun, 1 Jul 2012 15:44:54 +0200 Subject: kconfig: remove lkc_defs.h from .gitignore and dontdiff Commit 5a6f8d2bd9e3392569ed6f29ea4d7210652f929b ("kconfig: nuke LKC_DIRECT_LINK cruft") removed all traces of lkc_defs.h from the tree. Remove its entries in dontdiff and kconfig's .gitignore file too. Signed-off-by: Paul Bolle Signed-off-by: Michal Marek --- scripts/kconfig/.gitignore | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/kconfig/.gitignore b/scripts/kconfig/.gitignore index ee120d441565..be603c4fef62 100644 --- a/scripts/kconfig/.gitignore +++ b/scripts/kconfig/.gitignore @@ -7,7 +7,6 @@ config* *.tab.h zconf.hash.c *.moc -lkc_defs.h gconf.glade.h *.pot *.mo -- cgit v1.2.3 From 1a7a8c6fd8ca24d3692dacddf8d658c9bb9c14ad Mon Sep 17 00:00:00 2001 From: Cody Schafer Date: Fri, 13 Jul 2012 11:27:12 -0700 Subject: kconfig: allow long lines in config file For some config options (CONFIG_EXTRA_FIRMWARE, for example), the length of a config file line can exceed the 1024 byte buffer. Switch from fgets to compat_getline to fix. compat_getline is an internally implimented getline work-alike for portability purposes. Signed-off-by: Cody Schafer Signed-off-by: Michal Marek --- scripts/kconfig/confdata.c | 61 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 52577f052bc1..13ddf1126c2a 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -182,10 +182,66 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) return 0; } +#define LINE_GROWTH 16 +static int add_byte(int c, char **lineptr, size_t slen, size_t *n) +{ + char *nline; + size_t new_size = slen + 1; + if (new_size > *n) { + new_size += LINE_GROWTH - 1; + new_size *= 2; + nline = realloc(*lineptr, new_size); + if (!nline) + return -1; + + *lineptr = nline; + *n = new_size; + } + + (*lineptr)[slen] = c; + + return 0; +} + +static ssize_t compat_getline(char **lineptr, size_t *n, FILE *stream) +{ + char *line = *lineptr; + size_t slen = 0; + + for (;;) { + int c = getc(stream); + + switch (c) { + case '\n': + if (add_byte(c, &line, slen, n) < 0) + goto e_out; + slen++; + /* fall through */ + case EOF: + if (add_byte('\0', &line, slen, n) < 0) + goto e_out; + *lineptr = line; + if (slen == 0) + return -1; + return slen; + default: + if (add_byte(c, &line, slen, n) < 0) + goto e_out; + slen++; + } + } + +e_out: + line[slen-1] = '\0'; + *lineptr = line; + return -1; +} + int conf_read_simple(const char *name, int def) { FILE *in = NULL; - char line[1024]; + char *line = NULL; + size_t line_asize = 0; char *p, *p2; struct symbol *sym; int i, def_flags; @@ -247,7 +303,7 @@ load: } } - while (fgets(line, sizeof(line), in)) { + while (compat_getline(&line, &line_asize, in) != -1) { conf_lineno++; sym = NULL; if (line[0] == '#') { @@ -335,6 +391,7 @@ setsym: cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri); } } + free(line); fclose(in); if (modules_sym) -- cgit v1.2.3 From 5b580fa671a6a8dd775bb6e54e4858678296c38a Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Sat, 7 Jul 2012 23:32:18 +0200 Subject: kconfig: Print errors to stderr in the Makefile Signed-off-by: Michal Marek --- scripts/kconfig/Makefile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index cf1171f0f02b..8dacae8bf4b9 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -234,12 +234,12 @@ $(obj)/.tmp_qtcheck: if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ done; \ if [ -z "$$dir" ]; then \ - echo "*"; \ - echo "* Unable to find any QT installation. Please make sure that"; \ - echo "* the QT4 or QT3 development package is correctly installed and"; \ - echo "* either qmake can be found or install pkg-config or set"; \ - echo "* the QTDIR environment variable to the correct location."; \ - echo "*"; \ + echo >&2 "*"; \ + echo >&2 "* Unable to find any QT installation. Please make sure that"; \ + echo >&2 "* the QT4 or QT3 development package is correctly installed and"; \ + echo >&2 "* either qmake can be found or install pkg-config or set"; \ + echo >&2 "* the QTDIR environment variable to the correct location."; \ + echo >&2 "*"; \ false; \ fi; \ libpath=$$dir/lib; lib=qt; osdir=""; \ @@ -279,17 +279,17 @@ $(obj)/.tmp_gtkcheck: if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \ touch $@; \ else \ - echo "*"; \ - echo "* GTK+ is present but version >= 2.0.0 is required."; \ - echo "*"; \ + echo >&2 "*"; \ + echo >&2 "* GTK+ is present but version >= 2.0.0 is required."; \ + echo >&2 "*"; \ false; \ fi \ else \ - echo "*"; \ - echo "* Unable to find the GTK+ installation. Please make sure that"; \ - echo "* the GTK+ 2.0 development package is correctly installed..."; \ - echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \ - echo "*"; \ + echo >&2 "*"; \ + echo >&2 "* Unable to find the GTK+ installation. Please make sure that"; \ + echo >&2 "* the GTK+ 2.0 development package is correctly installed..."; \ + echo >&2 "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \ + echo >&2 "*"; \ false; \ fi endif -- cgit v1.2.3 From 1925a276afa78c305dacb7f2da11825bffecad44 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sun, 15 Jul 2012 22:37:35 +0200 Subject: scripts/config: fix double-quotes un-escaping When reporting a string value, only the first double-quote was un-escaped. We need to un-escape all escaped double-quotes. Signed-off-by: "Yann E. MORIN" Signed-off-by: Michal Marek --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/config b/scripts/config index ed6653ef9702..9e984bc96e18 100755 --- a/scripts/config +++ b/scripts/config @@ -128,7 +128,7 @@ while [ "$1" != "" ] ; do V="${V/#CONFIG_$ARG=/}" V="${V/#\"/}" V="${V/%\"/}" - V="${V/\\\"/\"}" + V="${V//\\\"/\"}" echo "${V}" fi fi -- cgit v1.2.3 From 9d4792c9b4e9cab75e657cec0c140875472d16f0 Mon Sep 17 00:00:00 2001 From: Benjamin Poirier Date: Tue, 24 Jul 2012 16:12:02 -0400 Subject: menuconfig: add u, d, q command keys in text boxes They function just like they do in less(1). Signed-off-by: Benjamin Poirier Signed-off-by: Michal Marek --- scripts/kconfig/lxdialog/textbox.c | 3 +++ scripts/kconfig/mconf.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/lxdialog/textbox.c b/scripts/kconfig/lxdialog/textbox.c index 154c2dd245b7..4e5de60a0c0d 100644 --- a/scripts/kconfig/lxdialog/textbox.c +++ b/scripts/kconfig/lxdialog/textbox.c @@ -129,6 +129,7 @@ do_resize: case 'e': case 'X': case 'x': + case 'q': delwin(box); delwin(dialog); return 0; @@ -190,6 +191,7 @@ do_resize: break; case 'B': /* Previous page */ case 'b': + case 'u': case KEY_PPAGE: if (begin_reached) break; @@ -214,6 +216,7 @@ do_resize: break; case KEY_NPAGE: /* Next page */ case ' ': + case 'd': if (end_reached) break; diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index f606738d421d..f584a281bb4c 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -105,10 +105,10 @@ static const char mconf_readme[] = N_( "Text Box (Help Window)\n" "--------\n" "o Use the cursor keys to scroll up/down/left/right. The VI editor\n" -" keys h,j,k,l function here as do and for those\n" -" who are familiar with less and lynx.\n" +" keys h,j,k,l function here as do , , and for \n" +" those who are familiar with less and lynx.\n" "\n" -"o Press , , or to exit.\n" +"o Press , , , or to exit.\n" "\n" "\n" "Alternate Configuration Files\n" -- cgit v1.2.3 From d68e818bc4d5c962093ced51c4d8341fc6aea30d Mon Sep 17 00:00:00 2001 From: Benjamin Poirier Date: Tue, 24 Jul 2012 16:12:03 -0400 Subject: nconf: add u, d command keys in scroll windows They function just like they do in less(1). Also correct some discrepancy between the help text and the code wrt function keys. Signed-off-by: Benjamin Poirier Signed-off-by: Michal Marek --- scripts/kconfig/nconf.c | 6 +++--- scripts/kconfig/nconf.gui.c | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index d945de5c43ac..1704a8562a5d 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -83,10 +83,10 @@ static const char nconf_readme[] = N_( "Text Box (Help Window)\n" "--------\n" "o Use the cursor keys to scroll up/down/left/right. The VI editor\n" -" keys h,j,k,l function here as do for those\n" -" who are familiar with less and lynx.\n" +" keys h,j,k,l function here as do , and for\n" +" those who are familiar with less and lynx.\n" "\n" -"o Press , , , or to exit.\n" +"o Press , , , , or to exit.\n" "\n" "\n" "Alternate Configuration Files\n" diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c index 3b18dd839668..379003c7a2b4 100644 --- a/scripts/kconfig/nconf.gui.c +++ b/scripts/kconfig/nconf.gui.c @@ -604,9 +604,11 @@ void show_scroll_win(WINDOW *main_window, switch (res) { case KEY_NPAGE: case ' ': + case 'd': start_y += text_lines-2; break; case KEY_PPAGE: + case 'u': start_y -= text_lines+2; break; case KEY_HOME: @@ -632,10 +634,10 @@ void show_scroll_win(WINDOW *main_window, start_x++; break; } - if (res == 10 || res == 27 || res == 'q' - || res == KEY_F(F_BACK) || res == KEY_F(F_EXIT)) { + if (res == 10 || res == 27 || res == 'q' || + res == KEY_F(F_HELP) || res == KEY_F(F_BACK) || + res == KEY_F(F_EXIT)) break; - } if (start_y < 0) start_y = 0; if (start_y >= total_lines-text_lines) -- cgit v1.2.3 From 67d34a6a391369269a2e5dba8a5f42cc4cd50231 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Fri, 15 Jun 2012 19:24:59 -0400 Subject: kconfig: Document oldnoconfig to what it really does The make target 'oldnoconfig' is a misnomer. It doesn't set new symbols to 'n', but instead sets it to their default values. Unfortunately, assuming that it actually did this, broke ktest in some of its tests. For example, the tests to create a minimum config and even a config bisect, depends on removing various configs and using oldnoconfig to get rid of other configs that may have depended on it. But because some configs that it was trying to disable, were in fact default enabled, this caused those configs to re-enable and corrupt the test. I thought about fixing oldnoconfig, but I'm afraid that people are already dependent on its current behavior. Instead, I'm just updating the documentation to state that it sets the new symbols to their default values and not to 'n'. Ideally, this would be called, 'olddefconfig' and we have an 'oldnoconfig' that actually disables the new symbols. But it's useless for me now. If it changed, ktest would need to be consistent between each version, and that would be to difficult to detect. I'll handle this issue with ktest with other means. Signed-off-by: Steven Rostedt Signed-off-by: Michal Marek --- scripts/kconfig/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 8dacae8bf4b9..77d53999ffb9 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -114,7 +114,7 @@ help: @echo ' alldefconfig - New config with all symbols set to default' @echo ' randconfig - New config with random answer to all options' @echo ' listnewconfig - List new options' - @echo ' oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)' + @echo ' oldnoconfig - Same as silentoldconfig but sets new symbols to their default value' # lxdialog stuff check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh -- cgit v1.2.3