History

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

Linus Torvalds committed 14 years ago

Commit b4e2ed32 parents c66d707 67d34a610 files · +104 −37Browse files

Showing the changes to scripts (9 of 10 files). Show all

Unified · Split

9 files
  1. scripts/config +1 −1
  2. scripts/kconfig/.gitignore +0 −1
  3. scripts/kconfig/Makefile +22 −19
  4. scripts/kconfig/confdata.c +59 −2
  5. scripts/kconfig/lxdialog/check-lxdialog.sh +4 −4
  6. scripts/kconfig/lxdialog/textbox.c +3 −0
  7. scripts/kconfig/mconf.c +3 −3
  8. scripts/kconfig/nconf.c +7 −3
  9. scripts/kconfig/nconf.gui.c +5 −3
scripts/config+1−1
@@ -128,7 +128,7 @@ while [ "$1" != "" ] ; do · 127 unmodified lines
128 V="${V/#CONFIG_$ARG=/}"128 V="${V/#CONFIG_$ARG=/}"
129 V="${V/#\"/}"129 V="${V/#\"/}"
130 V="${V/%\"/}"130 V="${V/%\"/}"
131 V="${V/\\\"/\"}"131 V="${V//\\\"/\"}"
132 echo "${V}"132 echo "${V}"
133 fi133 fi
134 fi134 fi
scripts/kconfig/.gitignore+0−1
@@ -7,7 +7,6 @@ config* · 6 unmodified lines
7*.tab.h7*.tab.h
8zconf.hash.c8zconf.hash.c
9*.moc9*.moc
10lkc_defs.h
11gconf.glade.h10gconf.glade.h
12*.pot11*.pot
13*.mo12*.mo
scripts/kconfig/Makefile+22−19
@@ -114,7 +114,7 @@ help: · 113 unmodified lines
114 @echo ' alldefconfig - New config with all symbols set to default'114 @echo ' alldefconfig - New config with all symbols set to default'
115 @echo ' randconfig - New config with random answer to all options'115 @echo ' randconfig - New config with random answer to all options'
116 @echo ' listnewconfig - List new options'116 @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'
118 118
119# lxdialog stuff119# lxdialog stuff
120check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh120check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
@@ -234,12 +234,12 @@ $(obj)/.tmp_qtcheck: · 113 unmodified lines
234 if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \234 if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \
235 done; \235 done; \
236 if [ -z "$$dir" ]; then \236 if [ -z "$$dir" ]; then \
237 echo "*"; \237 echo >&2 "*"; \
238 echo "* Unable to find any QT installation. Please make sure that"; \238 echo >&2 "* Unable to find any QT installation. Please make sure that"; \
239 echo "* the QT4 or QT3 development package is correctly installed and"; \239 echo >&2 "* the QT4 or QT3 development package is correctly installed and"; \
240 echo "* either qmake can be found or install pkg-config or set"; \240 echo >&2 "* either qmake can be found or install pkg-config or set"; \
241 echo "* the QTDIR environment variable to the correct location."; \241 echo >&2 "* the QTDIR environment variable to the correct location."; \
242 echo "*"; \242 echo >&2 "*"; \
243 false; \243 false; \
244 fi; \244 fi; \
245 libpath=$$dir/lib; lib=qt; osdir=""; \245 libpath=$$dir/lib; lib=qt; osdir=""; \
@@ -260,8 +260,8 @@ $(obj)/.tmp_qtcheck: · 14 unmodified lines
260 else \260 else \
261 cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \261 cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \
262 libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \262 libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \
263 binpath="\$$(shell pkg-config QtCore --variable=prefix)"; \263 moc="\$$(shell pkg-config QtCore --variable=moc_location)"; \
264 moc="$$binpath/bin/moc"; \264 [ -n "$$moc" ] || moc="\$$(shell pkg-config QtCore --variable=prefix)/bin/moc"; \
265 fi; \265 fi; \
266 echo "KC_QT_CFLAGS=$$cflags" > $@; \266 echo "KC_QT_CFLAGS=$$cflags" > $@; \
267 echo "KC_QT_LIBS=$$libs" >> $@; \267 echo "KC_QT_LIBS=$$libs" >> $@; \
@@ -279,17 +279,17 @@ $(obj)/.tmp_gtkcheck: · 11 unmodified lines
279 if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \279 if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \
280 touch $@; \280 touch $@; \
281 else \281 else \
282 echo "*"; \282 echo >&2 "*"; \
283 echo "* GTK+ is present but version >= 2.0.0 is required."; \283 echo >&2 "* GTK+ is present but version >= 2.0.0 is required."; \
284 echo "*"; \284 echo >&2 "*"; \
285 false; \285 false; \
286 fi \286 fi \
287 else \287 else \
288 echo "*"; \288 echo >&2 "*"; \
289 echo "* Unable to find the GTK+ installation. Please make sure that"; \289 echo >&2 "* Unable to find the GTK+ installation. Please make sure that"; \
290 echo "* the GTK+ 2.0 development package is correctly installed..."; \290 echo >&2 "* the GTK+ 2.0 development package is correctly installed..."; \
291 echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \291 echo >&2 "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \
292 echo "*"; \292 echo >&2 "*"; \
293 false; \293 false; \
294 fi294 fi
295endif295endif
@@ -298,8 +298,11 @@ $(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c · 2 unmodified lines
298 298
299$(obj)/qconf.o: $(obj)/qconf.moc299$(obj)/qconf.o: $(obj)/qconf.moc
300 300
301$(obj)/%.moc: $(src)/%.h301quiet_cmd_moc = MOC $@
302 $(KC_QT_MOC) -i $< -o $@302 cmd_moc = $(KC_QT_MOC) -i $< -o $@
303
304$(obj)/%.moc: $(src)/%.h $(obj)/.tmp_qtcheck
305 $(call cmd,moc)
303 306
304# Extract gconf menu items for I18N support307# Extract gconf menu items for I18N support
305$(obj)/gconf.glade.h: $(obj)/gconf.glade308$(obj)/gconf.glade.h: $(obj)/gconf.glade
scripts/kconfig/confdata.c+59−2
@@ -182,10 +182,66 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) · 181 unmodified lines
182 return 0;182 return 0;
183}183}
184 184
185#define LINE_GROWTH 16
186static 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
206static 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
234e_out:
235 line[slen-1] = '\0';
236 *lineptr = line;
237 return -1;
238}
239
185int conf_read_simple(const char *name, int def)240int conf_read_simple(const char *name, int def)
186{241{
187 FILE *in = NULL;242 FILE *in = NULL;
188 char line[1024];243 char *line = NULL;
244 size_t line_asize = 0;
189 char *p, *p2;245 char *p, *p2;
190 struct symbol *sym;246 struct symbol *sym;
191 int i, def_flags;247 int i, def_flags;
@@ -247,7 +303,7 @@ load: · 55 unmodified lines
247 }303 }
248 }304 }
249 305
250 while (fgets(line, sizeof(line), in)) {306 while (compat_getline(&line, &line_asize, in) != -1) {
251 conf_lineno++;307 conf_lineno++;
252 sym = NULL;308 sym = NULL;
253 if (line[0] == '#') {309 if (line[0] == '#') {
@@ -335,6 +391,7 @@ setsym: · 81 unmodified lines
335 cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri);391 cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri);
336 }392 }
337 }393 }
394 free(line);
338 fclose(in);395 fclose(in);
339 396
340 if (modules_sym)397 if (modules_sym)
scripts/kconfig/lxdialog/check-lxdialog.sh+4−4
@@ -4,7 +4,7 @@ · 3 unmodified lines
4# What library to link4# What library to link
5ldflags()5ldflags()
6{6{
7 for ext in so a dylib ; do7 for ext in so a dll.a dylib ; do
8 for lib in ncursesw ncurses curses ; do8 for lib in ncursesw ncurses curses ; do
9 $cc -print-file-name=lib${lib}.${ext} | grep -q /9 $cc -print-file-name=lib${lib}.${ext} | grep -q /
10 if [ $? -eq 0 ]; then10 if [ $? -eq 0 ]; then
@@ -19,12 +19,12 @@ ldflags() · 8 unmodified lines
19# Where is ncurses.h?19# Where is ncurses.h?
20ccflags()20ccflags()
21{21{
22 if [ -f /usr/include/ncurses/ncurses.h ]; then22 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
23 echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'25 echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
24 elif [ -f /usr/include/ncurses/curses.h ]; then26 elif [ -f /usr/include/ncurses/curses.h ]; then
25 echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"'27 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>"'
28 elif [ -f /usr/include/ncurses.h ]; then28 elif [ -f /usr/include/ncurses.h ]; then
29 echo '-DCURSES_LOC="<ncurses.h>"'29 echo '-DCURSES_LOC="<ncurses.h>"'
30 else30 else
scripts/kconfig/lxdialog/textbox.c+3−0
@@ -129,6 +129,7 @@ do_resize: · 128 unmodified lines
129 case 'e':129 case 'e':
130 case 'X':130 case 'X':
131 case 'x':131 case 'x':
132 case 'q':
132 delwin(box);133 delwin(box);
133 delwin(dialog);134 delwin(dialog);
134 return 0;135 return 0;
@@ -190,6 +191,7 @@ do_resize: · 55 unmodified lines
190 break;191 break;
191 case 'B': /* Previous page */192 case 'B': /* Previous page */
192 case 'b':193 case 'b':
194 case 'u':
193 case KEY_PPAGE:195 case KEY_PPAGE:
194 if (begin_reached)196 if (begin_reached)
195 break;197 break;
@@ -214,6 +216,7 @@ do_resize: · 18 unmodified lines
214 break;216 break;
215 case KEY_NPAGE: /* Next page */217 case KEY_NPAGE: /* Next page */
216 case ' ':218 case ' ':
219 case 'd':
217 if (end_reached)220 if (end_reached)
218 break;221 break;
219 222
scripts/kconfig/mconf.c+3−3
@@ -105,10 +105,10 @@ static const char mconf_readme[] = N_( · 104 unmodified lines
105"Text Box (Help Window)\n"105"Text Box (Help Window)\n"
106"--------\n"106"--------\n"
107"o Use the cursor keys to scroll up/down/left/right. The VI editor\n"107"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"108" keys h,j,k,l function here as do <u>, <d>, <SPACE BAR> and <B> for \n"
109" who are familiar with less and lynx.\n"109" those who are familiar with less and lynx.\n"
110"\n"110"\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"
112"\n"112"\n"
113"\n"113"\n"
114"Alternate Configuration Files\n"114"Alternate Configuration Files\n"
scripts/kconfig/nconf.c+7−3
@@ -83,10 +83,10 @@ static const char nconf_readme[] = N_( · 82 unmodified lines
83"Text Box (Help Window)\n"83"Text Box (Help Window)\n"
84"--------\n"84"--------\n"
85"o Use the cursor keys to scroll up/down/left/right. The VI editor\n"85"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"86" keys h,j,k,l function here as do <u>, <d> and <SPACE BAR> for\n"
87" who are familiar with less and lynx.\n"87" those who are familiar with less and lynx.\n"
88"\n"88"\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"
90"\n"90"\n"
91"\n"91"\n"
92"Alternate Configuration Files\n"92"Alternate Configuration Files\n"
@@ -1503,7 +1503,11 @@ int main(int ac, char **av) · 1410 unmodified lines
1503 }1503 }
1504 1504
1505 notimeout(stdscr, FALSE);1505 notimeout(stdscr, FALSE);
1506#if NCURSES_REENTRANT
1507 set_escdelay(1);
1508#else
1506 ESCDELAY = 1;1509 ESCDELAY = 1;
1510#endif
1507 1511
1508 /* set btns menu */1512 /* set btns menu */
1509 curses_menu = new_menu(curses_menu_items);1513 curses_menu = new_menu(curses_menu_items);
scripts/kconfig/nconf.gui.c+5−3
@@ -604,9 +604,11 @@ void show_scroll_win(WINDOW *main_window, · 603 unmodified lines
604 switch (res) {604 switch (res) {
605 case KEY_NPAGE:605 case KEY_NPAGE:
606 case ' ':606 case ' ':
607 case 'd':
607 start_y += text_lines-2;608 start_y += text_lines-2;
608 break;609 break;
609 case KEY_PPAGE:610 case KEY_PPAGE:
611 case 'u':
610 start_y -= text_lines+2;612 start_y -= text_lines+2;
611 break;613 break;
612 case KEY_HOME:614 case KEY_HOME:
@@ -632,10 +634,10 @@ void show_scroll_win(WINDOW *main_window, · 19 unmodified lines
632 start_x++;634 start_x++;
633 break;635 break;
634 }636 }
635 if (res == 10 || res == 27 || res == 'q'637 if (res == 10 || res == 27 || res == 'q' ||
636 || res == KEY_F(F_BACK) || res == KEY_F(F_EXIT)) {638 res == KEY_F(F_HELP) || res == KEY_F(F_BACK) ||
639 res == KEY_F(F_EXIT))
637 break;640 break;
638 }
639 if (start_y < 0)641 if (start_y < 0)
640 start_y = 0;642 start_y = 0;
641 if (start_y >= total_lines-text_lines)643 if (start_y >= total_lines-text_lines)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t