Skip to content

Commit b4e2ed3

Browse files
committed
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kconfig changes from Michal Marek: - kconfig Makefile portability fixes - menuconfig/nconfig help pager usability fix - .gitignore cleanup - quoting fix in scripts/config - Makefile prints errors to stderr - support for arbitrarily log lines in .config - fix oldnoconfig description in 'make help' * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kconfig: Document oldnoconfig to what it really does nconf: add u, d command keys in scroll windows menuconfig: add u, d, q command keys in text boxes scripts/config: fix double-quotes un-escaping kconfig: Print errors to stderr in the Makefile kconfig: allow long lines in config file kconfig: remove lkc_defs.h from .gitignore and dontdiff xconfig: add quiet rule for moc xconfig: use pkgconfig to find moc kconfig: fix check-lxdialog for DLL platforms kconfig: check ncursesw headers first in check-lxdialog kconfig/nconf: fix compile with ncurses reentrant API
2 parents c66d707 + 67d34a6 commit b4e2ed3

10 files changed

Lines changed: 104 additions & 37 deletions

File tree

‎Documentation/dontdiff‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ keywords.c
150150
ksym.c*
151151
ksym.h*
152152
kxgettext
153-
lkc_defs.h
154153
lex.c
155154
lex.*.c
156155
linux

‎scripts/config‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ while [ "$1" != "" ] ; do
128128
V="${V/#CONFIG_$ARG=/}"
129129
V="${V/#\"/}"
130130
V="${V/%\"/}"
131-
V="${V/\\\"/\"}"
131+
V="${V//\\\"/\"}"
132132
echo "${V}"
133133
fi
134134
fi

‎scripts/kconfig/.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ config*
77
*.tab.h
88
zconf.hash.c
99
*.moc
10-
lkc_defs.h
1110
gconf.glade.h
1211
*.pot
1312
*.mo

‎scripts/kconfig/Makefile‎

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ help:
114114
@echo ' alldefconfig - New config with all symbols set to default'
115115
@echo ' randconfig - New config with random answer to all options'
116116
@echo ' listnewconfig - List new options'
117-
@echo ' oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)'
117+
@echo ' oldnoconfig - Same as silentoldconfig but sets new symbols to their default value'
118118

119119
# lxdialog stuff
120120
check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
@@ -234,12 +234,12 @@ $(obj)/.tmp_qtcheck:
234234
if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \
235235
done; \
236236
if [ -z "$$dir" ]; then \
237-
echo "*"; \
238-
echo "* Unable to find any QT installation. Please make sure that"; \
239-
echo "* the QT4 or QT3 development package is correctly installed and"; \
240-
echo "* either qmake can be found or install pkg-config or set"; \
241-
echo "* the QTDIR environment variable to the correct location."; \
242-
echo "*"; \
237+
echo >&2 "*"; \
238+
echo >&2 "* Unable to find any QT installation. Please make sure that"; \
239+
echo >&2 "* the QT4 or QT3 development package is correctly installed and"; \
240+
echo >&2 "* either qmake can be found or install pkg-config or set"; \
241+
echo >&2 "* the QTDIR environment variable to the correct location."; \
242+
echo >&2 "*"; \
243243
false; \
244244
fi; \
245245
libpath=$$dir/lib; lib=qt; osdir=""; \
@@ -260,8 +260,8 @@ $(obj)/.tmp_qtcheck:
260260
else \
261261
cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \
262262
libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \
263-
binpath="\$$(shell pkg-config QtCore --variable=prefix)"; \
264-
moc="$$binpath/bin/moc"; \
263+
moc="\$$(shell pkg-config QtCore --variable=moc_location)"; \
264+
[ -n "$$moc" ] || moc="\$$(shell pkg-config QtCore --variable=prefix)/bin/moc"; \
265265
fi; \
266266
echo "KC_QT_CFLAGS=$$cflags" > $@; \
267267
echo "KC_QT_LIBS=$$libs" >> $@; \
@@ -279,17 +279,17 @@ $(obj)/.tmp_gtkcheck:
279279
if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \
280280
touch $@; \
281281
else \
282-
echo "*"; \
283-
echo "* GTK+ is present but version >= 2.0.0 is required."; \
284-
echo "*"; \
282+
echo >&2 "*"; \
283+
echo >&2 "* GTK+ is present but version >= 2.0.0 is required."; \
284+
echo >&2 "*"; \
285285
false; \
286286
fi \
287287
else \
288-
echo "*"; \
289-
echo "* Unable to find the GTK+ installation. Please make sure that"; \
290-
echo "* the GTK+ 2.0 development package is correctly installed..."; \
291-
echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \
292-
echo "*"; \
288+
echo >&2 "*"; \
289+
echo >&2 "* Unable to find the GTK+ installation. Please make sure that"; \
290+
echo >&2 "* the GTK+ 2.0 development package is correctly installed..."; \
291+
echo >&2 "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \
292+
echo >&2 "*"; \
293293
false; \
294294
fi
295295
endif
@@ -298,8 +298,11 @@ $(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c
298298

299299
$(obj)/qconf.o: $(obj)/qconf.moc
300300

301-
$(obj)/%.moc: $(src)/%.h
302-
$(KC_QT_MOC) -i $< -o $@
301+
quiet_cmd_moc = MOC $@
302+
cmd_moc = $(KC_QT_MOC) -i $< -o $@
303+
304+
$(obj)/%.moc: $(src)/%.h $(obj)/.tmp_qtcheck
305+
$(call cmd,moc)
303306

304307
# Extract gconf menu items for I18N support
305308
$(obj)/gconf.glade.h: $(obj)/gconf.glade

‎scripts/kconfig/confdata.c‎

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,66 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
182182
return 0;
183183
}
184184

