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
This commit is contained in:
Linus Torvalds 2012-07-30 11:22:45 -07:00
commit b4e2ed3255
10 changed files with 104 additions and 37 deletions

View File

@ -150,7 +150,6 @@ keywords.c
ksym.c* ksym.c*
ksym.h* ksym.h*
kxgettext kxgettext
lkc_defs.h
lex.c lex.c
lex.*.c lex.*.c
linux linux

View File

@ -128,7 +128,7 @@ while [ "$1" != "" ] ; do
V="${V/#CONFIG_$ARG=/}" V="${V/#CONFIG_$ARG=/}"
V="${V/#\"/}" V="${V/#\"/}"
V="${V/%\"/}" V="${V/%\"/}"
V="${V/\\\"/\"}" V="${V//\\\"/\"}"
echo "${V}" echo "${V}"
fi fi
fi fi

View File

@ -7,7 +7,6 @@ config*
*.tab.h *.tab.h
zconf.hash.c zconf.hash.c
*.moc *.moc
lkc_defs.h
gconf.glade.h gconf.glade.h
*.pot *.pot
*.mo *.mo

View File

@ -114,7 +114,7 @@ help:
@echo ' alldefconfig - New config with all symbols set to default' @echo ' alldefconfig - New config with all symbols set to default'
@echo ' randconfig - New config with random answer to all options' @echo ' randconfig - New config with random answer to all options'
@echo ' listnewconfig - List new 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 # lxdialog stuff
check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
@ -234,12 +234,12 @@ $(obj)/.tmp_qtcheck:
if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \
done; \ done; \
if [ -z "$$dir" ]; then \ if [ -z "$$dir" ]; then \
echo "*"; \ echo >&2 "*"; \
echo "* Unable to find any QT installation. Please make sure that"; \ echo >&2 "* Unable to find any QT installation. Please make sure that"; \
echo "* the QT4 or QT3 development package is correctly installed and"; \ echo >&2 "* the QT4 or QT3 development package is correctly installed and"; \
echo "* either qmake can be found or install pkg-config or set"; \ echo >&2 "* either qmake can be found or install pkg-config or set"; \
echo "* the QTDIR environment variable to the correct location."; \ echo >&2 "* the QTDIR environment variable to the correct location."; \
echo "*"; \ echo >&2 "*"; \
false; \ false; \
fi; \ fi; \
libpath=$$dir/lib; lib=qt; osdir=""; \ libpath=$$dir/lib; lib=qt; osdir=""; \
@ -260,8 +260,8 @@ $(obj)/.tmp_qtcheck:
else \ else \
cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \ cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \
libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \ libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \
binpath="\$$(shell pkg-config QtCore --variable=prefix)"; \ moc="\$$(shell pkg-config QtCore --variable=moc_location)"; \
moc="$$binpath/bin/moc"; \ [ -n "$$moc" ] || moc="\$$(shell pkg-config QtCore --variable=prefix)/bin/moc"; \
fi; \ fi; \
echo "KC_QT_CFLAGS=$$cflags" > $@; \ echo "KC_QT_CFLAGS=$$cflags" > $@; \
echo "KC_QT_LIBS=$$libs" >> $@; \ echo "KC_QT_LIBS=$$libs" >> $@; \
@ -279,17 +279,17 @@ $(obj)/.tmp_gtkcheck:
if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \ if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \
touch $@; \ touch $@; \
else \ else \
echo "*"; \ echo >&2 "*"; \
echo "* GTK+ is present but version >= 2.0.0 is required."; \ echo >&2 "* GTK+ is present but version >= 2.0.0 is required."; \
echo "*"; \ echo >&2 "*"; \
false; \ false; \
fi \ fi \
else \ else \
echo "*"; \ echo >&2 "*"; \
echo "* Unable to find the GTK+ installation. Please make sure that"; \ echo >&2 "* Unable to find the GTK+ installation. Please make sure that"; \
echo "* the GTK+ 2.0 development package is correctly installed..."; \ echo >&2 "* the GTK+ 2.0 development package is correctly installed..."; \
echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \ echo >&2 "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \
echo "*"; \ echo >&2 "*"; \
false; \ false; \
fi fi
endif endif
@ -298,8 +298,11 @@ $(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c
$(obj)/qconf.o: $(obj)/qconf.moc $(obj)/qconf.o: $(obj)/qconf.moc
$(obj)/%.moc: $(src)/%.h quiet_cmd_moc = MOC $@
$(KC_QT_MOC) -i $< -o $@ cmd_moc = $(KC_QT_MOC) -i $< -o $@
$(obj)/%.moc: $(src)/%.h $(obj)/.tmp_qtcheck
$(call cmd,moc)
# Extract gconf menu items for I18N support # Extract gconf menu items for I18N support
$(obj)/gconf.glade.h: $(obj)/gconf.glade $(obj)/gconf.glade.h: $(obj)/gconf.glade

View File

@ -182,10 +182,66 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
return 0; 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) int conf_read_simple(const char *name, int def)
{ {
FILE *in = NULL; FILE *in = NULL;
char line[1024]; char *line = NULL;
size_t line_asize = 0;
char *p, *p2; char *p, *p2;
struct symbol *sym; struct symbol *sym;
int i, def_flags; 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++; conf_lineno++;
sym = NULL; sym = NULL;
if (line[0] == '#') { if (line[0] == '#') {
@ -335,6 +391,7 @@ setsym:
cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri); cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri);
} }
} }
free(line);
fclose(in); fclose(in);
if (modules_sym) if (modules_sym)

