Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+104 -37
-1
Documentation/dontdiff
··· 150 150 ksym.c* 151 151 ksym.h* 152 152 kxgettext 153 - lkc_defs.h 154 153 lex.c 155 154 lex.*.c 156 155 linux
+1 -1
scripts/config
··· 128 128 V="${V/#CONFIG_$ARG=/}" 129 129 V="${V/#\"/}" 130 130 V="${V/%\"/}" 131 - V="${V/\\\"/\"}" 131 + V="${V//\\\"/\"}" 132 132 echo "${V}" 133 133 fi 134 134 fi
-1
scripts/kconfig/.gitignore
··· 7 7 *.tab.h 8 8 zconf.hash.c 9 9 *.moc 10 - lkc_defs.h 11 10 gconf.glade.h 12 11 *.pot 13 12 *.mo
+22 -19
scripts/kconfig/Makefile
··· 114 114 @echo ' alldefconfig - New config with all symbols set to default' 115 115 @echo ' randconfig - New config with random answer to all options' 116 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 119 # lxdialog stuff 120 120 check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh ··· 234 234 if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ 235 235 done; \ 236 236 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 "*"; \ 243 243 false; \ 244 244 fi; \ 245 245 libpath=$$dir/lib; lib=qt; osdir=""; \ ··· 260 260 else \ 261 261 cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \ 262 262 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"; \ 265 265 fi; \ 266 266 echo "KC_QT_CFLAGS=$$cflags" > $@; \ 267 267 echo "KC_QT_LIBS=$$libs" >> $@; \ ··· 279 279 if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \ 280 280 touch $@; \ 281 281 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 "*"; \ 285 285 false; \ 286 286 fi \ 287 287 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 "*"; \ 293 293 false; \ 294 294 fi 295 295 endif ··· 298 298 299 299 $(obj)/qconf.o: $(obj)/qconf.moc 300 300 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) 303 306 304 307 # Extract gconf menu items for I18N support 305 308 $(obj)/gconf.glade.h: $(obj)/gconf.glade
+59 -2
scripts/kconfig/confdata.c
··· 182 182 return 0; 183 183 } 184 184 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 + 185 240 int conf_read_simple(const char *name, int def) 186 241 { 187 242 FILE *in = NULL; 188 - char line[1024]; 243 + char *line = NULL; 244 + size_t line_asize = 0; 189 245 char *p, *p2; 190 246 struct symbol *sym; 191 247 int i, def_flags; ··· 303 247 } 304 248 } 305 249 306 - while (fgets(line, sizeof(line), in)) { 250 + while (compat_getline(&line, &line_asize, in) != -1) { 307 251 conf_lineno++; 308 252 sym = NULL; 309 253 if (line[0] == '#') { ··· 391 335 cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri); 392 336 } 393 337 } 338 + free(line); 394 339 fclose(in); 395 340 396 341 if (modules_sym)
+4 -4
scripts/kconfig/lxdialog/check-lxdialog.sh
··· 4 4 # What library to link 5 5 ldflags() 6 6 { 7 - for ext in so a dylib ; do 7 + for ext in so a dll.a dylib ; do 8 8 for lib in ncursesw ncurses curses ; do 9 9 $cc -print-file-name=lib${lib}.${ext} | grep -q / 10 10 if [ $? -eq 0 ]; then ··· 19 19 # Where is ncurses.h? 20 20 ccflags() 21 21 { 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 23 25 echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' 24 26 elif [ -f /usr/include/ncurses/curses.h ]; then 25 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 28 elif [ -f /usr/include/ncurses.h ]; then 29 29 echo '-DCURSES_LOC="<ncurses.h>"' 30 30 else
+3
scripts/kconfig/lxdialog/textbox.c
··· 129 129 case 'e': 130 130 case 'X': 131 131 case 'x': 132 + case 'q': 132 133 delwin(box); 133 134 delwin(dialog); 134 135 return 0; ··· 191 190 break; 192 191 case 'B': /* Previous page */ 193 192 case 'b': 193 + case 'u': 194 194 case KEY_PPAGE: 195 195 if (begin_reached) 196 196 break; ··· 216 214 break; 217 215 case KEY_NPAGE: /* Next page */ 218 216 case ' ': 217 + case 'd': 219 218 if (end_reached) 220 219 break; 221 220
+3 -3
scripts/kconfig/mconf.c
··· 105 105 "Text Box (Help Window)\n" 106 106 "--------\n" 107 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" 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" 110 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 112 "\n" 113 113 "\n" 114 114 "Alternate Configuration Files\n"
+7 -3
scripts/kconfig/nconf.c
··· 83 83 "Text Box (Help Window)\n" 84 84 "--------\n" 85 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" 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" 88 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 90 "\n" 91 91 "\n" 92 92 "Alternate Configuration Files\n" ··· 1503 1503 } 1504 1504 1505 1505 notimeout(stdscr, FALSE); 1506 + #if NCURSES_REENTRANT 1507 + set_escdelay(1); 1508 + #else 1506 1509 ESCDELAY = 1; 1510 + #endif 1507 1511 1508 1512 /* set btns menu */ 1509 1513 curses_menu = new_menu(curses_menu_items);
+5 -3
scripts/kconfig/nconf.gui.c
··· 604 604 switch (res) { 605 605 case KEY_NPAGE: 606 606 case ' ': 607 + case 'd': 607 608 start_y += text_lines-2; 608 609 break; 609 610 case KEY_PPAGE: 611 + case 'u': 610 612 start_y -= text_lines+2; 611 613 break; 612 614 case KEY_HOME: ··· 634 632 start_x++; 635 633 break; 636 634 } 637 - if (res == 10 || res == 27 || res == 'q' 638 - || res == KEY_F(F_BACK) || res == KEY_F(F_EXIT)) { 635 + if (res == 10 || res == 27 || res == 'q' || 636 + res == KEY_F(F_HELP) || res == KEY_F(F_BACK) || 637 + res == KEY_F(F_EXIT)) 639 638 break; 640 - } 641 639 if (start_y < 0) 642 640 start_y = 0; 643 641 if (start_y >= total_lines-text_lines)