185+
#define LINE_GROWTH 16
186+
static int add_byte(int c, char **lineptr, size_t slen, size_t *n)
187+
{
188+
char *nline;
189+
size_t new_size = slen + 1;
190+
if (new_size > *n) {
191+
new_size += LINE_GROWTH - 1;
192+
new_size *= 2;
193+
nline = realloc(*lineptr, new_size);
194+
if (!nline)
195+
return -1;
196+
197+
*lineptr = nline;
198+
*n = new_size;
199+
}
200+
201+
(*lineptr)[slen] = c;
202+
203+
return 0;
204+
}
205+
206+
static ssize_t compat_getline(char **lineptr, size_t *n, FILE *stream)
207+
{
208+
char *line = *lineptr;
209+
size_t slen = 0;
210+
211+
for (;;) {
212+
int c = getc(stream);
213+
214+
switch (c) {
215+
case '\n':
216+
if (add_byte(c, &line, slen, n) < 0)
217+
goto e_out;
218+
slen++;
219+
/* fall through */
220+
case EOF:
221+
if (add_byte('\0', &line, slen, n) < 0)
222+
goto e_out;
223+
*lineptr = line;
224+
if (slen == 0)
225+
return -1;
226+
return slen;
227+
default:
228+
if (add_byte(c, &line, slen, n) < 0)
229+
goto e_out;
230+
slen++;
231+
}
232+
}
233+
234+
e_out:
235+
line[slen-1] = '\0';
236+
*lineptr = line;
237+
return -1;
238+
}
239+
185240
int conf_read_simple(const char *name, int def)
186241
{
187242
FILE *in = NULL;
188-
char line[1024];
243+
char *line = NULL;
244+
size_t line_asize = 0;
189245
char *p, *p2;
190246
struct symbol *sym;
191247
int i, def_flags;
@@ -247,7 +303,7 @@ int conf_read_simple(const char *name, int def)
247303
}
248304
}
249305

250-
while (fgets(line, sizeof(line), in)) {
306+
while (compat_getline(&line, &line_asize, in) != -1) {
251307
conf_lineno++;
252308
sym = NULL;
253309
if (line[0] == '#') {
@@ -335,6 +391,7 @@ int conf_read_simple(const char *name, int def)
335391
cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri);
336392
}
337393
}
394+
free(line);
338395
fclose(in);
339396

340397
if (modules_sym)