View File

@ -4,7 +4,7 @@
# What library to link # What library to link
ldflags() ldflags()
{ {
for ext in so a dylib ; do for ext in so a dll.a dylib ; do
for lib in ncursesw ncurses curses ; do for lib in ncursesw ncurses curses ; do
$cc -print-file-name=lib${lib}.${ext} | grep -q / $cc -print-file-name=lib${lib}.${ext} | grep -q /
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -19,12 +19,12 @@ ldflags()
# Where is ncurses.h? # Where is ncurses.h?
ccflags() ccflags()
{ {
if [ -f /usr/include/ncurses/ncurses.h ]; then if [ -f /usr/include/ncursesw/curses.h ]; then
echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"'
elif [ -f /usr/include/ncurses/ncurses.h ]; then
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
elif [ -f /usr/include/ncurses/curses.h ]; then elif [ -f /usr/include/ncurses/curses.h ]; then
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"' echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"'
elif [ -f /usr/include/ncursesw/curses.h ]; then
echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"'
elif [ -f /usr/include/ncurses.h ]; then elif [ -f /usr/include/ncurses.h ]; then
echo '-DCURSES_LOC="<ncurses.h>"' echo '-DCURSES_LOC="<ncurses.h>"'
else else

View File

@ -129,6 +129,7 @@ do_resize:
case 'e': case 'e':
case 'X': case 'X':
case 'x': case 'x':
case 'q':
delwin(box); delwin(box);
delwin(dialog); delwin(dialog);
return 0; return 0;
@ -190,6 +191,7 @@ do_resize:
break; break;
case 'B': /* Previous page */ case 'B': /* Previous page */
case 'b': case 'b':
case 'u':
case KEY_PPAGE: case KEY_PPAGE:
if (begin_reached) if (begin_reached)
break; break;
@ -214,6 +216,7 @@ do_resize:
break; break;
case KEY_NPAGE: /* Next page */ case KEY_NPAGE: /* Next page */
case ' ': case ' ':
case 'd':
if (end_reached) if (end_reached)
break; break;

View File

@ -105,10 +105,10 @@ static const char mconf_readme[] = N_(
"Text Box (Help Window)\n" "Text Box (Help Window)\n"
"--------\n" "--------\n"
"o Use the cursor keys to scroll up/down/left/right. The VI editor\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 <SPACE BAR> and <B> for those\n" " keys h,j,k,l function here as do <u>, <d>, <SPACE BAR> and <B> for \n"
" who are familiar with less and lynx.\n" " those who are familiar with less and lynx.\n"
"\n" "\n"
"o Press <E>, <X>, <Enter> or <Esc><Esc> to exit.\n" "o Press <E>, <X>, <q>, <Enter> or <Esc><Esc> to exit.\n"
"\n" "\n"
"\n" "\n"
"Alternate Configuration Files\n" "Alternate Configuration Files\n"

View File

@ -83,10 +83,10 @@ static const char nconf_readme[] = N_(
"Text Box (Help Window)\n" "Text Box (Help Window)\n"
"--------\n" "--------\n"
"o Use the cursor keys to scroll up/down/left/right. The VI editor\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 <SPACE BAR> for those\n" " keys h,j,k,l function here as do <u>, <d> and <SPACE BAR> for\n"
" who are familiar with less and lynx.\n" " those who are familiar with less and lynx.\n"
"\n" "\n"
"o Press <Enter>, <F1>, <F5>, <F7> or <Esc> to exit.\n" "o Press <Enter>, <F1>, <F5>, <F9>, <q> or <Esc> to exit.\n"
"\n" "\n"
"\n" "\n"
"Alternate Configuration Files\n" "Alternate Configuration Files\n"
@ -1503,7 +1503,11 @@ int main(int ac, char **av)
} }
notimeout(stdscr, FALSE); notimeout(stdscr, FALSE);
#if NCURSES_REENTRANT
set_escdelay(1);
#else
ESCDELAY = 1; ESCDELAY = 1;
#endif
/* set btns menu */ /* set btns menu */
curses_menu = new_menu(curses_menu_items); curses_menu = new_menu(curses_menu_items);

View File

@ -604,9 +604,11 @@ void show_scroll_win(WINDOW *main_window,
switch (res) { switch (res) {
case KEY_NPAGE: case KEY_NPAGE:
case ' ': case ' ':
case 'd':
start_y += text_lines-2; start_y += text_lines-2;
break; break;
case KEY_PPAGE: case KEY_PPAGE:
case 'u':
start_y -= text_lines+2; start_y -= text_lines+2;
break; break;
case KEY_HOME: case KEY_HOME:
@ -632,10 +634,10 @@ void show_scroll_win(WINDOW *main_window,
start_x++; start_x++;
break; break;
} }
if (res == 10 || res == 27 || res == 'q' if (res == 10 || res == 27 || res == 'q' ||
|| res == KEY_F(F_BACK) || res == KEY_F(F_EXIT)) { res == KEY_F(F_HELP) || res == KEY_F(F_BACK) ||
res == KEY_F(F_EXIT))
break; break;
}
if (start_y < 0) if (start_y < 0)
start_y = 0; start_y = 0;
if (start_y >= total_lines-text_lines) if (start_y >= total_lines-text_lines)