‎scripts/kconfig/lxdialog/check-lxdialog.sh‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# What library to link
55
ldflags()
66
{
7-
for ext in so a dylib ; do
7+
for ext in so a dll.a dylib ; do
88
for lib in ncursesw ncurses curses ; do
99
$cc -print-file-name=lib${lib}.${ext} | grep -q /
1010
if [ $? -eq 0 ]; then
@@ -19,12 +19,12 @@ ldflags()
1919
# Where is ncurses.h?
2020
ccflags()
2121
{
22-
if [ -f /usr/include/ncurses/ncurses.h ]; then
22+
if [ -f /usr/include/ncursesw/curses.h ]; then
23+
echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"'
24+
elif [ -f /usr/include/ncurses/ncurses.h ]; then
2325
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
2426
elif [ -f /usr/include/ncurses/curses.h ]; then
2527
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"'
26-
elif [ -f /usr/include/ncursesw/curses.h ]; then
27-
echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"'
2828
elif [ -f /usr/include/ncurses.h ]; then
2929
echo '-DCURSES_LOC="<ncurses.h>"'
3030
else

‎scripts/kconfig/lxdialog/textbox.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ int dialog_textbox(const char *title, const char *tbuf,
129129
case 'e':
130130
case 'X':
131131
case 'x':
132+
case 'q':
132133
delwin(box);
133134
delwin(dialog);
134135
return 0;
@@ -190,6 +191,7 @@ int dialog_textbox(const char *title, const char *tbuf,
190191
break;
191192
case 'B': /* Previous page */
192193
case 'b':
194+
case 'u':
193195
case KEY_PPAGE:
194196
if (begin_reached)
195197
break;
@@ -214,6 +216,7 @@ int dialog_textbox(const char *title, const char *tbuf,
214216
break;
215217
case KEY_NPAGE: /* Next page */
216218
case ' ':
219+
case 'd':
217220
if (end_reached)
218221
break;
219222

‎scripts/kconfig/mconf.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ static const char mconf_readme[] = N_(
105105
"Text Box (Help Window)\n"
106106
"--------\n"
107107
"o Use the cursor keys to scroll up/down/left/right. The VI editor\n"
108-
" keys h,j,k,l function here as do <SPACE BAR> and <B> for those\n"
109-
" who are familiar with less and lynx.\n"
108+
" keys h,j,k,l function here as do <u>, <d>, <SPACE BAR> and <B> for \n"
109+
" those who are familiar with less and lynx.\n"
110110
"\n"
111-
"o Press <E>, <X>, <Enter> or <Esc><Esc> to exit.\n"
111+
"o Press <E>, <X>, <q>, <Enter> or <Esc><Esc> to exit.\n"
112112
"\n"
113113
"\n"
114114
"Alternate Configuration Files\n"

‎scripts/kconfig/nconf.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ static const char nconf_readme[] = N_(
8383
"Text Box (Help Window)\n"
8484
"--------\n"
8585
"o Use the cursor keys to scroll up/down/left/right. The VI editor\n"
86-
" keys h,j,k,l function here as do <SPACE BAR> for those\n"
87-
" who are familiar with less and lynx.\n"
86+
" keys h,j,k,l function here as do <u>, <d> and <SPACE BAR> for\n"
87+
" those who are familiar with less and lynx.\n"
8888
"\n"
89-
"o Press <Enter>, <F1>, <F5>, <F7> or <Esc> to exit.\n"
89+
"o Press <Enter>, <F1>, <F5>, <F9>, <q> or <Esc> to exit.\n"
9090
"\n"
9191
"\n"
9292
"Alternate Configuration Files\n"
@@ -1503,7 +1503,11 @@ int main(int ac, char **av)
15031503
}
15041504

15051505
notimeout(stdscr, FALSE);
1506+
#if NCURSES_REENTRANT
1507+
set_escdelay(1);
1508+
#else
15061509
ESCDELAY = 1;
1510+
#endif
15071511

15081512
/* set btns menu */
15091513
curses_menu = new_menu(curses_menu_items);

‎scripts/kconfig/nconf.gui.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,11 @@ void show_scroll_win(WINDOW *main_window,
604604
switch (res) {
605605
case KEY_NPAGE:
606606
case ' ':
607+
case 'd':
607608
start_y += text_lines-2;
608609
break;
609610
case KEY_PPAGE:
611+
case 'u':
610612
start_y -= text_lines+2;
611613
break;
612614
case KEY_HOME:
@@ -632,10 +634,10 @@ void show_scroll_win(WINDOW *main_window,
632634
start_x++;
633635
break;
634636
}
635-
if (res == 10 || res == 27 || res == 'q'
636-
|| res == KEY_F(F_BACK) || res == KEY_F(F_EXIT)) {
637+
if (res == 10 || res == 27 || res == 'q' ||
638+
res == KEY_F(F_HELP) || res == KEY_F(F_BACK) ||
639+
res == KEY_F(F_EXIT))
637640
break;
638-
}
639641
if (start_y < 0)
640642
start_y = 0;
641643
if (start_y >= total_lines-text_lines)

0 commit comments

Comments
 (0)