From a72f3e2b82eb26f43bed1f83beeeb47830918811 Mon Sep 17 00:00:00 2001 From: Nir Tzachar Date: Sun, 8 Aug 2010 16:50:06 +0300 Subject: nconfig: add search support Remove the old hotkeys feature, and replace it by an interactive string search. From nconfig help: Searching: pressing '/' triggers interactive search mode. nconfig performs a case insensitive search for the string in the menu prompts (no regex support). Pressing the up/down keys highlights the previous/next matching item. Backspace removes one character from the match string. Pressing either '/' again or ESC exits search mode. All other keys behave normally. Miscellaneous other changes (including Rundy's and Justin's input). Signed-off-by: Nir Tzachar Acked-by: Sam Ravnborg Signed-off-by: Michal Marek diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 2ba71bc..18a215d 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -5,9 +5,12 @@ * Derived from menuconfig. * */ +#define _GNU_SOURCE +#include #define LKC_DIRECT_LINK #include "lkc.h" #include "nconf.h" +#include static const char nconf_readme[] = N_( "Overview\n" @@ -23,7 +26,7 @@ static const char nconf_readme[] = N_( " < > can be built in, modularized or removed\n" " { } can be built in or modularized (selected by other feature)\n" " - - are selected by other feature,\n" -" XXX cannot be selected. use Symbol Info to find out why,\n" +" XXX cannot be selected. Use Symbol Info to find out why,\n" "while *, M or whitespace inside braces means to build in, build as\n" "a module or to exclude the feature respectively.\n" "\n" @@ -41,9 +44,13 @@ static const char nconf_readme[] = N_( " pressing of . Use or to go back.\n" " Submenus are designated by \"--->\".\n" "\n" -" Shortcut: Press the option's highlighted letter (hotkey).\n" -" Pressing a hotkey more than once will sequence\n" -" through all visible items which use that hotkey.\n" +" Searching: pressing '/' triggers interactive search mode.\n" +" nconfig performs a case insensitive search for the string\n" +" in the menu prompts (no regex support).\n" +" Pressing the up/down keys highlights the previous/next\n" +" matching item. Backspace removes one character from the\n" +" match string. Pressing either '/' again or ESC exits\n" +" search mode. All other keys behave normally.\n" "\n" " You may also use the and keys to scroll\n" " unseen options into view.\n" @@ -141,21 +148,21 @@ menu_no_f_instructions[] = N_( " or selects submenus --->.\n" " Capital Letters are hotkeys.\n" " Pressing includes, excludes, modularizes features.\n" -" Pressing SpaceBar toggles between the above options\n" -" Press or to go back one menu, \n" +" Pressing SpaceBar toggles between the above options.\n" +" Press or to go back one menu,\n" " or for Help, for Search.\n" -" <1> is interchangable with , <2> with , etc.\n" +" <1> is interchangeable with , <2> with , etc.\n" " Legend: [*] built-in [ ] excluded module < > module capable.\n" -" always leaves the current window\n"), +" always leaves the current window.\n"), menu_instructions[] = N_( " Arrow keys navigate the menu.\n" " or selects submenus --->.\n" " Capital Letters are hotkeys.\n" " Pressing includes, excludes, modularizes features.\n" " Pressing SpaceBar toggles between the above options\n" -" Press , or to go back one menu, \n" +" Press , or to go back one menu,\n" " , or for Help, for Search.\n" -" <1> is interchangable with , <2> with , etc.\n" +" <1> is interchangeable with , <2> with , etc.\n" " Legend: [*] built-in [ ] excluded module < > module capable.\n" " always leaves the current window\n"), radiolist_instructions[] = N_( @@ -252,7 +259,6 @@ struct mitem { char str[256]; char tag; void *usrptr; - int is_hot; int is_visible; }; @@ -275,14 +281,6 @@ static int items_num; static int global_exit; /* the currently selected button */ const char *current_instructions = menu_instructions; -/* this array is used to implement hot keys. it is updated in item_make and - * resetted in clean_items. It would be better to use a hash, but lets keep it - * simple... */ -#define MAX_SAME_KEY MAX_MENU_ITEMS -struct { - int count; - int ptrs[MAX_MENU_ITEMS]; -} hotkeys[1<<(sizeof(char)*8)]; static void conf(struct menu *menu); static void conf_choice(struct menu *menu); @@ -292,6 +290,7 @@ static void conf_save(void); static void show_help(struct menu *menu); static int do_exit(void); static void setup_windows(void); +static void search_conf(void); typedef void (*function_key_handler_t)(int *key, struct menu *menu); static void handle_f1(int *key, struct menu *current_item); @@ -302,6 +301,7 @@ static void handle_f5(int *key, struct menu *current_item); static void handle_f6(int *key, struct menu *current_item); static void handle_f7(int *key, struct menu *current_item); static void handle_f8(int *key, struct menu *current_item); +static void handle_f9(int *key, struct menu *current_item); struct function_keys { const char *key_str; @@ -310,7 +310,7 @@ struct function_keys { function_key_handler_t handler; }; -static const int function_keys_num = 8; +static const int function_keys_num = 9; struct function_keys function_keys[] = { { .key_str = "F1", @@ -320,13 +320,13 @@ struct function_keys function_keys[] = { }, { .key_str = "F2", - .func = "Symbol Info", + .func = "Sym Info", .key = F_SYMBOL, .handler = handle_f2, }, { .key_str = "F3", - .func = "Instructions", + .func = "Insts", .key = F_INSTS, .handler = handle_f3, }, @@ -356,9 +356,15 @@ struct function_keys function_keys[] = { }, { .key_str = "F8", + .func = "Sym Search", + .key = F_SEARCH, + .handler = handle_f8, + }, + { + .key_str = "F9", .func = "Exit", .key = F_EXIT, - .handler = handle_f8, + .handler = handle_f9, }, }; @@ -444,9 +450,16 @@ static void handle_f7(int *key, struct menu *current_item) return; } -/* exit */ +/* search */ static void handle_f8(int *key, struct menu *current_item) { + search_conf(); + return; +} + +/* exit */ +static void handle_f9(int *key, struct menu *current_item) +{ do_exit(); return; } @@ -479,110 +492,44 @@ static void clean_items(void) free_item(curses_menu_items[i]); bzero(curses_menu_items, sizeof(curses_menu_items)); bzero(k_menu_items, sizeof(k_menu_items)); - bzero(hotkeys, sizeof(hotkeys)); items_num = 0; } -/* return the index of the next hot item, or -1 if no such item exists */ -static int get_next_hot(int c) -{ - static int hot_index; - static int hot_char; - - if (c < 0 || c > 255 || hotkeys[c].count <= 0) - return -1; - - if (hot_char == c) { - hot_index = (hot_index+1)%hotkeys[c].count; - return hotkeys[c].ptrs[hot_index]; - } else { - hot_char = c; - hot_index = 0; - return hotkeys[c].ptrs[0]; - } -} - -/* can the char c be a hot key? no, if c is a common shortcut used elsewhere */ -static int canbhot(char c) -{ - c = tolower(c); - return isalnum(c) && c != 'y' && c != 'm' && c != 'h' && - c != 'n' && c != '?'; -} - -/* check if str already contains a hot key. */ -static int is_hot(int index) -{ - return k_menu_items[index].is_hot; -} +typedef enum {MATCH_TINKER_PATTERN_UP, MATCH_TINKER_PATTERN_DOWN, + FIND_NEXT_MATCH_DOWN, FIND_NEXT_MATCH_UP} match_f; -/* find the first possible hot key, and mark it. - * index is the index of the item in the menu - * return 0 on success*/ -static int make_hot(char *dest, int len, const char *org, int index) +/* return the index of the matched item, or -1 if no such item exists */ +static int get_mext_match(const char *match_str, match_f flag) { - int position = -1; - int i; - int tmp; - int c; - int org_len = strlen(org); - - if (org == NULL || is_hot(index)) - return 1; - - /* make sure not to make hot keys out of markers. - * find where to start looking for a hot key - */ - i = 0; - /* skip white space */ - while (i < org_len && org[i] == ' ') - i++; - if (i == org_len) - return -1; - /* if encountering '(' or '<' or '[', find the match and look from there - **/ - if (org[i] == '[' || org[i] == '<' || org[i] == '(') { - i++; - for (; i < org_len; i++) - if (org[i] == ']' || org[i] == '>' || org[i] == ')') - break; - } - if (i == org_len) - return -1; - for (; i < org_len; i++) { - if (canbhot(org[i]) && org[i-1] != '<' && org[i-1] != '(') { - position = i; - break; - } + int match_start = item_index(current_item(curses_menu)); + int index; + + if (flag == FIND_NEXT_MATCH_DOWN) + ++match_start; + else if (flag == FIND_NEXT_MATCH_UP) + --match_start; + + index = match_start; + index = (index + items_num) % items_num; + while (true) { + char *str = k_menu_items[index].str; + if (strcasestr(str, match_str) != 0) + return index; + if (flag == FIND_NEXT_MATCH_UP || + flag == MATCH_TINKER_PATTERN_UP) + --index; + else + ++index; + index = (index + items_num) % items_num; + if (index == match_start) + return -1; } - if (position == -1) - return 1; - - /* ok, char at org[position] should be a hot key to this item */ - c = tolower(org[position]); - tmp = hotkeys[c].count; - hotkeys[c].ptrs[tmp] = index; - hotkeys[c].count++; - /* - snprintf(dest, len, "%.*s(%c)%s", position, org, org[position], - &org[position+1]); - */ - /* make org[position] uppercase, and all leading letter small case */ - strncpy(dest, org, len); - for (i = 0; i < position; i++) - dest[i] = tolower(dest[i]); - dest[position] = toupper(dest[position]); - k_menu_items[index].is_hot = 1; - return 0; } -/* Make a new item. Add a hotkey mark in the first possible letter. - * As ncurses does not allow any attributes inside menue item, we mark the - * hot key as the first capitalized letter in the string */ +/* Make a new item. */ static void item_make(struct menu *menu, char tag, const char *fmt, ...) { va_list ap; - char tmp_str[256]; if (items_num > MAX_MENU_ITEMS-1) return; @@ -597,16 +544,13 @@ static void item_make(struct menu *menu, char tag, const char *fmt, ...) k_menu_items[items_num].is_visible = 1; va_start(ap, fmt); - vsnprintf(tmp_str, sizeof(tmp_str), fmt, ap); - if (!k_menu_items[items_num].is_visible) - memcpy(tmp_str, "XXX", 3); + vsnprintf(k_menu_items[items_num].str, + sizeof(k_menu_items[items_num].str), + fmt, ap); va_end(ap); - if (make_hot( - k_menu_items[items_num].str, - sizeof(k_menu_items[items_num].str), tmp_str, items_num) != 0) - strncpy(k_menu_items[items_num].str, - tmp_str, - sizeof(k_menu_items[items_num].str)); + + if (!k_menu_items[items_num].is_visible) + memcpy(k_menu_items[items_num].str, "XXX", 3); curses_menu_items[items_num] = new_item( k_menu_items[items_num].str, @@ -638,11 +582,9 @@ static void item_add_str(const char *fmt, ...) va_end(ap); snprintf(tmp_str, sizeof(tmp_str), "%s%s", k_menu_items[index].str, new_str); - if (make_hot(k_menu_items[index].str, - sizeof(k_menu_items[index].str), tmp_str, index) != 0) - strncpy(k_menu_items[index].str, - tmp_str, - sizeof(k_menu_items[index].str)); + strncpy(k_menu_items[index].str, + tmp_str, + sizeof(k_menu_items[index].str)); free_item(curses_menu_items[index]); curses_menu_items[index] = new_item( @@ -1027,23 +969,18 @@ static void reset_menu(void) static void center_item(int selected_index, int *last_top_row) { int toprow; - int maxy, maxx; - scale_menu(curses_menu, &maxy, &maxx); set_top_row(curses_menu, *last_top_row); toprow = top_row(curses_menu); - if (selected_index >= toprow && selected_index < toprow+maxy) { - /* we can only move the selected item. no need to scroll */ - set_current_item(curses_menu, - curses_menu_items[selected_index]); - } else { - toprow = max(selected_index-maxy/2, 0); - if (toprow >= item_count(curses_menu)-maxy) + if (selected_index < toprow || + selected_index >= toprow+mwin_max_lines) { + toprow = max(selected_index-mwin_max_lines/2, 0); + if (toprow >= item_count(curses_menu)-mwin_max_lines) toprow = item_count(curses_menu)-mwin_max_lines; set_top_row(curses_menu, toprow); - set_current_item(curses_menu, - curses_menu_items[selected_index]); } + set_current_item(curses_menu, + curses_menu_items[selected_index]); *last_top_row = toprow; post_menu(curses_menu); refresh_all_windows(main_window); @@ -1075,7 +1012,7 @@ static void show_menu(const char *prompt, const char *instructions, /* position the menu at the middle of the screen */ scale_menu(curses_menu, &maxy, &maxx); maxx = min(maxx, mwin_max_cols-2); - maxy = mwin_max_lines-2; + maxy = mwin_max_lines; menu_window = derwin(main_window, maxy, maxx, @@ -1099,10 +1036,77 @@ static void show_menu(const char *prompt, const char *instructions, refresh_all_windows(main_window); } +static void adj_match_dir(match_f *match_direction) +{ + if (*match_direction == FIND_NEXT_MATCH_DOWN) + *match_direction = + MATCH_TINKER_PATTERN_DOWN; + else if (*match_direction == FIND_NEXT_MATCH_UP) + *match_direction = + MATCH_TINKER_PATTERN_UP; + /* else, do no change.. */ +} -static void conf(struct menu *menu) +struct match_state { + int in_search; + match_f match_direction; char pattern[256]; +}; + +/* Return 0 means I have handled the key. In such a case, ans should hold the + * item to center, or -1 otherwise. + * Else return -1 . + */ +static int do_match(int key, struct match_state *state, int *ans) +{ + char c = (char) key; + int terminate_search = 0; + *ans = -1; + if (key == '/' || (state->in_search && key == 27)) { + move(0, 0); + refresh(); + clrtoeol(); + state->in_search = 1-state->in_search; + bzero(state->pattern, sizeof(state->pattern)); + state->match_direction = MATCH_TINKER_PATTERN_DOWN; + return 0; + } else if (!state->in_search) + return 1; + + if (isalnum(c) || isgraph(c) || c == ' ') { + state->pattern[strlen(state->pattern)] = c; + state->pattern[strlen(state->pattern)] = '\0'; + adj_match_dir(&state->match_direction); + *ans = get_mext_match(state->pattern, + state->match_direction); + } else if (key == KEY_DOWN) { + state->match_direction = FIND_NEXT_MATCH_DOWN; + *ans = get_mext_match(state->pattern, + state->match_direction); + } else if (key == KEY_UP) { + state->match_direction = FIND_NEXT_MATCH_UP; + *ans = get_mext_match(state->pattern, + state->match_direction); + } else if (key == KEY_BACKSPACE || key == 127) { + state->pattern[strlen(state->pattern)-1] = '\0'; + adj_match_dir(&state->match_direction); + } else + terminate_search = 1; + + if (terminate_search) { + state->in_search = 0; + bzero(state->pattern, sizeof(state->pattern)); + move(0, 0); + refresh(); + clrtoeol(); + return -1; + } + return 0; +} + +static void conf(struct menu *menu) +{ struct menu *submenu = 0; const char *prompt = menu_get_prompt(menu); struct symbol *sym; @@ -1110,8 +1114,11 @@ static void conf(struct menu *menu) int res; int current_index = 0; int last_top_row = 0; - - bzero(pattern, sizeof(pattern)); + struct match_state match_state = { + .in_search = 0, + .match_direction = MATCH_TINKER_PATTERN_DOWN, + .pattern = "", + }; while (!global_exit) { reset_menu(); @@ -1124,7 +1131,22 @@ static void conf(struct menu *menu) _(menu_instructions), current_index, &last_top_row); keypad((menu_win(curses_menu)), TRUE); - while (!global_exit && (res = wgetch(menu_win(curses_menu)))) { + while (!global_exit) { + if (match_state.in_search) { + mvprintw(0, 0, + "searching: %s", match_state.pattern); + clrtoeol(); + } + refresh_all_windows(main_window); + res = wgetch(menu_win(curses_menu)); + if (!res) + break; + if (do_match(res, &match_state, ¤t_index) == 0) { + if (current_index != -1) + center_item(current_index, + &last_top_row); + continue; + } if (process_special_keys(&res, (struct menu *) item_data())) break; @@ -1155,19 +1177,13 @@ static void conf(struct menu *menu) if (res == 10 || res == 27 || res == 32 || res == 'n' || res == 'y' || res == KEY_LEFT || res == KEY_RIGHT || - res == 'm' || res == '/') + res == 'm') break; - else if (canbhot(res)) { - /* check for hot keys: */ - int tmp = get_next_hot(res); - if (tmp != -1) - center_item(tmp, &last_top_row); - } refresh_all_windows(main_window); } refresh_all_windows(main_window); - /* if ESC or left*/ + /* if ESC or left*/ if (res == 27 || (menu != &rootmenu && res == KEY_LEFT)) break; @@ -1235,9 +1251,6 @@ static void conf(struct menu *menu) if (item_is_tag('t')) sym_set_tristate_value(sym, mod); break; - case '/': - search_conf(); - break; } } } @@ -1268,6 +1281,11 @@ static void conf_choice(struct menu *menu) int selected_index = 0; int last_top_row = 0; int res, i = 0; + struct match_state match_state = { + .in_search = 0, + .match_direction = MATCH_TINKER_PATTERN_DOWN, + .pattern = "", + }; active = sym_get_choice_value(menu->sym); /* this is mostly duplicated from the conf() function. */ @@ -1294,7 +1312,22 @@ static void conf_choice(struct menu *menu) _(radiolist_instructions), selected_index, &last_top_row); - while (!global_exit && (res = wgetch(menu_win(curses_menu)))) { + while (!global_exit) { + if (match_state.in_search) { + mvprintw(0, 0, "searching: %s", + match_state.pattern); + clrtoeol(); + } + refresh_all_windows(main_window); + res = wgetch(menu_win(curses_menu)); + if (!res) + break; + if (do_match(res, &match_state, &selected_index) == 0) { + if (selected_index != -1) + center_item(selected_index, + &last_top_row); + continue; + } if (process_special_keys( &res, (struct menu *) item_data())) @@ -1324,13 +1357,8 @@ static void conf_choice(struct menu *menu) break; } if (res == 10 || res == 27 || res == ' ' || - res == KEY_LEFT) + res == KEY_LEFT){ break; - else if (canbhot(res)) { - /* check for hot keys: */ - int tmp = get_next_hot(res); - if (tmp != -1) - center_item(tmp, &last_top_row); } refresh_all_windows(main_window); } @@ -1485,7 +1513,7 @@ void setup_windows(void) /* set up the menu and menu window */ main_window = newwin(LINES-2, COLS-2, 2, 1); keypad(main_window, TRUE); - mwin_max_lines = LINES-6; + mwin_max_lines = LINES-7; mwin_max_cols = COLS-6; /* panels order is from bottom to top */ @@ -1532,9 +1560,10 @@ int main(int ac, char **av) /* set btns menu */ curses_menu = new_menu(curses_menu_items); menu_opts_off(curses_menu, O_SHOWDESC); - menu_opts_off(curses_menu, O_SHOWMATCH); + menu_opts_on(curses_menu, O_SHOWMATCH); menu_opts_on(curses_menu, O_ONEVALUE); menu_opts_on(curses_menu, O_NONCYCLIC); + menu_opts_on(curses_menu, O_IGNORECASE); set_menu_mark(curses_menu, " "); set_menu_fore(curses_menu, attributes[MAIN_MENU_FORE]); set_menu_back(curses_menu, attributes[MAIN_MENU_BACK]); @@ -1550,8 +1579,6 @@ int main(int ac, char **av) _(menu_no_f_instructions)); } - - /* do the work */ while (!global_exit) { conf(&rootmenu); diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c index a9d9344..d963071 100644 --- a/scripts/kconfig/nconf.gui.c +++ b/scripts/kconfig/nconf.gui.c @@ -167,7 +167,7 @@ void print_in_middle(WINDOW *win, length = strlen(string); temp = (width - length) / 2; x = startx + (int)temp; - wattrset(win, color); + (void) wattrset(win, color); mvwprintw(win, y, x, "%s", string); refresh(); } @@ -297,11 +297,11 @@ int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...) set_menu_fore(menu, attributes[DIALOG_MENU_FORE]); set_menu_back(menu, attributes[DIALOG_MENU_BACK]); - wattrset(win, attributes[DIALOG_BOX]); + (void) wattrset(win, attributes[DIALOG_BOX]); box(win, 0, 0); /* print message */ - wattrset(msg_win, attributes[DIALOG_TEXT]); + (void) wattrset(msg_win, attributes[DIALOG_TEXT]); fill_window(msg_win, msg); set_menu_win(menu, win); @@ -392,16 +392,16 @@ int dialog_inputbox(WINDOW *main_window, form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2); keypad(form_win, TRUE); - wattrset(form_win, attributes[INPUT_FIELD]); + (void) wattrset(form_win, attributes[INPUT_FIELD]); - wattrset(win, attributes[INPUT_BOX]); + (void) wattrset(win, attributes[INPUT_BOX]); box(win, 0, 0); - wattrset(win, attributes[INPUT_HEADING]); + (void) wattrset(win, attributes[INPUT_HEADING]); if (title) mvwprintw(win, 0, 3, "%s", title); /* print message */ - wattrset(prompt_win, attributes[INPUT_TEXT]); + (void) wattrset(prompt_win, attributes[INPUT_TEXT]); fill_window(prompt_win, prompt); mvwprintw(form_win, 0, 0, "%*s", prompt_width, " "); @@ -531,7 +531,7 @@ void show_scroll_win(WINDOW *main_window, /* create the pad */ pad = newpad(total_lines+10, total_cols+10); - wattrset(pad, attributes[SCROLLWIN_TEXT]); + (void) wattrset(pad, attributes[SCROLLWIN_TEXT]); fill_window(pad, text); win_lines = min(total_lines+4, LINES-2); @@ -546,9 +546,9 @@ void show_scroll_win(WINDOW *main_window, win = newwin(win_lines, win_cols, y, x); keypad(win, TRUE); /* show the help in the help window, and show the help panel */ - wattrset(win, attributes[SCROLLWIN_BOX]); + (void) wattrset(win, attributes[SCROLLWIN_BOX]); box(win, 0, 0); - wattrset(win, attributes[SCROLLWIN_HEADING]); + (void) wattrset(win, attributes[SCROLLWIN_HEADING]); mvwprintw(win, 0, 3, " %s ", title); panel = new_panel(win); diff --git a/scripts/kconfig/nconf.h b/scripts/kconfig/nconf.h index fb42966..58fbda8 100644 --- a/scripts/kconfig/nconf.h +++ b/scripts/kconfig/nconf.h @@ -69,7 +69,8 @@ typedef enum { F_BACK = 5, F_SAVE = 6, F_LOAD = 7, - F_EXIT = 8 + F_SEARCH = 8, + F_EXIT = 9, } function_key; void set_colors(void); -- cgit v0.10.2 From 94bedeca77bf79a81952ed4c3abb8c1cce4c85dd Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Tue, 17 Aug 2010 01:40:20 -0400 Subject: kbuild: confdata.c explicitly reference errno, thus need This fixes: % gmake LKC_GENPARSER=1 menuconfig [...] scripts/kconfig/confdata.c:739: error: 'errno' undeclared (first use in this function) scripts/kconfig/confdata.c:739: error: (Each undeclared identifier is reported only once scripts/kconfig/confdata.c:739: error: for each function it appears in.) scripts/kconfig/confdata.c:739: error: 'ENOENT' undeclared (first use in this function) triggered on NetBSD. Signed-off-by: Arnaud Lacombe Signed-off-by: Michal Marek diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 515253f..dc11d51 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include -- cgit v0.10.2 From 42368c37fbd51f7b478d041ae55c5df000897158 Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Tue, 17 Aug 2010 10:21:19 +0200 Subject: kconfig: Allow frontends to display messages themselves Signed-off-by: Michal Marek diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index dc11d51..c07060a 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -19,6 +19,9 @@ static void conf_warning(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); +static void conf_message(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); + static const char *conf_filename; static int conf_lineno, conf_warnings, conf_unsaved; @@ -35,6 +38,29 @@ static void conf_warning(const char *fmt, ...) conf_warnings++; } +static void conf_default_message_callback(const char *fmt, va_list ap) +{ + printf("#\n# "); + vprintf(fmt, ap); + printf("\n#\n"); +} + +static void (*conf_message_callback) (const char *fmt, va_list ap) = + conf_default_message_callback; +void conf_set_message_callback(void (*fn) (const char *fmt, va_list ap)) +{ + conf_message_callback = fn; +} + +static void conf_message(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + if (conf_message_callback) + conf_message_callback(fmt, ap); +} + const char *conf_get_configname(void) { char *name = getenv("KCONFIG_CONFIG"); @@ -184,9 +210,8 @@ int conf_read_simple(const char *name, int def) name = conf_expand_value(prop->expr->left.sym->name); in = zconf_fopen(name); if (in) { - printf(_("#\n" - "# using defaults found in %s\n" - "#\n"), name); + conf_message(_("using defaults found in %s"), + name); goto load; } } @@ -651,9 +676,7 @@ next: return 1; } - printf(_("#\n" - "# configuration written to %s\n" - "#\n"), newname); + conf_message(_("configuration written to %s"), newname); sym_set_change_count(0); diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index 9a948c9..481d484 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h @@ -1,3 +1,4 @@ +#include /* confdata.c */ P(conf_parse,void,(const char *name)); @@ -8,6 +9,7 @@ P(conf_write,int,(const char *name)); P(conf_write_autoconf,int,(void)); P(conf_get_changed,bool,(void)); P(conf_set_changed_callback, void,(void (*fn)(void))); +P(conf_set_message_callback, void,(void (*fn)(const char *fmt, va_list ap))); /* menu.c */ P(rootmenu,struct menu,); diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 18a215d..16233a9 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -651,25 +651,6 @@ static const char *set_config_filename(const char *config_filename) return menu_backtitle; } -/* command = 0 is supress, 1 is restore */ -static void supress_stdout(int command) -{ - static FILE *org_stdout; - static FILE *org_stderr; - - if (command == 0) { - org_stdout = stdout; - org_stderr = stderr; - stdout = fopen("/dev/null", "a"); - stderr = fopen("/dev/null", "a"); - } else { - fclose(stdout); - fclose(stderr); - stdout = org_stdout; - stderr = org_stderr; - } -} - /* return = 0 means we are successful. * -1 means go on doing what you were doing */ @@ -695,9 +676,7 @@ static int do_exit(void) /* if we got here, the user really wants to exit */ switch (res) { case 0: - supress_stdout(0); res = conf_write(filename); - supress_stdout(1); if (res) btn_dialog( main_window, @@ -707,19 +686,6 @@ static int do_exit(void) "changes were NOT saved."), 1, ""); - else { - char buf[1024]; - snprintf(buf, 1024, - _("Configuration written to %s\n" - "End of Linux kernel configuration.\n" - "Execute 'make' to build the kernel or try" - " 'make help'."), filename); - btn_dialog( - main_window, - buf, - 1, - ""); - } break; default: btn_dialog( @@ -1255,6 +1221,14 @@ static void conf(struct menu *menu) } } +static void conf_message_callback(const char *fmt, va_list ap) +{ + char buf[1024]; + + vsnprintf(buf, sizeof(buf), fmt, ap); + btn_dialog(main_window, buf, 1, ""); +} + static void show_help(struct menu *menu) { struct gstr help = str_new(); @@ -1477,16 +1451,8 @@ static void conf_save(void) case 0: if (!dialog_input_result[0]) return; - supress_stdout(0); res = conf_write(dialog_input_result); - supress_stdout(1); if (!res) { - char buf[1024]; - sprintf(buf, "%s %s", - _("configuration file saved to: "), - dialog_input_result); - btn_dialog(main_window, - buf, 1, ""); set_config_filename(dialog_input_result); return; } @@ -1579,6 +1545,7 @@ int main(int ac, char **av) _(menu_no_f_instructions)); } + conf_set_message_callback(conf_message_callback); /* do the work */ while (!global_exit) { conf(&rootmenu); -- cgit v0.10.2 From 7080e47bb2783c04982526068204c1c8fc2c4c38 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Mon, 16 Aug 2010 00:19:04 -0400 Subject: kbuild: don't include `check-lxdialog' ldflags in global HOST_LOADLIBES On BSD systems, `check-lxdialog' would select -lcurses as the default curses library which would conflict with -lncurses at runtime: curses' compatible symbols are getting handled by the system's curses library while the ncurses-specific symbols are getting handled by the ports' ncurses. This fixes `nconf' segmentation fault on these systems. Signed-off-by: Arnaud Lacombe Signed-off-by: Michal Marek diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index de934de..7522a8b 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -146,7 +146,6 @@ check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh # Use recursively expanded variables so we do not call gcc unless # we really need to do so. (Do not call gcc as part of make mrproper) HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) -HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) HOST_EXTRACFLAGS += -DLOCALE @@ -208,7 +207,7 @@ clean-files += config.pot linux.pot PHONY += $(obj)/dochecklxdialog $(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog $(obj)/dochecklxdialog: - $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES) + $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf) always := dochecklxdialog @@ -226,6 +225,8 @@ HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` -ldl HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ -D LKC_DIRECT_LINK +HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) + HOSTLOADLIBES_nconf = -lmenu -lpanel -lncurses $(obj)/qconf.o: $(obj)/.tmp_qtcheck -- cgit v0.10.2 From c24035b9edad6164ddc12e88444acea741d5e309 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Mon, 16 Aug 2010 00:19:06 -0400 Subject: kbuild: fix typo Signed-off-by: Arnaud Lacombe Signed-off-by: Michal Marek diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c index d963071..f8137b3 100644 --- a/scripts/kconfig/nconf.gui.c +++ b/scripts/kconfig/nconf.gui.c @@ -137,7 +137,7 @@ void set_colors() if (has_colors()) { normal_color_theme(); } else { - /* give deafults */ + /* give defaults */ no_colors_theme(); } } -- cgit v0.10.2 From 9ba9568259f71bc848ac460bc616ce9640634693 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Sun, 22 Aug 2010 20:03:06 -0400 Subject: kbuild: don't overwrite HOST_EXTRACFLAGS This might be used by the user to specify extra arguments for the host compiler. Signed-off-by: Arnaud Lacombe Signed-off-by: Michal Marek diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 7522a8b..06c1c2f 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -145,10 +145,8 @@ check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh # Use recursively expanded variables so we do not call gcc unless # we really need to do so. (Do not call gcc as part of make mrproper) -HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) - -HOST_EXTRACFLAGS += -DLOCALE - +HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ + -DLOCALE # =========================================================================== # Shared Makefile for the various kconfig executables: -- cgit v0.10.2 From c94d3fb01fb6db1899cdf53ea4eb9d38e08a08fe Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Mon, 23 Aug 2010 12:01:24 -0400 Subject: kbuild: use getopt_long(), not its _only() variant NetBSD lacks getopt_long_only() whereas getopt_long() works just fine. Signed-off-by: Arnaud Lacombe Acked-by: Sam Ravnborg Signed-off-by: Michal Marek diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 4f0ed5b..4b3ad9b8 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -466,7 +466,7 @@ int main(int ac, char **av) bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); - while ((opt = getopt_long_only(ac, av, "", long_opts, NULL)) != -1) { + while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) { input_mode = (enum input_mode)opt; switch (opt) { case silentoldconfig: -- cgit v0.10.2 From 133c5f7c10e4552ba41bcf03b9bda6c4e3413804 Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Tue, 31 Aug 2010 17:34:37 +0200 Subject: kconfig qconf: port to QT4 A straight forward port to QT4 using qt3to4 and compiling against qt3support * Use pkg-config to detect QT4 which is hopefully portable enough * If no QT4, QT3 will by tried instead * Classes renamed using qt3to4 * If build using QT3 renamed to QT3 class names using defines * ConfigInfoView::menu has to be renamed as QT4 moc strips struct from struct menu and creates a name conflict * QT2 support has been dropped * The hidden options inserted in 39a4897c1bb66e8a36043c105d7fd73d8b32b480 are use in native API Signed-off-by: Alexander Stein Signed-off-by: Michal Marek diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 06c1c2f..cef3f75 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -235,40 +235,50 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile # QT needs some extra effort... $(obj)/.tmp_qtcheck: @set -e; echo " CHECK qt"; dir=""; pkg=""; \ - pkg-config --exists qt 2> /dev/null && pkg=qt; \ - pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ - if [ -n "$$pkg" ]; then \ - cflags="\$$(shell pkg-config $$pkg --cflags)"; \ - libs="\$$(shell pkg-config $$pkg --libs)"; \ - moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ - dir="$$(pkg-config $$pkg --variable=prefix)"; \ + if ! pkg-config --exists QtCore 2> /dev/null; then \ + echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \ + pkg-config --exists qt 2> /dev/null && pkg=qt; \ + pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ + if [ -n "$$pkg" ]; then \ + cflags="\$$(shell pkg-config $$pkg --cflags)"; \ + libs="\$$(shell pkg-config $$pkg --libs)"; \ + moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ + dir="$$(pkg-config $$pkg --variable=prefix)"; \ + else \ + for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ + 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 "*"; \ + false; \ + fi; \ + libpath=$$dir/lib; lib=qt; osdir=""; \ + $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ + osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ + test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ + test -f $$libpath/libqt-mt.so && lib=qt-mt; \ + cflags="-I$$dir/include"; \ + libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ + moc="$$dir/bin/moc"; \ + fi; \ + if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ + echo "*"; \ + echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ + echo "*"; \ + moc="/usr/bin/moc"; \ + fi; \ else \ - for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ - if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ - done; \ - if [ -z "$$dir" ]; then \ - echo "*"; \ - echo "* Unable to find the QT3 installation. Please make sure that"; \ - echo "* the QT3 development package is correctly installed and"; \ - echo "* either install pkg-config or set the QTDIR environment"; \ - echo "* variable to the correct location."; \ - echo "*"; \ - false; \ - fi; \ - libpath=$$dir/lib; lib=qt; osdir=""; \ - $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ - osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ - test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ - test -f $$libpath/libqt-mt.so && lib=qt-mt; \ - cflags="-I$$dir/include"; \ - libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ - moc="$$dir/bin/moc"; \ - fi; \ - if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ - echo "*"; \ - echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ - echo "*"; \ - moc="/usr/bin/moc"; \ + headerpath="\$$(shell qmake -query QT_INSTALL_HEADERS)"; \ + libpath="\$$(shell qmake -query QT_INSTALL_LIBS)"; \ + binpath="\$$(shell qmake -query QT_INSTALL_BINS)"; \ + cflags="-I$$headerpath -I$$headerpath/QtCore -I$$headerpath/QtGui -I$$headerpath/Qt3Support -DQT3_SUPPORT"; \ + libs="-L$$libpath -Wl,-rpath,$$libpath -lQtCore -lQtGui -lQt3Support"; \ + moc="$$binpath/moc"; \ fi; \ echo "KC_QT_CFLAGS=$$cflags" > $@; \ echo "KC_QT_LIBS=$$libs" >> $@; \ diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 820df2d..88d3874 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -3,25 +3,42 @@ * Released under the terms of the GNU GPL v2.0. */ -#include +#include + +#if QT_VERSION < 0x040000 #include +#include +#include +#include +#include +#include +#include +#include +#include +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#include #include #include #include -#include #include -#include -#include #include #include #include #include #include -#include -#include -#include -#include #include +#include #include @@ -39,7 +56,7 @@ static QApplication *configApp; static ConfigSettings *configSettings; -QAction *ConfigMainWindow::saveAction; +Q3Action *ConfigMainWindow::saveAction; static inline QString qgettext(const char* str) { @@ -54,9 +71,9 @@ static inline QString qgettext(const QString& str) /** * Reads a list of integer values from the application settings. */ -QValueList ConfigSettings::readSizes(const QString& key, bool *ok) +Q3ValueList ConfigSettings::readSizes(const QString& key, bool *ok) { - QValueList result; + Q3ValueList result; QStringList entryList = readListEntry(key, ok); QStringList::Iterator it; @@ -69,10 +86,10 @@ QValueList ConfigSettings::readSizes(const QString& key, bool *ok) /** * Writes a list of integer values to the application settings. */ -bool ConfigSettings::writeSizes(const QString& key, const QValueList& value) +bool ConfigSettings::writeSizes(const QString& key, const Q3ValueList& value) { QStringList stringList; - QValueList::ConstIterator it; + Q3ValueList::ConstIterator it; for (it = value.begin(); it != value.end(); ++it) stringList.push_back(QString::number(*it)); @@ -80,7 +97,6 @@ bool ConfigSettings::writeSizes(const QString& key, const QValueList& value } -#if QT_VERSION >= 300 /* * set the new data * TODO check the value @@ -91,7 +107,6 @@ void ConfigItem::okRename(int col) sym_set_string_value(menu->sym, text(dataColIdx).latin1()); listView()->updateList(this); } -#endif /* * update the displayed of a menu entry @@ -195,11 +210,9 @@ void ConfigItem::updateMenu(void) data = sym_get_string_value(sym); -#if QT_VERSION >= 300 int i = list->mapIdx(dataColIdx); if (i >= 0) setRenameEnabled(i, TRUE); -#endif setText(dataColIdx, data); if (type == S_STRING) prompt = QString("%1: %2").arg(prompt).arg(data); @@ -432,7 +445,7 @@ void ConfigList::updateList(ConfigItem* item) if (!rootEntry) { if (mode != listMode) goto update; - QListViewItemIterator it(this); + Q3ListViewItemIterator it(this); ConfigItem* item; for (; it.current(); ++it) { @@ -527,11 +540,9 @@ void ConfigList::changeValue(ConfigItem* item) case S_INT: case S_HEX: case S_STRING: -#if QT_VERSION >= 300 if (colMap[dataColIdx] >= 0) item->startRename(colMap[dataColIdx]); else -#endif parent()->lineEdit->show(item); break; } @@ -563,7 +574,7 @@ void ConfigList::setParentMenu(void) return; setRootMenu(menu_get_parent_menu(rootEntry->parent)); - QListViewItemIterator it(this); + Q3ListViewItemIterator it(this); for (; (item = (ConfigItem*)it.current()); it++) { if (item->menu == oldroot) { setCurrentItem(item); @@ -645,7 +656,7 @@ void ConfigList::updateMenuList(P* parent, struct menu* menu) void ConfigList::keyPressEvent(QKeyEvent* ev) { - QListViewItem* i = currentItem(); + Q3ListViewItem* i = currentItem(); ConfigItem* item; struct menu *menu; enum prop_type type; @@ -811,10 +822,10 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) { if (e->y() <= header()->geometry().bottom()) { if (!headerPopup) { - QAction *action; + Q3Action *action; - headerPopup = new QPopupMenu(this); - action = new QAction(NULL, _("Show Name"), 0, this); + headerPopup = new Q3PopupMenu(this); + action = new Q3Action(NULL, _("Show Name"), 0, this); action->setToggleAction(TRUE); connect(action, SIGNAL(toggled(bool)), parent(), SLOT(setShowName(bool))); @@ -822,7 +833,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) action, SLOT(setOn(bool))); action->setOn(showName); action->addTo(headerPopup); - action = new QAction(NULL, _("Show Range"), 0, this); + action = new Q3Action(NULL, _("Show Range"), 0, this); action->setToggleAction(TRUE); connect(action, SIGNAL(toggled(bool)), parent(), SLOT(setShowRange(bool))); @@ -830,7 +841,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) action, SLOT(setOn(bool))); action->setOn(showRange); action->addTo(headerPopup); - action = new QAction(NULL, _("Show Data"), 0, this); + action = new Q3Action(NULL, _("Show Data"), 0, this); action->setToggleAction(TRUE); connect(action, SIGNAL(toggled(bool)), parent(), SLOT(setShowData(bool))); @@ -914,7 +925,7 @@ void ConfigView::setShowData(bool b) void ConfigList::setAllOpen(bool open) { - QListViewItemIterator it(this); + Q3ListViewItemIterator it(this); for (; it.current(); it++) it.current()->setOpen(open); @@ -937,7 +948,7 @@ void ConfigView::updateListAll(void) } ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) - : Parent(parent, name), sym(0), menu(0) + : Parent(parent, name), sym(0), _menu(0) { if (name) { configSettings->beginGroup(name); @@ -960,7 +971,7 @@ void ConfigInfoView::setShowDebug(bool b) { if (_showDebug != b) { _showDebug = b; - if (menu) + if (_menu) menuInfo(); else if (sym) symbolInfo(); @@ -970,11 +981,11 @@ void ConfigInfoView::setShowDebug(bool b) void ConfigInfoView::setInfo(struct menu *m) { - if (menu == m) + if (_menu == m) return; - menu = m; + _menu = m; sym = NULL; - if (!menu) + if (!_menu) clear(); else menuInfo(); @@ -1001,11 +1012,11 @@ void ConfigInfoView::menuInfo(void) struct symbol* sym; QString head, debug, help; - sym = menu->sym; + sym = _menu->sym; if (sym) { - if (menu->prompt) { + if (_menu->prompt) { head += ""; - head += print_filter(_(menu->prompt->text)); + head += print_filter(_(_menu->prompt->text)); head += ""; if (sym->name) { head += " ("; @@ -1031,23 +1042,23 @@ void ConfigInfoView::menuInfo(void) debug = debug_info(sym); struct gstr help_gstr = str_new(); - menu_get_ext_help(menu, &help_gstr); + menu_get_ext_help(_menu, &help_gstr); help = print_filter(str_get(&help_gstr)); str_free(&help_gstr); - } else if (menu->prompt) { + } else if (_menu->prompt) { head += ""; - head += print_filter(_(menu->prompt->text)); + head += print_filter(_(_menu->prompt->text)); head += "

"; if (showDebug()) { - if (menu->prompt->visible.expr) { + if (_menu->prompt->visible.expr) { debug += "  dep: "; - expr_print(menu->prompt->visible.expr, expr_print_help, &debug, E_NONE); + expr_print(_menu->prompt->visible.expr, expr_print_help, &debug, E_NONE); debug += "

"; } } } if (showDebug()) - debug += QString().sprintf("defined at %s:%d

", menu->file->name, menu->lineno); + debug += QString().sprintf("defined at %s:%d

", _menu->file->name, _menu->lineno); setText(head + debug + help); } @@ -1150,10 +1161,10 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char *text += str2; } -QPopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos) +Q3PopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos) { - QPopupMenu* popup = Parent::createPopupMenu(pos); - QAction* action = new QAction(NULL, _("Show Debug Info"), 0, popup); + Q3PopupMenu* popup = Parent::createPopupMenu(pos); + Q3Action* action = new Q3Action(NULL, _("Show Debug Info"), 0, popup); action->setToggleAction(TRUE); connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool))); connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool))); @@ -1210,7 +1221,7 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam y = configSettings->readNumEntry("/window y", 0, &ok); if (ok) move(x, y); - QValueList sizes = configSettings->readSizes("/split", &ok); + Q3ValueList sizes = configSettings->readSizes("/split", &ok); if (ok) split->setSizes(sizes); configSettings->endGroup(); @@ -1297,42 +1308,42 @@ ConfigMainWindow::ConfigMainWindow(void) configList->setFocus(); menu = menuBar(); - toolBar = new QToolBar("Tools", this); + toolBar = new Q3ToolBar("Tools", this); - backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this); + backAction = new Q3Action("Back", QPixmap(xpm_back), _("Back"), 0, this); connect(backAction, SIGNAL(activated()), SLOT(goBack())); backAction->setEnabled(FALSE); - QAction *quitAction = new QAction("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this); + Q3Action *quitAction = new Q3Action("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this); connect(quitAction, SIGNAL(activated()), SLOT(close())); - QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this); + Q3Action *loadAction = new Q3Action("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this); connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); - saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this); + saveAction = new Q3Action("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this); connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); conf_set_changed_callback(conf_changed); // Set saveAction's initial state conf_changed(); - QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this); + Q3Action *saveAsAction = new Q3Action("Save As...", _("Save &As..."), 0, this); connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); - QAction *searchAction = new QAction("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this); + Q3Action *searchAction = new Q3Action("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this); connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); - QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); + Q3Action *singleViewAction = new Q3Action("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); - QAction *splitViewAction = new QAction("Split View", QPixmap(xpm_split_view), _("Split View"), 0, this); + Q3Action *splitViewAction = new Q3Action("Split View", QPixmap(xpm_split_view), _("Split View"), 0, this); connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView())); - QAction *fullViewAction = new QAction("Full View", QPixmap(xpm_tree_view), _("Full View"), 0, this); + Q3Action *fullViewAction = new Q3Action("Full View", QPixmap(xpm_tree_view), _("Full View"), 0, this); connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView())); - QAction *showNameAction = new QAction(NULL, _("Show Name"), 0, this); + Q3Action *showNameAction = new Q3Action(NULL, _("Show Name"), 0, this); showNameAction->setToggleAction(TRUE); connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool))); connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool))); showNameAction->setOn(configView->showName()); - QAction *showRangeAction = new QAction(NULL, _("Show Range"), 0, this); + Q3Action *showRangeAction = new Q3Action(NULL, _("Show Range"), 0, this); showRangeAction->setToggleAction(TRUE); connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool))); connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool))); showRangeAction->setOn(configList->showRange); - QAction *showDataAction = new QAction(NULL, _("Show Data"), 0, this); + Q3Action *showDataAction = new Q3Action(NULL, _("Show Data"), 0, this); showDataAction->setToggleAction(TRUE); connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool))); connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool))); @@ -1345,9 +1356,15 @@ ConfigMainWindow::ConfigMainWindow(void) connect(optGroup, SIGNAL(selected(QAction *)), menuView, SLOT(setOptionMode(QAction *))); - configView->showNormalAction = new QAction(NULL, _("Show Normal Options"), 0, optGroup); - configView->showAllAction = new QAction(NULL, _("Show All Options"), 0, optGroup); - configView->showPromptAction = new QAction(NULL, _("Show Prompt Options"), 0, optGroup); +#if QT_VERSION >= 0x040000 + configView->showNormalAction = new QAction(_("Show Normal Options"), optGroup); + configView->showAllAction = new QAction(_("Show All Options"), optGroup); + configView->showPromptAction = new QAction(_("Show Prompt Options"), optGroup); +#else + configView->showNormalAction = new QAction(_("Show Normal Options"), 0, optGroup); + configView->showAllAction = new QAction(_("Show All Options"), 0, optGroup); + configView->showPromptAction = new QAction(_("Show Prompt Options"), 0, optGroup); +#endif configView->showNormalAction->setToggleAction(TRUE); configView->showNormalAction->setOn(configList->optMode == normalOpt); configView->showAllAction->setToggleAction(TRUE); @@ -1355,15 +1372,15 @@ ConfigMainWindow::ConfigMainWindow(void) configView->showPromptAction->setToggleAction(TRUE); configView->showPromptAction->setOn(configList->optMode == promptOpt); - QAction *showDebugAction = new QAction(NULL, _("Show Debug Info"), 0, this); + Q3Action *showDebugAction = new Q3Action(NULL, _("Show Debug Info"), 0, this); showDebugAction->setToggleAction(TRUE); connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool))); connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool))); showDebugAction->setOn(helpText->showDebug()); - QAction *showIntroAction = new QAction(NULL, _("Introduction"), 0, this); + Q3Action *showIntroAction = new Q3Action(NULL, _("Introduction"), 0, this); connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro())); - QAction *showAboutAction = new QAction(NULL, _("About"), 0, this); + Q3Action *showAboutAction = new Q3Action(NULL, _("About"), 0, this); connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout())); // init tool bar @@ -1377,7 +1394,7 @@ ConfigMainWindow::ConfigMainWindow(void) fullViewAction->addTo(toolBar); // create config menu - QPopupMenu* config = new QPopupMenu(this); + Q3PopupMenu* config = new Q3PopupMenu(this); menu->insertItem(_("&File"), config); loadAction->addTo(config); saveAction->addTo(config); @@ -1386,12 +1403,12 @@ ConfigMainWindow::ConfigMainWindow(void) quitAction->addTo(config); // create edit menu - QPopupMenu* editMenu = new QPopupMenu(this); + Q3PopupMenu* editMenu = new Q3PopupMenu(this); menu->insertItem(_("&Edit"), editMenu); searchAction->addTo(editMenu); // create options menu - QPopupMenu* optionMenu = new QPopupMenu(this); + Q3PopupMenu* optionMenu = new Q3PopupMenu(this); menu->insertItem(_("&Option"), optionMenu); showNameAction->addTo(optionMenu); showRangeAction->addTo(optionMenu); @@ -1399,10 +1416,9 @@ ConfigMainWindow::ConfigMainWindow(void) optionMenu->insertSeparator(); optGroup->addTo(optionMenu); optionMenu->insertSeparator(); - showDebugAction->addTo(optionMenu); // create help menu - QPopupMenu* helpMenu = new QPopupMenu(this); + Q3PopupMenu* helpMenu = new Q3PopupMenu(this); menu->insertSeparator(); menu->insertItem(_("&Help"), helpMenu); showIntroAction->addTo(helpMenu); @@ -1437,7 +1453,7 @@ ConfigMainWindow::ConfigMainWindow(void) showSplitView(); // UI setup done, restore splitter positions - QValueList sizes = configSettings->readSizes("/split1", &ok); + Q3ValueList sizes = configSettings->readSizes("/split1", &ok); if (ok) split1->setSizes(sizes); @@ -1448,7 +1464,7 @@ ConfigMainWindow::ConfigMainWindow(void) void ConfigMainWindow::loadConfig(void) { - QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this); + QString s = Q3FileDialog::getOpenFileName(conf_get_configname(), NULL, this); if (s.isNull()) return; if (conf_read(QFile::encodeName(s))) @@ -1464,7 +1480,7 @@ void ConfigMainWindow::saveConfig(void) void ConfigMainWindow::saveConfigAs(void) { - QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this); + QString s = Q3FileDialog::getSaveFileName(conf_get_configname(), NULL, this); if (s.isNull()) return; if (conf_write(QFile::encodeName(s))) diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index 636a74b..91677d9 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h @@ -3,26 +3,25 @@ * Released under the terms of the GNU GPL v2.0. */ +#if QT_VERSION < 0x040000 #include -#if QT_VERSION >= 300 -#include #else -class QSettings { -public: - void beginGroup(const QString& group) { } - void endGroup(void) { } - bool readBoolEntry(const QString& key, bool def = FALSE, bool* ok = 0) const - { if (ok) *ok = FALSE; return def; } - int readNumEntry(const QString& key, int def = 0, bool* ok = 0) const - { if (ok) *ok = FALSE; return def; } - QString readEntry(const QString& key, const QString& def = QString::null, bool* ok = 0) const - { if (ok) *ok = FALSE; return def; } - QStringList readListEntry(const QString& key, bool* ok = 0) const - { if (ok) *ok = FALSE; return QStringList(); } - template - bool writeEntry(const QString& key, t value) - { return TRUE; } -}; +#include +#endif +#include + +#if QT_VERSION < 0x040000 +#define Q3ValueList QValueList +#define Q3PopupMenu QPopupMenu +#define Q3ListView QListView +#define Q3ListViewItem QListViewItem +#define Q3VBox QVBox +#define Q3TextBrowser QTextBrowser +#define Q3MainWindow QMainWindow +#define Q3Action QAction +#define Q3ToolBar QToolBar +#define Q3ListViewItemIterator QListViewItemIterator +#define Q3FileDialog QFileDialog #endif class ConfigView; @@ -31,11 +30,10 @@ class ConfigItem; class ConfigLineEdit; class ConfigMainWindow; - class ConfigSettings : public QSettings { public: - QValueList readSizes(const QString& key, bool *ok); - bool writeSizes(const QString& key, const QValueList& value); + Q3ValueList readSizes(const QString& key, bool *ok); + bool writeSizes(const QString& key, const Q3ValueList& value); }; enum colIdx { @@ -48,9 +46,9 @@ enum optionMode { normalOpt = 0, allOpt, promptOpt }; -class ConfigList : public QListView { +class ConfigList : public Q3ListView { Q_OBJECT - typedef class QListView Parent; + typedef class Q3ListView Parent; public: ConfigList(ConfigView* p, const char *name = 0); void reinit(void); @@ -135,17 +133,17 @@ public: struct menu *rootEntry; QColorGroup disabledColorGroup; QColorGroup inactivedColorGroup; - QPopupMenu* headerPopup; + Q3PopupMenu* headerPopup; private: int colMap[colNr]; int colRevMap[colNr]; }; -class ConfigItem : public QListViewItem { - typedef class QListViewItem Parent; +class ConfigItem : public Q3ListViewItem { + typedef class Q3ListViewItem Parent; public: - ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v) + ConfigItem(Q3ListView *parent, ConfigItem *after, struct menu *m, bool v) : Parent(parent, after), menu(m), visible(v), goParent(false) { init(); @@ -155,16 +153,14 @@ public: { init(); } - ConfigItem(QListView *parent, ConfigItem *after, bool v) + ConfigItem(Q3ListView *parent, ConfigItem *after, bool v) : Parent(parent, after), menu(0), visible(v), goParent(true) { init(); } ~ConfigItem(void); void init(void); -#if QT_VERSION >= 300 void okRename(int col); -#endif void updateMenu(void); void testUpdateMenu(bool v); ConfigList* listView() const @@ -219,9 +215,9 @@ public: ConfigItem *item; }; -class ConfigView : public QVBox { +class ConfigView : public Q3VBox { Q_OBJECT - typedef class QVBox Parent; + typedef class Q3VBox Parent; public: ConfigView(QWidget* parent, const char *name = 0); ~ConfigView(void); @@ -252,9 +248,9 @@ public: static QAction *showPromptAction; }; -class ConfigInfoView : public QTextBrowser { +class ConfigInfoView : public Q3TextBrowser { Q_OBJECT - typedef class QTextBrowser Parent; + typedef class Q3TextBrowser Parent; public: ConfigInfoView(QWidget* parent, const char *name = 0); bool showDebug(void) const { return _showDebug; } @@ -274,11 +270,11 @@ protected: QString debug_info(struct symbol *sym); static QString print_filter(const QString &str); static void expr_print_help(void *data, struct symbol *sym, const char *str); - QPopupMenu* createPopupMenu(const QPoint& pos); + Q3PopupMenu* createPopupMenu(const QPoint& pos); void contentsContextMenuEvent(QContextMenuEvent *e); struct symbol *sym; - struct menu *menu; + struct menu *_menu; bool _showDebug; }; @@ -302,10 +298,10 @@ protected: struct symbol **result; }; -class ConfigMainWindow : public QMainWindow { +class ConfigMainWindow : public Q3MainWindow { Q_OBJECT - static QAction *saveAction; + static Q3Action *saveAction; static void conf_changed(void); public: ConfigMainWindow(void); @@ -334,8 +330,8 @@ protected: ConfigView *configView; ConfigList *configList; ConfigInfoView *helpText; - QToolBar *toolBar; - QAction *backAction; + Q3ToolBar *toolBar; + Q3Action *backAction; QSplitter* split1; QSplitter* split2; }; -- cgit v0.10.2 From 76a136c4a6bde90af8c899701cc1f0997af2f60a Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Wed, 1 Sep 2010 17:39:27 +0200 Subject: xconfig: Change the titlebar if using Qt3 Qt4 is now used by default and will get more testing. In case someone still uses Qt3 and reports a bug, make it easy to recognize that this is Qt3. Acked-by: Alexander Stein Signed-off-by: Michal Marek diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 88d3874..a04e451 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1274,8 +1274,14 @@ ConfigMainWindow::ConfigMainWindow(void) char title[256]; QDesktopWidget *d = configApp->desktop(); - snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration"), - getenv("KERNELVERSION")); + snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration%s"), + getenv("KERNELVERSION"), +#if QT_VERSION < 0x040000 + " (Qt3)" +#else + "" +#endif + ); setCaption(title); width = configSettings->readNumEntry("/window width", d->width() - 64); -- cgit v0.10.2 From 71d8066265896a6498a4de1bed80dea8dc5daead Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Wed, 1 Sep 2010 11:21:30 -0400 Subject: kbuild: fix oldnoconfig to do the right thing Commit 861b4ea4 broke oldnoconfig when removed the oldnoconfig checks on if (input_mode == nonint_oldconfig || input_mode == oldnoconfig) { if (input_mode == nonint_oldconfig && sym->name && !sym_is_choice_value(sym)) { to avoid oldnoconfig chugging through the else stanza. Fix that to restore expected behaviour (which I've confirmed in the Fedora kernel build that the configs end up looking the same.) Signed-off-by: Kyle McMartin Acked-by: Sam Ravnborg Signed-off-by: Michal Marek diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 4b3ad9b8..d56131c 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -427,7 +427,7 @@ static void check_conf(struct menu *menu) if (sym->name && !sym_is_choice_value(sym)) { printf("CONFIG_%s\n", sym->name); } - } else { + } else if (input_mode != oldnoconfig) { if (!conf_cnt++) printf(_("*\n* Restart config...\n*\n")); rootEntry = menu_get_parent_menu(menu); -- cgit v0.10.2 From aee08ed499d65f78373b716fcacefcde1ceb7ade Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Fri, 10 Sep 2010 01:32:50 -0700 Subject: nconfig: Fix help for choice menus When getting the help for a choice menu with a help section (for example the "Choose SLAB allocator" menu) nconfig pops up a window with nothing inside it. This is due to show_help() passing an empty string to show_scroll_win()'s 3rd argument. The option really does have help though, but it isn't a config symbol, so just add the help text for the option, and don't try to add anything else like the config option name. Signed-off-by: Stephen Boyd Acked-by: Nir Tzachar Signed-off-by: Michal Marek diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 18a215d..d4d1fa6 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -1265,6 +1265,8 @@ static void show_help(struct menu *menu) str_append(&help, _(menu_get_help(menu))); str_append(&help, "\n"); get_symbol_str(&help, menu->sym); + } else { + str_append(&help, _(menu_get_help(menu))); } } else { str_append(&help, nohelp_text); -- cgit v0.10.2 From 20f4ad8a19ad01405f9d6b3110d6eb93666ae21e Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Fri, 10 Sep 2010 19:01:14 +0200 Subject: Fix QT4 moc, cflags libs detection on dual QT3/Qt4 systems On system with QT3 and QT4 qmake in PATH may be from QT3. So we use pkg-config for proper QT4 detection. By reqesting cflags and libs for either QtCore, QtGui and QtSupport include dirs and libs get listed several times, but so we won't mis anything Signed-off-by: Alexander Stein Acked-by: Randy Dunlap Signed-off-by: Michal Marek diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index cef3f75..996059e 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -273,12 +273,10 @@ $(obj)/.tmp_qtcheck: moc="/usr/bin/moc"; \ fi; \ else \ - headerpath="\$$(shell qmake -query QT_INSTALL_HEADERS)"; \ - libpath="\$$(shell qmake -query QT_INSTALL_LIBS)"; \ - binpath="\$$(shell qmake -query QT_INSTALL_BINS)"; \ - cflags="-I$$headerpath -I$$headerpath/QtCore -I$$headerpath/QtGui -I$$headerpath/Qt3Support -DQT3_SUPPORT"; \ - libs="-L$$libpath -Wl,-rpath,$$libpath -lQtCore -lQtGui -lQt3Support"; \ - moc="$$binpath/moc"; \ + cflags="\$$(shell pkg-config QtCore --cflags) \$$(shell pkg-config QtGui --cflags) \$$(shell pkg-config Qt3Support --cflags)"; \ + libs="\$$(shell pkg-config QtCore --libs) \$$(shell pkg-config QtGui --libs) \$$(shell pkg-config Qt3Support --libs)"; \ + binpath="\$$(shell pkg-config QtCore --variable=prefix)"; \ + moc="$$binpath/bin/moc"; \ fi; \ echo "KC_QT_CFLAGS=$$cflags" > $@; \ echo "KC_QT_LIBS=$$libs" >> $@; \ -- cgit v0.10.2 From 458452f4a9b61228cf48a4232a19c8d7d686c11b Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Mon, 13 Sep 2010 13:41:31 +0200 Subject: kconfig: Simplify Makefile for xconfig Signed-off-by: Michal Marek diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 996059e..3fbfe98 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -273,8 +273,8 @@ $(obj)/.tmp_qtcheck: moc="/usr/bin/moc"; \ fi; \ else \ - cflags="\$$(shell pkg-config QtCore --cflags) \$$(shell pkg-config QtGui --cflags) \$$(shell pkg-config Qt3Support --cflags)"; \ - libs="\$$(shell pkg-config QtCore --libs) \$$(shell pkg-config QtGui --libs) \$$(shell pkg-config Qt3Support --libs)"; \ + 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"; \ fi; \ -- cgit v0.10.2 From cec1921ec9a91b9bc7c083b6ebe47c17552b9a81 Mon Sep 17 00:00:00 2001 From: "Justin P. Mattock" Date: Mon, 13 Sep 2010 12:55:56 -0700 Subject: scripts/kconfig/gconf.glade Update broken web addresses. As discussed, remove the DOCTYPE declaration since libglade validates the file against itself.. Signed-off-by: Justin P. Mattock Signed-off-by: Michal Marek diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.glade index d52b0a7..aa483cb 100644 --- a/scripts/kconfig/gconf.glade +++ b/scripts/kconfig/gconf.glade @@ -1,5 +1,4 @@ - -- cgit v0.10.2 From 8baefd30b5b0101aa07aa75da44a9eee881eed28 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Tue, 24 Aug 2010 00:14:47 -0400 Subject: kconfig: replace a `switch()' statement by a more flexible `if()' statement With the upcoming dynamical configuration prefix, we can no longer assume that the prefix will start by a 'C'. As such, we can no longer hardcode this value in the `case ...:', so replace the `switch() { ... }' statement by a more flexible 'if () { ... }' statement. Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index dc11d51..d9181de 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -221,8 +221,7 @@ load: while (fgets(line, sizeof(line), in)) { conf_lineno++; sym = NULL; - switch (line[0]) { - case '#': + if (line[0] == '#') { if (memcmp(line + 2, "CONFIG_", 7)) continue; p = strchr(line + 9, ' '); @@ -254,12 +253,7 @@ load: default: ; } - break; - case 'C': - if (memcmp(line, "CONFIG_", 7)) { - conf_warning("unexpected data"); - continue; - } + } else if (memcmp(line, "CONFIG_", 7) == 0) { p = strchr(line + 7, '='); if (!p) continue; @@ -286,12 +280,9 @@ load: } if (conf_set_sym_val(sym, def, def_flags, p)) continue; - break; - case '\r': - case '\n': - break; - default: - conf_warning("unexpected data"); + } else { + if (line[0] != '\r' && line[0] != '\n') + conf_warning("unexpected data"); continue; } if (sym && sym_is_choice_value(sym)) { -- cgit v0.10.2 From 59dfa24da7cb02b3ccc39f5e74b74fe26ea9626a Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Sat, 21 Aug 2010 00:43:46 -0400 Subject: kconfig: rephrase help text not to mention the internal prefix Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index d2f6e05..5c3d0c4 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -232,7 +232,7 @@ save_config_help[] = N_( "leave this blank.\n"), search_help[] = N_( "\n" - "Search for CONFIG_ symbols and display their relations.\n" + "Search for symbols and display their relations.\n" "Regular expressions are allowed.\n" "Example: search for \"^FOO\"\n" "Result:\n" @@ -249,7 +249,7 @@ search_help[] = N_( "Selected by: BAR\n" "-----------------------------------------------------------------\n" "o The line 'Prompt:' shows the text used in the menu structure for\n" - " this CONFIG_ symbol\n" + " this symbol\n" "o The 'Defined at' line tell at what file / line number the symbol\n" " is defined\n" "o The 'Depends on:' line tell what symbols needs to be defined for\n" @@ -265,9 +265,9 @@ search_help[] = N_( "Only relevant lines are shown.\n" "\n\n" "Search examples:\n" - "Examples: USB => find all CONFIG_ symbols containing USB\n" - " ^USB => find all CONFIG_ symbols starting with USB\n" - " USB$ => find all CONFIG_ symbols ending with USB\n" + "Examples: USB => find all symbols containing USB\n" + " ^USB => find all symbols starting with USB\n" + " USB$ => find all symbols ending with USB\n" "\n"); static int indent; diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 18a215d..b8a9f37 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -217,8 +217,8 @@ save_config_help[] = N_( "leave this blank.\n"), search_help[] = N_( "\n" -"Search for CONFIG_ symbols and display their relations.\n" -"Regular expressions are allowed.\n" +"Search for symbols and display their relations. Regular expressions\n" +"are allowed.\n" "Example: search for \"^FOO\"\n" "Result:\n" "-----------------------------------------------------------------\n" @@ -234,7 +234,7 @@ search_help[] = N_( "Selected by: BAR\n" "-----------------------------------------------------------------\n" "o The line 'Prompt:' shows the text used in the menu structure for\n" -" this CONFIG_ symbol\n" +" this symbol\n" "o The 'Defined at' line tell at what file / line number the symbol\n" " is defined\n" "o The 'Depends on:' line tell what symbols needs to be defined for\n" @@ -250,9 +250,9 @@ search_help[] = N_( "Only relevant lines are shown.\n" "\n\n" "Search examples:\n" -"Examples: USB = > find all CONFIG_ symbols containing USB\n" -" ^USB => find all CONFIG_ symbols starting with USB\n" -" USB$ => find all CONFIG_ symbols ending with USB\n" +"Examples: USB = > find all symbols containing USB\n" +" ^USB => find all symbols starting with USB\n" +" USB$ => find all symbols ending with USB\n" "\n"); struct mitem { -- cgit v0.10.2 From ffb5957bc48f64f0773fd3fbc43cb9bb9b38e270 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Sat, 14 Aug 2010 23:57:43 -0400 Subject: kconfig: allow build-time definition of the internal config prefix Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index d56131c..d6cfa0f 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -425,7 +425,7 @@ static void check_conf(struct menu *menu) (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) { if (input_mode == listnewconfig) { if (sym->name && !sym_is_choice_value(sym)) { - printf("CONFIG_%s\n", sym->name); + printf("%s%s\n", CONFIG_, sym->name); } } else if (input_mode != oldnoconfig) { if (!conf_cnt++) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index d9181de..9f3c889 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -222,22 +222,22 @@ load: conf_lineno++; sym = NULL; if (line[0] == '#') { - if (memcmp(line + 2, "CONFIG_", 7)) + if (memcmp(line + 2, CONFIG_, strlen(CONFIG_))) continue; - p = strchr(line + 9, ' '); + p = strchr(line + 2 + strlen(CONFIG_), ' '); if (!p) continue; *p++ = 0; if (strncmp(p, "is not set", 10)) continue; if (def == S_DEF_USER) { - sym = sym_find(line + 9); + sym = sym_find(line + 2 + strlen(CONFIG_)); if (!sym) { sym_add_change_count(1); break; } } else { - sym = sym_lookup(line + 9, 0); + sym = sym_lookup(line + 2 + strlen(CONFIG_), 0); if (sym->type == S_UNKNOWN) sym->type = S_BOOLEAN; } @@ -253,8 +253,8 @@ load: default: ; } - } else if (memcmp(line, "CONFIG_", 7) == 0) { - p = strchr(line + 7, '='); + } else if (memcmp(line, CONFIG_, strlen(CONFIG_)) == 0) { + p = strchr(line + strlen(CONFIG_), '='); if (!p) continue; *p++ = 0; @@ -265,13 +265,13 @@ load: *p2 = 0; } if (def == S_DEF_USER) { - sym = sym_find(line + 7); + sym = sym_find(line + strlen(CONFIG_)); if (!sym) { sym_add_change_count(1); break; } } else { - sym = sym_lookup(line + 7, 0); + sym = sym_lookup(line + strlen(CONFIG_), 0); if (sym->type == S_UNKNOWN) sym->type = S_OTHER; } @@ -397,9 +397,9 @@ static void conf_write_string(bool headerfile, const char *name, { int l; if (headerfile) - fprintf(out, "#define CONFIG_%s \"", name); + fprintf(out, "#define %s%s \"", CONFIG_, name); else - fprintf(out, "CONFIG_%s=\"", name); + fprintf(out, "%s%s=\"", CONFIG_, name); while (1) { l = strcspn(str, "\"\\"); @@ -425,13 +425,14 @@ static void conf_write_symbol(struct symbol *sym, enum symbol_type type, switch (sym_get_tristate_value(sym)) { case no: if (write_no) - fprintf(out, "# CONFIG_%s is not set\n", sym->name); + fprintf(out, "# %s%s is not set\n", + CONFIG_, sym->name); break; case mod: - fprintf(out, "CONFIG_%s=m\n", sym->name); + fprintf(out, "%s%s=m\n", CONFIG_, sym->name); break; case yes: - fprintf(out, "CONFIG_%s=y\n", sym->name); + fprintf(out, "%s%s=y\n", CONFIG_, sym->name); break; } break; @@ -441,7 +442,7 @@ static void conf_write_symbol(struct symbol *sym, enum symbol_type type, case S_HEX: case S_INT: str = sym_get_string_value(sym); - fprintf(out, "CONFIG_%s=%s\n", sym->name, str); + fprintf(out, "%s%s=%s\n", CONFIG_, sym->name, str); break; case S_OTHER: case S_UNKNOWN: @@ -832,14 +833,17 @@ int conf_write_autoconf(void) case no: break; case mod: - fprintf(tristate, "CONFIG_%s=M\n", sym->name); - fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); + fprintf(tristate, "%s%s=M\n", + CONFIG_, sym->name); + fprintf(out_h, "#define %s%s_MODULE 1\n", + CONFIG_, sym->name); break; case yes: if (sym->type == S_TRISTATE) - fprintf(tristate, "CONFIG_%s=Y\n", - sym->name); - fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); + fprintf(tristate,"%s%s=Y\n", + CONFIG_, sym->name); + fprintf(out_h, "#define %s%s 1\n", + CONFIG_, sym->name); break; } break; @@ -849,12 +853,14 @@ int conf_write_autoconf(void) case S_HEX: str = sym_get_string_value(sym); if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { - fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str); + fprintf(out_h, "#define %s%s 0x%s\n", + CONFIG_, sym->name, str); break; } case S_INT: str = sym_get_string_value(sym); - fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str); + fprintf(out_h, "#define %s%s %s\n", + CONFIG_, sym->name, str); break; default: break; diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index bdf71bd..1b966bf 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -37,6 +37,9 @@ extern "C" { #define _(text) gettext(text) #define N_(text) (text) +#ifndef CONFIG_ +#define CONFIG_ "CONFIG_" +#endif #define TF_COMMAND 0x0001 #define TF_PARAM 0x0002 diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 5c3d0c4..17ba222 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -316,8 +316,8 @@ static void search_conf(void) again: dialog_clear(); dres = dialog_inputbox(_("Search Configuration Parameter"), - _("Enter CONFIG_ (sub)string to search for " - "(with or without \"CONFIG\")"), + _("Enter " CONFIG_ " (sub)string to search for " + "(with or without \"" CONFIG_ "\")"), 10, 75, ""); switch (dres) { case 0: @@ -329,10 +329,10 @@ again: return; } - /* strip CONFIG_ if necessary */ + /* strip the prefix if necessary */ dialog_input = dialog_input_result; - if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0) - dialog_input += 7; + if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0) + dialog_input += strlen(CONFIG_); sym_arr = sym_re_search(dialog_input); res = get_relations_str(sym_arr); diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 4fb5902..64da30c 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -566,7 +566,7 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help) if (menu_has_help(menu)) { if (sym->name) { - str_printf(help, "CONFIG_%s:\n\n", sym->name); + str_printf(help, "%s%s:\n\n", CONFIG_, sym->name); str_append(help, _(menu_get_help(menu))); str_append(help, "\n"); } diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index b8a9f37..da5e45d 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -744,8 +744,8 @@ static void search_conf(void) again: dres = dialog_inputbox(main_window, _("Search Configuration Parameter"), - _("Enter CONFIG_ (sub)string to search for " - "(with or without \"CONFIG\")"), + _("Enter " CONFIG_ " (sub)string to search for " + "(with or without \"" CONFIG_ "\")"), "", dialog_input_result, 99); switch (dres) { case 0: @@ -758,10 +758,10 @@ again: return; } - /* strip CONFIG_ if necessary */ + /* strip the prefix if necessary */ dialog_input = dialog_input_result; - if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0) - dialog_input += 7; + if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0) + dialog_input += strlen(CONFIG_); sym_arr = sym_re_search(dialog_input); res = get_relations_str(sym_arr); @@ -1261,7 +1261,7 @@ static void show_help(struct menu *menu) if (menu && menu->sym && menu_has_help(menu)) { if (menu->sym->name) { - str_printf(&help, "CONFIG_%s:\n\n", menu->sym->name); + str_printf(&help, "%s%s:\n\n", CONFIG_, menu->sym->name); str_append(&help, _(menu_get_help(menu))); str_append(&help, "\n"); get_symbol_str(&help, menu->sym); -- cgit v0.10.2 From 652cf9821d2a5b22a1725ce8dc235ea5de0e1c6f Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Sat, 14 Aug 2010 23:51:40 -0400 Subject: kconfig: rephrase help texts/comments not to include the package name Signed-off-by: Arnaud Lacombe Reviewed-by: Randy Dunlap Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index d6cfa0f..eba5906 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -508,8 +508,7 @@ int main(int ac, char **av) name = conf_get_configname(); if (stat(name, &tmpstat)) { fprintf(stderr, _("***\n" - "*** You have not yet configured your kernel!\n" - "*** (missing kernel config file \"%s\")\n" + "*** Configuration file \"%s\" not found!\n" "***\n" "*** Please run some configurator (e.g. \"make oldconfig\" or\n" "*** \"make menuconfig\" or \"make xconfig\").\n" @@ -571,7 +570,7 @@ int main(int ac, char **av) name = getenv("KCONFIG_NOSILENTUPDATE"); if (name && *name) { fprintf(stderr, - _("\n*** Kernel configuration requires explicit update.\n\n")); + _("\n*** The configuration requires explicit update.\n\n")); return 1; } } @@ -623,11 +622,11 @@ int main(int ac, char **av) * All other commands are only used to generate a config. */ if (conf_get_changed() && conf_write(NULL)) { - fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); + fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); exit(1); } if (conf_write_autoconf()) { - fprintf(stderr, _("\n*** Error during update of the kernel configuration.\n\n")); + fprintf(stderr, _("\n*** Error during update of the configuration.\n\n")); return 1; } } else if (input_mode == savedefconfig) { @@ -638,7 +637,7 @@ int main(int ac, char **av) } } else if (input_mode != listnewconfig) { if (conf_write(NULL)) { - fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); + fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); exit(1); } } diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index d669882..1636213 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -671,8 +671,7 @@ void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data) { GtkWidget *dialog; const gchar *intro_text = _( - "Welcome to gkc, the GTK+ graphical kernel configuration tool\n" - "for Linux.\n" + "Welcome to gkc, the GTK+ graphical configuration tool\n" "For each option, a blank box indicates the feature is disabled, a\n" "check indicates it is enabled, and a dot indicates that it is to\n" "be compiled as a module. Clicking on the box will cycle through the three states.\n" diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 17ba222..cee4281 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -25,11 +25,9 @@ static const char mconf_readme[] = N_( "Overview\n" "--------\n" -"Some kernel features may be built directly into the kernel.\n" -"Some may be made into loadable runtime modules. Some features\n" -"may be completely removed altogether. There are also certain\n" -"kernel parameters which are not really features, but must be\n" -"entered in as decimal or hexadecimal numbers or possibly text.\n" +"This interface let you select features and parameters for the build.\n" +"Features can either be built-in, modularized, or ignored. Parameters\n" +"must be entered in as decimal or hexadecimal numbers or text.\n" "\n" "Menu items beginning with following braces represent features that\n" " [ ] can be built in or removed\n" @@ -117,7 +115,7 @@ static const char mconf_readme[] = N_( "-----------------------------\n" "Menuconfig supports the use of alternate configuration files for\n" "those who, for various reasons, find it necessary to switch\n" -"between different kernel configurations.\n" +"between different configurations.\n" "\n" "At the end of the main menu you will find two options. One is\n" "for saving the current configuration to a file of your choosing.\n" @@ -150,9 +148,9 @@ static const char mconf_readme[] = N_( "\n" "Optional personality available\n" "------------------------------\n" -"If you prefer to have all of the kernel options listed in a single\n" -"menu, rather than the default multimenu hierarchy, run the menuconfig\n" -"with MENUCONFIG_MODE environment variable set to single_menu. Example:\n" +"If you prefer to have all of the options listed in a single menu, rather\n" +"than the default multimenu hierarchy, run the menuconfig with\n" +"MENUCONFIG_MODE environment variable set to single_menu. Example:\n" "\n" "make MENUCONFIG_MODE=single_menu menuconfig\n" "\n" @@ -207,12 +205,12 @@ load_config_text[] = N_( "last retrieved. Leave blank to abort."), load_config_help[] = N_( "\n" - "For various reasons, one may wish to keep several different kernel\n" + "For various reasons, one may wish to keep several different\n" "configurations available on a single machine.\n" "\n" "If you have saved a previous configuration in a file other than the\n" - "kernel's default, entering the name of the file here will allow you\n" - "to modify that configuration.\n" + "default one, entering its name here will allow you to modify that\n" + "configuration.\n" "\n" "If you are uncertain, then you have probably never used alternate\n" "configuration files. You should therefore leave this blank to abort.\n"), @@ -221,8 +219,8 @@ save_config_text[] = N_( "as an alternate. Leave blank to abort."), save_config_help[] = N_( "\n" - "For various reasons, one may wish to keep different kernel\n" - "configurations available on a single machine.\n" + "For various reasons, one may wish to keep different configurations\n" + "available on a single machine.\n" "\n" "Entering a file name here will allow you to later retrieve, modify\n" "and use the current configuration as an alternate to whatever\n" @@ -834,7 +832,7 @@ int main(int ac, char **av) if (conf_get_changed()) res = dialog_yesno(NULL, _("Do you wish to save your " - "new kernel configuration?\n" + "new configuration?\n" " to continue."), 6, 60); else @@ -846,20 +844,20 @@ int main(int ac, char **av) case 0: if (conf_write(filename)) { fprintf(stderr, _("\n\n" - "Error during writing of the kernel configuration.\n" - "Your kernel configuration changes were NOT saved." + "Error while writing of the configuration.\n" + "Your configuration changes were NOT saved." "\n\n")); return 1; } case -1: printf(_("\n\n" - "*** End of Linux kernel configuration.\n" - "*** Execute 'make' to build the kernel or try 'make help'." + "*** End of the configuration.\n" + "*** Execute 'make' to start the build or try 'make help'." "\n\n")); break; default: fprintf(stderr, _("\n\n" - "Your kernel configuration changes were NOT saved." + "Your configuration changes were NOT saved." "\n\n")); } diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 64da30c..682045a 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -10,7 +10,7 @@ #include "lkc.h" static const char nohelp_text[] = N_( - "There is no help available for this kernel option.\n"); + "There is no help available for this option.\n"); struct menu rootmenu; static struct menu **last_entry_ptr; diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index da5e45d..801cc04 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -15,11 +15,9 @@ static const char nconf_readme[] = N_( "Overview\n" "--------\n" -"Some kernel features may be built directly into the kernel.\n" -"Some may be made into loadable runtime modules. Some features\n" -"may be completely removed altogether. There are also certain\n" -"kernel parameters which are not really features, but must be\n" -"entered in as decimal or hexadecimal numbers or possibly text.\n" +"This interface let you select features and parameters for the build.\n" +"Features can either be built-in, modularized, or ignored. Parameters\n" +"must be entered in as decimal or hexadecimal numbers or text.\n" "\n" "Menu items beginning with following braces represent features that\n" " [ ] can be built in or removed\n" @@ -95,7 +93,7 @@ static const char nconf_readme[] = N_( "-----------------------------\n" "nconfig supports the use of alternate configuration files for\n" "those who, for various reasons, find it necessary to switch\n" -"between different kernel configurations.\n" +"between different configurations.\n" "\n" "At the end of the main menu you will find two options. One is\n" "for saving the current configuration to a file of your choosing.\n" @@ -128,9 +126,9 @@ static const char nconf_readme[] = N_( "\n" "Optional personality available\n" "------------------------------\n" -"If you prefer to have all of the kernel options listed in a single\n" -"menu, rather than the default multimenu hierarchy, run the nconfig\n" -"with NCONFIG_MODE environment variable set to single_menu. Example:\n" +"If you prefer to have all of the options listed in a single menu, rather\n" +"than the default multimenu hierarchy, run the nconfig with NCONFIG_MODE\n" +"environment variable set to single_menu. Example:\n" "\n" "make NCONFIG_MODE=single_menu nconfig\n" "\n" @@ -185,19 +183,19 @@ setmod_text[] = N_( "has been configured as a module.\n" "As a result, this feature will be built as a module."), nohelp_text[] = N_( -"There is no help available for this kernel option.\n"), +"There is no help available for this option.\n"), load_config_text[] = N_( "Enter the name of the configuration file you wish to load.\n" "Accept the name shown to restore the configuration you\n" "last retrieved. Leave blank to abort."), load_config_help[] = N_( "\n" -"For various reasons, one may wish to keep several different kernel\n" +"For various reasons, one may wish to keep several different\n" "configurations available on a single machine.\n" "\n" "If you have saved a previous configuration in a file other than the\n" -"kernel's default, entering the name of the file here will allow you\n" -"to modify that configuration.\n" +"default one, entering its name here will allow you to modify that\n" +"configuration.\n" "\n" "If you are uncertain, then you have probably never used alternate\n" "configuration files. You should therefor leave this blank to abort.\n"), @@ -206,8 +204,8 @@ save_config_text[] = N_( "as an alternate. Leave blank to abort."), save_config_help[] = N_( "\n" -"For various reasons, one may wish to keep different kernel\n" -"configurations available on a single machine.\n" +"For various reasons, one may wish to keep different configurations\n" +"available on a single machine.\n" "\n" "Entering a file name here will allow you to later retrieve, modify\n" "and use the current configuration as an alternate to whatever\n" @@ -681,8 +679,7 @@ static int do_exit(void) return 0; } res = btn_dialog(main_window, - _("Do you wish to save your " - "new kernel configuration?\n" + _("Do you wish to save your new configuration?\n" " to cancel and resume nconfig."), 2, " ", @@ -701,18 +698,16 @@ static int do_exit(void) if (res) btn_dialog( main_window, - _("Error during writing of the kernel " - "configuration.\n" - "Your kernel configuration " - "changes were NOT saved."), + _("Error during writing of configuration.\n" + "Your configuration changes were NOT saved."), 1, ""); else { char buf[1024]; snprintf(buf, 1024, _("Configuration written to %s\n" - "End of Linux kernel configuration.\n" - "Execute 'make' to build the kernel or try" + "End of the configuration.\n" + "Execute 'make' to start the build or try" " 'make help'."), filename); btn_dialog( main_window, @@ -724,7 +719,7 @@ static int do_exit(void) default: btn_dialog( main_window, - _("Your kernel configuration changes were NOT saved."), + _("Your configuration changes were NOT saved."), 1, ""); break; diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index a04e451..fe18f7e 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1655,7 +1655,7 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e) void ConfigMainWindow::showIntro(void) { - static const QString str = _("Welcome to the qconf graphical kernel configuration tool for Linux.\n\n" + static const QString str = _("Welcome to the qconf graphical configuration tool.\n\n" "For each option, a blank box indicates the feature is disabled, a check\n" "indicates it is enabled, and a dot indicates that it is to be compiled\n" "as a module. Clicking on the box will cycle through the three states.\n\n" -- cgit v0.10.2 From ef211607ed49c475735898514c60a9797208b699 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Sat, 21 Aug 2010 01:20:52 -0400 Subject: kconfig: allow PACKAGE to be defined on the compiler's command-line Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 1b966bf..5d5f187 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -31,7 +31,10 @@ extern "C" { #define SRCTREE "srctree" +#ifndef PACKAGE #define PACKAGE "linux" +#endif + #define LOCALEDIR "/usr/share/locale" #define _(text) gettext(text) -- cgit v0.10.2 From 8ea13e2c87c83b7cb0b360cb8779415967727647 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Mon, 16 Aug 2010 22:55:31 -0400 Subject: kconfig: implement the `mainmenu' directive If specified, the directive must be placed at the top of the Kconfig file. We need to change the grammar to make the mainmenu directive set the `rootmenu' prompt. This reflect how menu_add_prompt() works internally, ie. set the prompt of the `current_entry', pointing originally to `rootmenu'. Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt index b472e4e..2fe93ca 100644 --- a/Documentation/kbuild/kconfig-language.txt +++ b/Documentation/kbuild/kconfig-language.txt @@ -322,7 +322,8 @@ mainmenu: "mainmenu" This sets the config program's title bar if the config program chooses -to use it. +to use it. It should be placed at the top of the configuration, before any +other statement. Kconfig hints diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 23dfd3b..e9b14ef 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -36,7 +36,7 @@ static struct menu *current_menu, *current_entry; #define YYERROR_VERBOSE #endif %} -%expect 26 +%expect 28 %union { @@ -104,14 +104,15 @@ static struct menu *current_menu, *current_entry; %} %% -input: stmt_list; +input: nl start | start; + +start: mainmenu_stmt stmt_list | stmt_list; stmt_list: /* empty */ | stmt_list common_stmt | stmt_list choice_stmt | stmt_list menu_stmt - | stmt_list T_MAINMENU prompt nl | stmt_list end { zconf_error("unexpected end statement"); } | stmt_list T_WORD error T_EOL { zconf_error("unknown statement \"%s\"", $2); } | stmt_list option_name error T_EOL @@ -342,6 +343,13 @@ if_block: | if_block choice_stmt ; +/* mainmenu entry */ + +mainmenu_stmt: T_MAINMENU prompt nl +{ + menu_add_prompt(P_MENU, $2, NULL); +}; + /* menu entry */ menu: T_MENU prompt T_EOL -- cgit v0.10.2 From c0920a1cbd7aecefa5f9768e82136935132ef1cf Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Fri, 10 Sep 2010 21:23:28 -0400 Subject: kconfig: regen parser Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/lex.zconf.c_shipped index fdc7113..6eb0397 100644 --- a/scripts/kconfig/lex.zconf.c_shipped +++ b/scripts/kconfig/lex.zconf.c_shipped @@ -2373,9 +2373,10 @@ void zconf_nextfile(const char *name) memset(buf, 0, sizeof(*buf)); current_buf->state = YY_CURRENT_BUFFER; - zconfin = zconf_fopen(name); + zconfin = zconf_fopen(file->name); if (!zconfin) { - printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name); + printf("%s:%d: can't open file \"%s\"\n", + zconf_curname(), zconf_lineno(), file->name); exit(1); } zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE)); @@ -2422,7 +2423,7 @@ int zconf_lineno(void) return current_pos.lineno; } -char *zconf_curname(void) +const char *zconf_curname(void) { return current_pos.file ? current_pos.file->name : ""; } diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped index 32a9eef..699d4b2 100644 --- a/scripts/kconfig/zconf.tab.c_shipped +++ b/scripts/kconfig/zconf.tab.c_shipped @@ -417,18 +417,18 @@ union yyalloc #endif /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 +#define YYFINAL 11 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 259 +#define YYLAST 277 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 35 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 46 +#define YYNNTS 48 /* YYNRULES -- Number of rules. */ -#define YYNRULES 110 +#define YYNRULES 113 /* YYNRULES -- Number of states. */ -#define YYNSTATES 180 +#define YYNSTATES 185 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -476,73 +476,74 @@ static const yytype_uint8 yytranslate[] = YYRHS. */ static const yytype_uint16 yyprhs[] = { - 0, 0, 3, 5, 6, 9, 12, 15, 20, 23, - 28, 33, 37, 39, 41, 43, 45, 47, 49, 51, - 53, 55, 57, 59, 61, 63, 67, 70, 74, 77, - 81, 84, 85, 88, 91, 94, 97, 100, 103, 107, - 112, 117, 122, 128, 132, 133, 137, 138, 141, 145, - 148, 150, 154, 155, 158, 161, 164, 167, 170, 175, - 179, 182, 187, 188, 191, 195, 197, 201, 202, 205, - 208, 211, 215, 218, 220, 224, 225, 228, 231, 234, - 238, 242, 245, 248, 251, 252, 255, 258, 261, 266, - 267, 270, 272, 274, 277, 280, 283, 285, 288, 289, - 292, 294, 298, 302, 306, 309, 313, 317, 319, 321, - 322 + 0, 0, 3, 6, 8, 11, 13, 14, 17, 20, + 23, 26, 31, 36, 40, 42, 44, 46, 48, 50, + 52, 54, 56, 58, 60, 62, 64, 66, 70, 73, + 77, 80, 84, 87, 88, 91, 94, 97, 100, 103, + 106, 110, 115, 120, 125, 131, 135, 136, 140, 141, + 144, 148, 151, 153, 157, 158, 161, 164, 167, 170, + 173, 178, 182, 185, 190, 191, 194, 198, 200, 204, + 205, 208, 211, 214, 218, 222, 225, 227, 231, 232, + 235, 238, 241, 245, 249, 252, 255, 258, 259, 262, + 265, 268, 273, 274, 277, 279, 281, 284, 287, 290, + 292, 295, 296, 299, 301, 305, 309, 313, 316, 320, + 324, 326, 328, 329 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 36, 0, -1, 37, -1, -1, 37, 39, -1, 37, - 53, -1, 37, 64, -1, 37, 3, 74, 76, -1, - 37, 75, -1, 37, 25, 1, 30, -1, 37, 38, - 1, 30, -1, 37, 1, 30, -1, 16, -1, 18, - -1, 19, -1, 21, -1, 17, -1, 22, -1, 20, - -1, 30, -1, 59, -1, 68, -1, 42, -1, 44, - -1, 66, -1, 25, 1, 30, -1, 1, 30, -1, - 10, 25, 30, -1, 41, 45, -1, 11, 25, 30, - -1, 43, 45, -1, -1, 45, 46, -1, 45, 47, - -1, 45, 72, -1, 45, 70, -1, 45, 40, -1, - 45, 30, -1, 19, 73, 30, -1, 18, 74, 77, - 30, -1, 20, 78, 77, 30, -1, 21, 25, 77, - 30, -1, 22, 79, 79, 77, 30, -1, 23, 48, - 30, -1, -1, 48, 25, 49, -1, -1, 33, 74, - -1, 7, 80, 30, -1, 50, 54, -1, 75, -1, - 51, 56, 52, -1, -1, 54, 55, -1, 54, 72, - -1, 54, 70, -1, 54, 30, -1, 54, 40, -1, - 18, 74, 77, 30, -1, 19, 73, 30, -1, 17, - 30, -1, 20, 25, 77, 30, -1, -1, 56, 39, - -1, 14, 78, 76, -1, 75, -1, 57, 60, 58, - -1, -1, 60, 39, -1, 60, 64, -1, 60, 53, - -1, 4, 74, 30, -1, 61, 71, -1, 75, -1, - 62, 65, 63, -1, -1, 65, 39, -1, 65, 64, - -1, 65, 53, -1, 6, 74, 30, -1, 9, 74, - 30, -1, 67, 71, -1, 12, 30, -1, 69, 13, - -1, -1, 71, 72, -1, 71, 30, -1, 71, 40, - -1, 16, 24, 78, 30, -1, -1, 74, 77, -1, - 25, -1, 26, -1, 5, 30, -1, 8, 30, -1, - 15, 30, -1, 30, -1, 76, 30, -1, -1, 14, - 78, -1, 79, -1, 79, 33, 79, -1, 79, 27, - 79, -1, 29, 78, 28, -1, 34, 78, -1, 78, - 31, 78, -1, 78, 32, 78, -1, 25, -1, 26, - -1, -1, 25, -1 + 36, 0, -1, 78, 37, -1, 37, -1, 62, 38, + -1, 38, -1, -1, 38, 40, -1, 38, 54, -1, + 38, 66, -1, 38, 77, -1, 38, 25, 1, 30, + -1, 38, 39, 1, 30, -1, 38, 1, 30, -1, + 16, -1, 18, -1, 19, -1, 21, -1, 17, -1, + 22, -1, 20, -1, 30, -1, 60, -1, 70, -1, + 43, -1, 45, -1, 68, -1, 25, 1, 30, -1, + 1, 30, -1, 10, 25, 30, -1, 42, 46, -1, + 11, 25, 30, -1, 44, 46, -1, -1, 46, 47, + -1, 46, 48, -1, 46, 74, -1, 46, 72, -1, + 46, 41, -1, 46, 30, -1, 19, 75, 30, -1, + 18, 76, 79, 30, -1, 20, 80, 79, 30, -1, + 21, 25, 79, 30, -1, 22, 81, 81, 79, 30, + -1, 23, 49, 30, -1, -1, 49, 25, 50, -1, + -1, 33, 76, -1, 7, 82, 30, -1, 51, 55, + -1, 77, -1, 52, 57, 53, -1, -1, 55, 56, + -1, 55, 74, -1, 55, 72, -1, 55, 30, -1, + 55, 41, -1, 18, 76, 79, 30, -1, 19, 75, + 30, -1, 17, 30, -1, 20, 25, 79, 30, -1, + -1, 57, 40, -1, 14, 80, 78, -1, 77, -1, + 58, 61, 59, -1, -1, 61, 40, -1, 61, 66, + -1, 61, 54, -1, 3, 76, 78, -1, 4, 76, + 30, -1, 63, 73, -1, 77, -1, 64, 67, 65, + -1, -1, 67, 40, -1, 67, 66, -1, 67, 54, + -1, 6, 76, 30, -1, 9, 76, 30, -1, 69, + 73, -1, 12, 30, -1, 71, 13, -1, -1, 73, + 74, -1, 73, 30, -1, 73, 41, -1, 16, 24, + 80, 30, -1, -1, 76, 79, -1, 25, -1, 26, + -1, 5, 30, -1, 8, 30, -1, 15, 30, -1, + 30, -1, 78, 30, -1, -1, 14, 80, -1, 81, + -1, 81, 33, 81, -1, 81, 27, 81, -1, 29, + 80, 28, -1, 34, 80, -1, 80, 31, 80, -1, + 80, 32, 80, -1, 25, -1, 26, -1, -1, 25, + -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 107, 107, 109, 111, 112, 113, 114, 115, 116, - 117, 121, 125, 125, 125, 125, 125, 125, 125, 129, - 130, 131, 132, 133, 134, 138, 139, 145, 153, 159, - 167, 177, 179, 180, 181, 182, 183, 184, 187, 195, - 201, 211, 217, 223, 226, 228, 239, 240, 245, 254, - 259, 267, 270, 272, 273, 274, 275, 276, 279, 285, - 296, 302, 312, 314, 319, 327, 335, 338, 340, 341, - 342, 347, 354, 359, 367, 370, 372, 373, 374, 377, - 385, 392, 399, 405, 412, 414, 415, 416, 419, 427, - 429, 434, 435, 438, 439, 440, 444, 445, 448, 449, - 452, 453, 454, 455, 456, 457, 458, 461, 462, 465, - 466 + 0, 107, 107, 107, 109, 109, 111, 113, 114, 115, + 116, 117, 118, 122, 126, 126, 126, 126, 126, 126, + 126, 130, 131, 132, 133, 134, 135, 139, 140, 146, + 154, 160, 168, 178, 180, 181, 182, 183, 184, 185, + 188, 196, 202, 212, 218, 224, 227, 229, 240, 241, + 246, 255, 260, 268, 271, 273, 274, 275, 276, 277, + 280, 286, 297, 303, 313, 315, 320, 328, 336, 339, + 341, 342, 343, 348, 355, 362, 367, 375, 378, 380, + 381, 382, 385, 393, 400, 407, 413, 420, 422, 423, + 424, 427, 435, 437, 442, 443, 446, 447, 448, 452, + 453, 456, 457, 460, 461, 462, 463, 464, 465, 466, + 469, 470, 473, 474 }; #endif @@ -557,17 +558,17 @@ static const char *const yytname[] = "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL", - "T_NOT", "$accept", "input", "stmt_list", "option_name", "common_stmt", - "option_error", "config_entry_start", "config_stmt", + "T_NOT", "$accept", "input", "start", "stmt_list", "option_name", + "common_stmt", "option_error", "config_entry_start", "config_stmt", "menuconfig_entry_start", "menuconfig_stmt", "config_option_list", "config_option", "symbol_option", "symbol_option_list", "symbol_option_arg", "choice", "choice_entry", "choice_end", "choice_stmt", "choice_option_list", "choice_option", "choice_block", - "if_entry", "if_end", "if_stmt", "if_block", "menu", "menu_entry", - "menu_end", "menu_stmt", "menu_block", "source_stmt", "comment", - "comment_stmt", "help_start", "help", "depends_list", "depends", - "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr", "symbol", - "word_opt", 0 + "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu", + "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt", + "comment", "comment_stmt", "help_start", "help", "depends_list", + "depends", "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr", + "symbol", "word_opt", 0 }; #endif @@ -586,35 +587,35 @@ static const yytype_uint16 yytoknum[] = /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 35, 36, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 38, 38, 38, 38, 38, 38, 38, 39, - 39, 39, 39, 39, 39, 40, 40, 41, 42, 43, - 44, 45, 45, 45, 45, 45, 45, 45, 46, 46, - 46, 46, 46, 47, 48, 48, 49, 49, 50, 51, - 52, 53, 54, 54, 54, 54, 54, 54, 55, 55, - 55, 55, 56, 56, 57, 58, 59, 60, 60, 60, - 60, 61, 62, 63, 64, 65, 65, 65, 65, 66, - 67, 68, 69, 70, 71, 71, 71, 71, 72, 73, - 73, 74, 74, 75, 75, 75, 76, 76, 77, 77, - 78, 78, 78, 78, 78, 78, 78, 79, 79, 80, - 80 + 0, 35, 36, 36, 37, 37, 38, 38, 38, 38, + 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, + 39, 40, 40, 40, 40, 40, 40, 41, 41, 42, + 43, 44, 45, 46, 46, 46, 46, 46, 46, 46, + 47, 47, 47, 47, 47, 48, 49, 49, 50, 50, + 51, 52, 53, 54, 55, 55, 55, 55, 55, 55, + 56, 56, 56, 56, 57, 57, 58, 59, 60, 61, + 61, 61, 61, 62, 63, 64, 65, 66, 67, 67, + 67, 67, 68, 69, 70, 71, 72, 73, 73, 73, + 73, 74, 75, 75, 76, 76, 77, 77, 77, 78, + 78, 79, 79, 80, 80, 80, 80, 80, 80, 80, + 81, 81, 82, 82 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { - 0, 2, 1, 0, 2, 2, 2, 4, 2, 4, - 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 2, 3, 2, 3, - 2, 0, 2, 2, 2, 2, 2, 2, 3, 4, - 4, 4, 5, 3, 0, 3, 0, 2, 3, 2, - 1, 3, 0, 2, 2, 2, 2, 2, 4, 3, - 2, 4, 0, 2, 3, 1, 3, 0, 2, 2, - 2, 3, 2, 1, 3, 0, 2, 2, 2, 3, - 3, 2, 2, 2, 0, 2, 2, 2, 4, 0, - 2, 1, 1, 2, 2, 2, 1, 2, 0, 2, - 1, 3, 3, 3, 2, 3, 3, 1, 1, 0, - 1 + 0, 2, 2, 1, 2, 1, 0, 2, 2, 2, + 2, 4, 4, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 2, 3, + 2, 3, 2, 0, 2, 2, 2, 2, 2, 2, + 3, 4, 4, 4, 5, 3, 0, 3, 0, 2, + 3, 2, 1, 3, 0, 2, 2, 2, 2, 2, + 4, 3, 2, 4, 0, 2, 3, 1, 3, 0, + 2, 2, 2, 3, 3, 2, 1, 3, 0, 2, + 2, 2, 3, 3, 2, 2, 2, 0, 2, 2, + 2, 4, 0, 2, 1, 1, 2, 2, 2, 1, + 2, 0, 2, 1, 3, 3, 3, 2, 3, 3, + 1, 1, 0, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -622,158 +623,165 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 3, 0, 0, 1, 0, 0, 0, 0, 0, 109, - 0, 0, 0, 0, 0, 0, 12, 16, 13, 14, - 18, 15, 17, 0, 19, 0, 4, 31, 22, 31, - 23, 52, 62, 5, 67, 20, 84, 75, 6, 24, - 84, 21, 8, 11, 91, 92, 0, 0, 93, 0, - 110, 0, 94, 0, 0, 0, 107, 108, 0, 0, - 0, 100, 95, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 96, 7, 71, 79, 48, 80, 27, - 29, 0, 104, 0, 0, 64, 0, 0, 9, 10, - 0, 0, 0, 0, 89, 0, 0, 0, 44, 0, - 37, 36, 32, 33, 0, 35, 34, 0, 0, 89, - 0, 56, 57, 53, 55, 54, 63, 51, 50, 68, - 70, 66, 69, 65, 86, 87, 85, 76, 78, 74, - 77, 73, 97, 103, 105, 106, 102, 101, 26, 82, - 0, 98, 0, 98, 98, 98, 0, 0, 0, 83, - 60, 98, 0, 98, 0, 0, 0, 38, 90, 0, - 0, 98, 46, 43, 25, 0, 59, 0, 88, 99, - 39, 40, 41, 0, 0, 45, 58, 61, 42, 47 + 6, 0, 99, 0, 3, 0, 6, 6, 94, 95, + 0, 1, 0, 0, 0, 0, 112, 0, 0, 0, + 0, 0, 0, 14, 18, 15, 16, 20, 17, 19, + 0, 21, 0, 7, 33, 24, 33, 25, 54, 64, + 8, 69, 22, 87, 78, 9, 26, 87, 23, 10, + 0, 100, 2, 73, 13, 0, 96, 0, 113, 0, + 97, 0, 0, 0, 110, 111, 0, 0, 0, 103, + 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 74, 82, 50, 83, 29, 31, 0, 107, 0, + 0, 66, 0, 0, 11, 12, 0, 0, 0, 0, + 92, 0, 0, 0, 46, 0, 39, 38, 34, 35, + 0, 37, 36, 0, 0, 92, 0, 58, 59, 55, + 57, 56, 65, 53, 52, 70, 72, 68, 71, 67, + 89, 90, 88, 79, 81, 77, 80, 76, 106, 108, + 109, 105, 104, 28, 85, 0, 101, 0, 101, 101, + 101, 0, 0, 0, 86, 62, 101, 0, 101, 0, + 0, 0, 40, 93, 0, 0, 101, 48, 45, 27, + 0, 61, 0, 91, 102, 41, 42, 43, 0, 0, + 47, 60, 63, 44, 49 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 1, 2, 25, 26, 101, 27, 28, 29, 30, - 65, 102, 103, 147, 175, 31, 32, 117, 33, 67, - 113, 68, 34, 121, 35, 69, 36, 37, 129, 38, - 71, 39, 40, 41, 104, 105, 70, 106, 142, 143, - 42, 74, 156, 60, 61, 51 + -1, 3, 4, 5, 32, 33, 107, 34, 35, 36, + 37, 73, 108, 109, 152, 180, 38, 39, 123, 40, + 75, 119, 76, 41, 127, 42, 77, 6, 43, 44, + 135, 45, 79, 46, 47, 48, 110, 111, 78, 112, + 147, 148, 49, 7, 161, 68, 69, 59 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -80 +#define YYPACT_NINF -89 static const yytype_int16 yypact[] = { - -80, 2, 132, -80, -13, -1, -1, -2, -1, 9, - 33, -1, 27, 40, -3, 38, -80, -80, -80, -80, - -80, -80, -80, 71, -80, 77, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, 57, 61, -80, 63, - -80, 76, -80, 87, 101, 133, -80, -80, -3, -3, - 195, -6, -80, 136, 149, 39, 104, 65, 150, 5, - 194, 5, 167, -80, 176, -80, -80, -80, -80, -80, - -80, 68, -80, -3, -3, 176, 72, 72, -80, -80, - 177, 187, 78, -1, -1, -3, 196, 72, -80, 222, - -80, -80, -80, -80, 221, -80, -80, 205, -1, -1, - 211, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, 206, -80, -80, -80, -80, -80, - -3, 223, 209, 223, 197, 223, 72, 7, 210, -80, - -80, 223, 212, 223, 201, -3, 213, -80, -80, 214, - 215, 223, 208, -80, -80, 216, -80, 217, -80, 113, - -80, -80, -80, 218, -1, -80, -80, -80, -80, -80 + 3, 4, -89, 20, -89, 100, -89, 7, -89, -89, + -8, -89, 17, 4, 28, 4, 37, 36, 4, 68, + 87, -18, 69, -89, -89, -89, -89, -89, -89, -89, + 128, -89, 138, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + 127, -89, -89, 110, -89, 126, -89, 136, -89, 137, + -89, 147, 150, 152, -89, -89, -18, -18, 171, -14, + -89, 153, 157, 34, 67, 180, 233, 220, 207, 220, + 154, -89, -89, -89, -89, -89, -89, 0, -89, -18, + -18, 110, 44, 44, -89, -89, 163, 174, 182, 4, + 4, -18, 194, 44, -89, 219, -89, -89, -89, -89, + 223, -89, -89, 203, 4, 4, 215, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, 213, + -89, -89, -89, -89, -89, -18, 232, 227, 232, -5, + 232, 44, 35, 234, -89, -89, 232, 235, 232, 224, + -18, 236, -89, -89, 237, 238, 232, 216, -89, -89, + 240, -89, 241, -89, 71, -89, -89, -89, 242, 4, + -89, -89, -89, -89, -89 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -80, -80, -80, -80, 122, -34, -80, -80, -80, -80, - 220, -80, -80, -80, -80, -80, -80, -80, 59, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, 125, - -80, -80, -80, -80, -80, 183, 219, 22, 142, -5, - 147, 192, 69, -54, -79, -80 + -89, -89, 255, 267, -89, 47, -57, -89, -89, -89, + -89, 239, -89, -89, -89, -89, -89, -89, -89, 130, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, 181, -89, -89, -89, -89, -89, 199, 229, 16, + 162, -1, 74, -7, 103, -65, -88, -89 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -82 +#define YYTABLE_NINF -85 static const yytype_int16 yytable[] = { - 46, 47, 3, 49, 81, 82, 53, 136, 137, 6, - 7, 8, 9, 10, 11, 12, 13, 43, 146, 14, - 15, 86, 56, 57, 44, 45, 58, 87, 48, 134, - 135, 59, 162, 112, 50, 24, 125, 163, 125, -28, - 90, 144, -28, -28, -28, -28, -28, -28, -28, -28, - -28, 91, 54, -28, -28, 92, -28, 93, 94, 95, - 96, 97, 98, 52, 99, 55, 90, 161, 62, 100, - -49, -49, 63, -49, -49, -49, -49, 91, 64, -49, - -49, 92, 107, 108, 109, 110, 154, 73, 141, 115, - 99, 75, 126, 76, 126, 111, 133, 56, 57, 83, - 84, 169, 140, 151, -30, 90, 77, -30, -30, -30, - -30, -30, -30, -30, -30, -30, 91, 78, -30, -30, - 92, -30, 93, 94, 95, 96, 97, 98, 120, 99, - 128, 79, -2, 4, 100, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 83, 84, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 7, 8, 23, 10, 11, - 12, 13, 24, 80, 14, 15, 88, -81, 90, 179, - -81, -81, -81, -81, -81, -81, -81, -81, -81, 89, - 24, -81, -81, 92, -81, -81, -81, -81, -81, -81, - 116, 119, 99, 127, 122, 90, 130, 124, -72, -72, - -72, -72, -72, -72, -72, -72, 132, 138, -72, -72, - 92, 155, 158, 159, 160, 118, 123, 139, 131, 99, - 165, 145, 167, 148, 124, 73, 83, 84, 83, 84, - 173, 168, 83, 84, 149, 150, 153, 155, 84, 157, - 164, 174, 166, 170, 171, 172, 176, 177, 178, 66, - 114, 152, 85, 0, 0, 0, 0, 0, 0, 72 + 10, 87, 88, 53, 141, 142, 1, 64, 65, 160, + 1, 66, 55, 92, 57, 151, 67, 61, 118, 93, + 11, 131, 2, 131, 139, 140, 89, 90, 138, 8, + 9, 89, 90, 2, -30, 96, 149, 51, -30, -30, + -30, -30, -30, -30, -30, -30, 97, 54, -30, -30, + 98, -30, 99, 100, 101, 102, 103, 104, 56, 105, + 167, 91, 58, 166, 106, 168, 60, -32, 96, 64, + 65, -32, -32, -32, -32, -32, -32, -32, -32, 97, + 159, -32, -32, 98, -32, 99, 100, 101, 102, 103, + 104, 121, 105, 62, 132, 174, 132, 106, 146, 70, + -5, 12, 89, 90, 13, 14, 15, 16, 17, 18, + 19, 20, 63, 156, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 122, 125, 30, 133, -4, 12, 71, + 31, 13, 14, 15, 16, 17, 18, 19, 20, 72, + 51, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 124, 129, 30, 137, -84, 96, 81, 31, -84, -84, + -84, -84, -84, -84, -84, -84, 82, 83, -84, -84, + 98, -84, -84, -84, -84, -84, -84, 84, 184, 105, + 85, 96, 86, 94, 130, -51, -51, 95, -51, -51, + -51, -51, 97, 143, -51, -51, 98, 113, 114, 115, + 116, 2, 89, 90, 144, 105, 145, 126, 96, 134, + 117, -75, -75, -75, -75, -75, -75, -75, -75, 150, + 153, -75, -75, 98, 13, 14, 15, 16, 17, 18, + 19, 20, 105, 155, 21, 22, 154, 130, 14, 15, + 158, 17, 18, 19, 20, 90, 160, 21, 22, 179, + 31, 163, 164, 165, 173, 89, 90, 162, 128, 170, + 136, 172, 52, 31, 169, 171, 175, 176, 177, 178, + 181, 182, 183, 50, 120, 74, 80, 157 }; -static const yytype_int16 yycheck[] = +static const yytype_uint8 yycheck[] = { - 5, 6, 0, 8, 58, 59, 11, 86, 87, 4, - 5, 6, 7, 8, 9, 10, 11, 30, 97, 14, - 15, 27, 25, 26, 25, 26, 29, 33, 30, 83, - 84, 34, 25, 67, 25, 30, 70, 30, 72, 0, - 1, 95, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 25, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 30, 25, 25, 1, 146, 30, 30, - 5, 6, 1, 8, 9, 10, 11, 12, 1, 14, - 15, 16, 17, 18, 19, 20, 140, 30, 93, 67, - 25, 30, 70, 30, 72, 30, 28, 25, 26, 31, - 32, 155, 24, 108, 0, 1, 30, 3, 4, 5, + 1, 66, 67, 10, 92, 93, 3, 25, 26, 14, + 3, 29, 13, 27, 15, 103, 34, 18, 75, 33, + 0, 78, 30, 80, 89, 90, 31, 32, 28, 25, + 26, 31, 32, 30, 0, 1, 101, 30, 4, 5, 6, 7, 8, 9, 10, 11, 12, 30, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 69, 25, - 71, 30, 0, 1, 30, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 31, 32, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 5, 6, 25, 8, 9, - 10, 11, 30, 30, 14, 15, 30, 0, 1, 174, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, + 16, 17, 18, 19, 20, 21, 22, 23, 30, 25, + 25, 68, 25, 151, 30, 30, 30, 0, 1, 25, + 26, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 145, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 75, 25, 25, 78, 160, 80, 30, 99, 30, + 0, 1, 31, 32, 4, 5, 6, 7, 8, 9, + 10, 11, 25, 114, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 76, 77, 25, 79, 0, 1, 1, + 30, 4, 5, 6, 7, 8, 9, 10, 11, 1, 30, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 68, 69, 25, 71, 69, 1, 71, 30, 4, 5, + 76, 77, 25, 79, 0, 1, 30, 30, 4, 5, 6, 7, 8, 9, 10, 11, 30, 30, 14, 15, - 16, 14, 143, 144, 145, 68, 69, 30, 71, 25, - 151, 25, 153, 1, 30, 30, 31, 32, 31, 32, - 161, 30, 31, 32, 13, 30, 25, 14, 32, 30, - 30, 33, 30, 30, 30, 30, 30, 30, 30, 29, - 67, 109, 60, -1, -1, -1, -1, -1, -1, 40 + 16, 17, 18, 19, 20, 21, 22, 30, 179, 25, + 30, 1, 30, 30, 30, 5, 6, 30, 8, 9, + 10, 11, 12, 30, 14, 15, 16, 17, 18, 19, + 20, 30, 31, 32, 30, 25, 24, 77, 1, 79, + 30, 4, 5, 6, 7, 8, 9, 10, 11, 25, + 1, 14, 15, 16, 4, 5, 6, 7, 8, 9, + 10, 11, 25, 30, 14, 15, 13, 30, 5, 6, + 25, 8, 9, 10, 11, 32, 14, 14, 15, 33, + 30, 148, 149, 150, 30, 31, 32, 30, 77, 156, + 79, 158, 7, 30, 30, 30, 30, 30, 30, 166, + 30, 30, 30, 6, 75, 36, 47, 115 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 36, 37, 0, 1, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 25, 30, 38, 39, 41, 42, 43, - 44, 50, 51, 53, 57, 59, 61, 62, 64, 66, - 67, 68, 75, 30, 25, 26, 74, 74, 30, 74, - 25, 80, 30, 74, 25, 25, 25, 26, 29, 34, - 78, 79, 30, 1, 1, 45, 45, 54, 56, 60, - 71, 65, 71, 30, 76, 30, 30, 30, 30, 30, - 30, 78, 78, 31, 32, 76, 27, 33, 30, 30, - 1, 12, 16, 18, 19, 20, 21, 22, 23, 25, - 30, 40, 46, 47, 69, 70, 72, 17, 18, 19, - 20, 30, 40, 55, 70, 72, 39, 52, 75, 39, - 53, 58, 64, 75, 30, 40, 72, 39, 53, 63, - 64, 75, 30, 28, 78, 78, 79, 79, 30, 30, - 24, 74, 73, 74, 78, 25, 79, 48, 1, 13, - 30, 74, 73, 25, 78, 14, 77, 30, 77, 77, - 77, 79, 25, 30, 30, 77, 30, 77, 30, 78, - 30, 30, 30, 77, 33, 49, 30, 30, 30, 74 + 0, 3, 30, 36, 37, 38, 62, 78, 25, 26, + 76, 0, 1, 4, 5, 6, 7, 8, 9, 10, + 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 25, 30, 39, 40, 42, 43, 44, 45, 51, 52, + 54, 58, 60, 63, 64, 66, 68, 69, 70, 77, + 38, 30, 37, 78, 30, 76, 30, 76, 25, 82, + 30, 76, 25, 25, 25, 26, 29, 34, 80, 81, + 30, 1, 1, 46, 46, 55, 57, 61, 73, 67, + 73, 30, 30, 30, 30, 30, 30, 80, 80, 31, + 32, 78, 27, 33, 30, 30, 1, 12, 16, 18, + 19, 20, 21, 22, 23, 25, 30, 41, 47, 48, + 71, 72, 74, 17, 18, 19, 20, 30, 41, 56, + 72, 74, 40, 53, 77, 40, 54, 59, 66, 77, + 30, 41, 74, 40, 54, 65, 66, 77, 28, 80, + 80, 81, 81, 30, 30, 24, 76, 75, 76, 80, + 25, 81, 49, 1, 13, 30, 76, 75, 25, 80, + 14, 79, 30, 79, 79, 79, 81, 25, 30, 30, + 79, 30, 79, 30, 80, 30, 30, 30, 79, 33, + 50, 30, 30, 30, 76 }; #define yyerrok (yyerrstatus = 0) @@ -1284,7 +1292,7 @@ yydestruct (yymsg, yytype, yyvaluep) switch (yytype) { - case 51: /* "choice_entry" */ + case 52: /* "choice_entry" */ { fprintf(stderr, "%s:%d: missing end statement for this entry\n", @@ -1294,7 +1302,7 @@ yydestruct (yymsg, yytype, yyvaluep) }; break; - case 57: /* "if_entry" */ + case 58: /* "if_entry" */ { fprintf(stderr, "%s:%d: missing end statement for this entry\n", @@ -1304,7 +1312,7 @@ yydestruct (yymsg, yytype, yyvaluep) }; break; - case 62: /* "menu_entry" */ + case 64: /* "menu_entry" */ { fprintf(stderr, "%s:%d: missing end statement for this entry\n", @@ -1614,39 +1622,39 @@ yyreduce: YY_REDUCE_PRINT (yyn); switch (yyn) { - case 8: + case 10: { zconf_error("unexpected end statement"); ;} break; - case 9: + case 11: { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;} break; - case 10: + case 12: { zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name); ;} break; - case 11: + case 13: { zconf_error("invalid statement"); ;} break; - case 25: + case 27: { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;} break; - case 26: + case 28: { zconf_error("invalid option"); ;} break; - case 27: + case 29: { struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); @@ -1656,7 +1664,7 @@ yyreduce: ;} break; - case 28: + case 30: { menu_end_entry(); @@ -1664,7 +1672,7 @@ yyreduce: ;} break; - case 29: + case 31: { struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); @@ -1674,7 +1682,7 @@ yyreduce: ;} break; - case 30: + case 32: { if (current_entry->prompt) @@ -1686,7 +1694,7 @@ yyreduce: ;} break; - case 38: + case 40: { menu_set_type((yyvsp[(1) - (3)].id)->stype); @@ -1696,7 +1704,7 @@ yyreduce: ;} break; - case 39: + case 41: { menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); @@ -1704,7 +1712,7 @@ yyreduce: ;} break; - case 40: + case 42: { menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr)); @@ -1716,7 +1724,7 @@ yyreduce: ;} break; - case 41: + case 43: { menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); @@ -1724,7 +1732,7 @@ yyreduce: ;} break; - case 42: + case 44: { menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr)); @@ -1732,7 +1740,7 @@ yyreduce: ;} break; - case 45: + case 47: { struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string))); @@ -1744,17 +1752,17 @@ yyreduce: ;} break; - case 46: + case 48: { (yyval.string) = NULL; ;} break; - case 47: + case 49: { (yyval.string) = (yyvsp[(2) - (2)].string); ;} break; - case 48: + case 50: { struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE); @@ -1765,14 +1773,14 @@ yyreduce: ;} break; - case 49: + case 51: { (yyval.menu) = menu_add_menu(); ;} break; - case 50: + case 52: { if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) { @@ -1782,7 +1790,7 @@ yyreduce: ;} break; - case 58: + case 60: { menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); @@ -1790,7 +1798,7 @@ yyreduce: ;} break; - case 59: + case 61: { if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) { @@ -1803,7 +1811,7 @@ yyreduce: ;} break; - case 60: + case 62: { current_entry->sym->flags |= SYMBOL_OPTIONAL; @@ -1811,7 +1819,7 @@ yyreduce: ;} break; - case 61: + case 63: { if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) { @@ -1823,7 +1831,7 @@ yyreduce: ;} break; - case 64: + case 66: { printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); @@ -1833,7 +1841,7 @@ yyreduce: ;} break; - case 65: + case 67: { if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) { @@ -1843,7 +1851,14 @@ yyreduce: ;} break; - case 71: + case 73: + + { + menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); +;} + break; + + case 74: { menu_add_entry(NULL); @@ -1852,14 +1867,14 @@ yyreduce: ;} break; - case 72: + case 75: { (yyval.menu) = menu_add_menu(); ;} break; - case 73: + case 76: { if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) { @@ -1869,7 +1884,7 @@ yyreduce: ;} break; - case 79: + case 82: { printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); @@ -1877,7 +1892,7 @@ yyreduce: ;} break; - case 80: + case 83: { menu_add_entry(NULL); @@ -1886,14 +1901,14 @@ yyreduce: ;} break; - case 81: + case 84: { menu_end_entry(); ;} break; - case 82: + case 85: { printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); @@ -1901,14 +1916,14 @@ yyreduce: ;} break; - case 83: + case 86: { current_entry->help = (yyvsp[(2) - (2)].string); ;} break; - case 88: + case 91: { menu_add_dep((yyvsp[(3) - (4)].expr)); @@ -1916,84 +1931,84 @@ yyreduce: ;} break; - case 90: + case 93: { menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr)); ;} break; - case 93: + case 96: { (yyval.id) = (yyvsp[(1) - (2)].id); ;} break; - case 94: + case 97: { (yyval.id) = (yyvsp[(1) - (2)].id); ;} break; - case 95: + case 98: { (yyval.id) = (yyvsp[(1) - (2)].id); ;} break; - case 98: + case 101: { (yyval.expr) = NULL; ;} break; - case 99: + case 102: { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;} break; - case 100: + case 103: { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;} break; - case 101: + case 104: { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} break; - case 102: + case 105: { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} break; - case 103: + case 106: { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;} break; - case 104: + case 107: { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;} break; - case 105: + case 108: { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} break; - case 106: + case 109: { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} break; - case 107: + case 110: { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;} break; - case 108: + case 111: { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;} break; - case 109: + case 112: { (yyval.string) = NULL; ;} break; @@ -2239,6 +2254,10 @@ void conf_parse(const char *name) prop = prop_alloc(P_DEFAULT, modules_sym); prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0)); } + + rootmenu.prompt->text = _(rootmenu.prompt->text); + rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text); + menu_finalize(&rootmenu); for_all_symbols(i, sym) { if (sym_check_deps(sym)) -- cgit v0.10.2 From 76a540958af5390a94b7f68c46cb7f2aed34ccf1 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Wed, 18 Aug 2010 01:23:50 -0400 Subject: kconfig: add a symbol string expansion helper Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index 9a948c9..4531bad 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h @@ -28,6 +28,7 @@ P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); P(sym_lookup,struct symbol *,(const char *name, int flags)); P(sym_find,struct symbol *,(const char *name)); +P(sym_expand_string_value,const char *,(const char *in)); P(sym_re_search,struct symbol **,(const char *pattern)); P(sym_type_name,const char *,(enum symbol_type type)); P(sym_calc_value,void,(struct symbol *sym)); diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 943712c..dc5dcf2 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -840,6 +840,55 @@ struct symbol *sym_find(const char *name) return symbol; } +/* + * Expand symbol's names embedded in the string given in argument. Symbols' + * name to be expanded shall be prefixed by a '$'. Unknown symbol expands to + * the empty string. + */ +const char *sym_expand_string_value(const char *in) +{ + const char *src; + char *res; + size_t reslen; + + reslen = strlen(in) + 1; + res = malloc(reslen); + res[0] = '\0'; + + while ((src = strchr(in, '$'))) { + char *p, name[SYMBOL_MAXLENGTH]; + const char *symval = ""; + struct symbol *sym; + size_t newlen; + + strncat(res, in, src - in); + src++; + + p = name; + while (isalnum(*src) || *src == '_') + *p++ = *src++; + *p = '\0'; + + sym = sym_find(name); + if (sym != NULL) { + sym_calc_value(sym); + symval = sym_get_string_value(sym); + } + + newlen = strlen(res) + strlen(symval) + strlen(src); + if (newlen > reslen) { + reslen = newlen; + realloc(res, reslen); + } + + strcat(res, symval); + in = src; + } + strcat(res, in); + + return res; +} + struct symbol **sym_re_search(const char *pattern) { struct symbol *sym, **sym_arr = NULL; -- cgit v0.10.2 From f6ce00b8cca0517f7296cd76059e1fb37d01c871 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Thu, 9 Sep 2010 21:17:26 -0400 Subject: kconfig: expand by default the rootmenu's prompt Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index e9b14ef..2abd3c7 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -502,6 +502,10 @@ void conf_parse(const char *name) prop = prop_alloc(P_DEFAULT, modules_sym); prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0)); } + + rootmenu.prompt->text = _(rootmenu.prompt->text); + rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text); + menu_finalize(&rootmenu); for_all_symbols(i, sym) { if (sym_check_deps(sym)) -- cgit v0.10.2 From c55c9d571a3db7a096834b6c8a58d5a32dc807e6 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Sun, 19 Sep 2010 22:47:17 -0400 Subject: kconfig: delay gconf window initialization Delay the window initialization to let the rootmenu's prompt be initialized as it will be used to get the window's title. Signed-off-by: Arnaud Lacombe diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 1636213..262fbd1 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -1530,12 +1530,6 @@ int main(int ac, char *av[]) else glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".glade", NULL); - /* Load the interface and connect signals */ - init_main_window(glade_file); - init_tree_model(); - init_left_tree(); - init_right_tree(); - /* Conf stuffs */ if (ac > 1 && av[1][0] == '-') { switch (av[1][1]) { @@ -1555,6 +1549,12 @@ int main(int ac, char *av[]) fixup_rootmenu(&rootmenu); conf_read(NULL); + /* Load the interface and connect signals */ + init_main_window(glade_file); + init_tree_model(); + init_left_tree(); + init_right_tree(); + switch (view_mode) { case SINGLE_VIEW: display_tree_part(); -- cgit v0.10.2 From 0954828fcbf3bd13d593499b16b901a4e801b0b9 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Wed, 18 Aug 2010 01:57:13 -0400 Subject: kconfig: replace KERNELVERSION usage by the mainmenu's prompt Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 9f3c889..f7d89d7 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -574,8 +574,6 @@ int conf_write(const char *name) if (!out) return 1; - sym = sym_lookup("KERNELVERSION", 0); - sym_calc_value(sym); time(&now); env = getenv("KCONFIG_NOTIMESTAMP"); if (env && *env) @@ -583,10 +581,10 @@ int conf_write(const char *name) fprintf(out, _("#\n" "# Automatically generated make config: don't edit\n" - "# Linux kernel version: %s\n" + "# %s\n" "%s%s" "#\n"), - sym_get_string_value(sym), + rootmenu.prompt->text, use_timestamp ? "# " : "", use_timestamp ? ctime(&now) : ""); @@ -797,25 +795,23 @@ int conf_write_autoconf(void) return 1; } - sym = sym_lookup("KERNELVERSION", 0); - sym_calc_value(sym); time(&now); fprintf(out, "#\n" "# Automatically generated make config: don't edit\n" - "# Linux kernel version: %s\n" + "# %s\n" "# %s" "#\n", - sym_get_string_value(sym), ctime(&now)); + rootmenu.prompt->text, ctime(&now)); fprintf(tristate, "#\n" "# Automatically generated - do not edit\n" "\n"); fprintf(out_h, "/*\n" " * Automatically generated C config: don't edit\n" - " * Linux kernel version: %s\n" + " * %s\n" " * %s" " */\n" "#define AUTOCONF_INCLUDED\n", - sym_get_string_value(sym), ctime(&now)); + rootmenu.prompt->text, ctime(&now)); for_all_symbols(i, sym) { sym_calc_value(sym); diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 262fbd1..4558961 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -133,7 +133,6 @@ void init_main_window(const gchar * glade_file) GladeXML *xml; GtkWidget *widget; GtkTextBuffer *txtbuf; - char title[256]; GtkStyle *style; xml = glade_xml_new(glade_file, "window1", NULL); @@ -210,9 +209,7 @@ void init_main_window(const gchar * glade_file) /*"style", PANGO_STYLE_OBLIQUE, */ NULL); - sprintf(title, _("Linux Kernel v%s Configuration"), - getenv("KERNELVERSION")); - gtk_window_set_title(GTK_WINDOW(main_wnd), title); + gtk_window_set_title(GTK_WINDOW(main_wnd), rootmenu.prompt->text); gtk_widget_show(main_wnd); } diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index cee4281..d433c7a 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -288,13 +288,9 @@ static void set_config_filename(const char *config_filename) { static char menu_backtitle[PATH_MAX+128]; int size; - struct symbol *sym; - sym = sym_lookup("KERNELVERSION", 0); - sym_calc_value(sym); size = snprintf(menu_backtitle, sizeof(menu_backtitle), - _("%s - Linux Kernel v%s Configuration"), - config_filename, sym_get_string_value(sym)); + "%s - %s", config_filename, rootmenu.prompt->text); if (size >= sizeof(menu_backtitle)) menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; set_dialog_backtitle(menu_backtitle); diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 801cc04..545e1af 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -633,13 +633,9 @@ static char menu_backtitle[PATH_MAX+128]; static const char *set_config_filename(const char *config_filename) { int size; - struct symbol *sym; - sym = sym_lookup("KERNELVERSION", 0); - sym_calc_value(sym); size = snprintf(menu_backtitle, sizeof(menu_backtitle), - _("%s - Linux Kernel v%s Configuration"), - config_filename, sym_get_string_value(sym)); + "%s - %s", config_filename, rootmenu.prompt->text); if (size >= sizeof(menu_backtitle)) menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index fe18f7e..06dd2e3 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1274,8 +1274,8 @@ ConfigMainWindow::ConfigMainWindow(void) char title[256]; QDesktopWidget *d = configApp->desktop(); - snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration%s"), - getenv("KERNELVERSION"), + snprintf(title, sizeof(title), "%s%s", + rootmenu.prompt->text, #if QT_VERSION < 0x040000 " (Qt3)" #else -- cgit v0.10.2 From ba6ff60d5eb47d52f1a5eb0bb6ffa751be838c46 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Sat, 4 Sep 2010 16:05:15 -0400 Subject: kconfig: don't emit warning upon rootmenu's prompt redefinition This silences the warning printed upon prompt redefinition for the rootmenu. We will encounter this redefinition when a "mainmenu" statement is specified and override the default prompt. Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 682045a..23acbdb 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -139,7 +139,7 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e while (isspace(*prompt)) prompt++; } - if (current_entry->prompt) + if (current_entry->prompt && current_entry != &rootmenu) prop_warn(prop, "prompt redefined"); current_entry->prompt = prop; } -- cgit v0.10.2 From 2e7a091833f014cac8a6b92573ca6cd2edd2753c Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Sat, 4 Sep 2010 16:03:30 -0400 Subject: kconfig: constify file name Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 6ee2e4f..648c609 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h @@ -18,7 +18,7 @@ extern "C" { struct file { struct file *next; struct file *parent; - char *name; + const char *name; int lineno; int flags; }; diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 5d5f187..753cdbd 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -76,7 +76,7 @@ FILE *zconf_fopen(const char *name); void zconf_initscan(const char *name); void zconf_nextfile(const char *name); int zconf_lineno(void); -char *zconf_curname(void); +const char *zconf_curname(void); /* conf.c */ void xfgets(char *str, int size, FILE *in); diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index d8f7236..2b02650 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -353,7 +353,7 @@ int zconf_lineno(void) return current_pos.lineno; } -char *zconf_curname(void) +const char *zconf_curname(void) { return current_pos.file ? current_pos.file->name : ""; } -- cgit v0.10.2 From e82dae9083c8ca97c0f6ba1f5d09591aff67bb4e Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Sat, 4 Sep 2010 16:09:26 -0400 Subject: kconfig: use the file's name of sourced file Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 2b02650..3dbaec1 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -304,9 +304,10 @@ void zconf_nextfile(const char *name) memset(buf, 0, sizeof(*buf)); current_buf->state = YY_CURRENT_BUFFER; - yyin = zconf_fopen(name); + yyin = zconf_fopen(file->name); if (!yyin) { - printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name); + printf("%s:%d: can't open file \"%s\"\n", + zconf_curname(), zconf_lineno(), file->name); exit(1); } yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); -- cgit v0.10.2 From c7abe8630ae63e90c2267c2c385a682e729e08be Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Sat, 4 Sep 2010 16:11:26 -0400 Subject: kconfig: expand file names This will allow to use the following construct in source files: config FOO string default "foo" source "$FOO/Kconfig" Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index 78b5c04..6330cc8 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c @@ -12,15 +12,18 @@ struct file *file_lookup(const char *name) { struct file *file; + const char *file_name = sym_expand_string_value(name); for (file = file_list; file; file = file->next) { - if (!strcmp(name, file->name)) + if (!strcmp(name, file->name)) { + free((void *)file_name); return file; + } } file = malloc(sizeof(*file)); memset(file, 0, sizeof(*file)); - file->name = strdup(name); + file->name = file_name; file->next = file_list; file_list = file; return file; -- cgit v0.10.2 From 838a2e55e6a4e9e8a10451ed2ef0f7a08dabdb04 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Sat, 4 Sep 2010 17:10:20 -0400 Subject: kbuild: migrate all arch to the kconfig mainmenu upgrade Signed-off-by: Arnaud Lacombe Reviewed-by: Sam Ravnborg Reviewed-by: Michal Marek diff --git a/Kconfig b/Kconfig new file mode 100644 index 0000000..c13f48d --- /dev/null +++ b/Kconfig @@ -0,0 +1,11 @@ +# +# For a description of the syntax of this configuration file, +# see Documentation/kbuild/kconfig-language.txt. +# +mainmenu "Linux/$ARCH $KERNELVERSION Kernel Configuration" + +config SRCARCH + string + option env="SRCARCH" + +source "arch/$SRCARCH/Kconfig" diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3e2e540..95808c1 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -1,7 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# config ALPHA bool default y diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 98922f7..c3f4fd9 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1,10 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - -mainmenu "Linux Kernel Configuration" - config ARM bool default y diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig index f2b3193..ead727e 100644 --- a/arch/avr32/Kconfig +++ b/arch/avr32/Kconfig @@ -1,10 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - -mainmenu "Linux Kernel Configuration" - config AVR32 def_bool y # With EMBEDDED=n, we get lots of stuff automatically selected diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index f66294b..7051c4c 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig @@ -1,10 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - -mainmenu "Blackfin Kernel Configuration" - config SYMBOL_PREFIX string default "_" diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index e25bf44..af8e982 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig @@ -1,10 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see the Configure script. -# - -mainmenu "Linux/CRIS Kernel Configuration" - config MMU bool default y diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index 4b5830b..0625679 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig @@ -1,7 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# config FRV bool default y @@ -64,8 +60,6 @@ config HZ int default 1000 -mainmenu "Fujitsu FR-V Kernel Configuration" - source "init/Kconfig" source "kernel/Kconfig.freezer" diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index 53cc669..3fe4d5a 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig @@ -1,10 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - -mainmenu "uClinux/h8300 (w/o MMU) Kernel Configuration" - config H8300 bool default y diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 9561082..09ce2ab 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -1,10 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - -mainmenu "IA-64 Linux Kernel Configuration" - source "init/Kconfig" source "kernel/Kconfig.freezer" diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig index 3a9319f..190270e 100644 --- a/arch/m32r/Kconfig +++ b/arch/m32r/Kconfig @@ -1,10 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - -mainmenu "Linux/M32R Kernel Configuration" - config M32R bool default y diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 2e3737b..1812aa0 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -1,7 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# config M68K bool default y @@ -65,8 +61,6 @@ config GENERIC_TIME config ARCH_USES_GETTIMEOFFSET def_bool y -mainmenu "Linux/68k Kernel Configuration" - source "init/Kconfig" source "kernel/Kconfig.freezer" diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig index efeb603..e86842d 100644 --- a/arch/m68knommu/Kconfig +++ b/arch/m68knommu/Kconfig @@ -1,10 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - -mainmenu "uClinux/68k (w/o MMU) Kernel Configuration" - config M68K bool default y diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 505a085..0c5f437 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -1,8 +1,3 @@ -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. - -mainmenu "Linux/Microblaze Kernel Configuration" - config MICROBLAZE def_bool y select HAVE_MEMBLOCK diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index cdaae94..3377167 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -12,8 +12,6 @@ config MIPS select HAVE_FUNCTION_GRAPH_TRACER select RTC_LIB if !MACH_LOONGSON -mainmenu "Linux/MIPS Kernel Configuration" - menu "Machine selection" config ZONE_DMA diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig index 1c4565a..7bd617c 100644 --- a/arch/mn10300/Kconfig +++ b/arch/mn10300/Kconfig @@ -1,10 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - -mainmenu "Linux Kernel Configuration" - config MN10300 def_bool y select HAVE_OPROFILE @@ -69,8 +62,6 @@ config HZ int default 1000 -mainmenu "Matsushita MN10300/AM33 Kernel Configuration" - source "init/Kconfig" source "kernel/Kconfig.freezer" diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 05a366a..82cec34 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -1,10 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - -mainmenu "Linux/PA-RISC Kernel Configuration" - config PARISC def_bool y select HAVE_IDE diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 2031a28..182743b 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -1,9 +1,3 @@ -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - -mainmenu "Linux/PowerPC Kernel Configuration" - source "arch/powerpc/platforms/Kconfig.cputype" config PPC32 diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index bee1c0f..3c4d4e6 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -1,8 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - config SCHED_MC def_bool y depends on SMP @@ -78,8 +73,6 @@ config VIRT_CPU_ACCOUNTING config ARCH_SUPPORTS_DEBUG_PAGEALLOC def_bool y -mainmenu "Linux Kernel Configuration" - config S390 def_bool y select USE_GENERIC_SMP_HELPERS if SMP diff --git a/arch/score/Kconfig b/arch/score/Kconfig index 55d413e..5cbc148 100644 --- a/arch/score/Kconfig +++ b/arch/score/Kconfig @@ -1,8 +1,3 @@ -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. - -mainmenu "Linux/SCORE Kernel Configuration" - menu "Machine selection" choice diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 82868fe..8ada475 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -1,10 +1,3 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - -mainmenu "Linux/SuperH Kernel Configuration" - config SUPERH def_bool y select EMBEDDED diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index c0015db..19aa7b2 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -1,9 +1,3 @@ -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - -mainmenu "Linux/SPARC Kernel Configuration" - config 64BIT bool "64-bit kernel" if ARCH = "sparc" default ARCH = "sparc64" diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common index 0d207e7..e90ca86 100644 --- a/arch/um/Kconfig.common +++ b/arch/um/Kconfig.common @@ -19,8 +19,6 @@ config MMU config NO_IOMEM def_bool y -mainmenu "Linux/Usermode Kernel Configuration" - config ISA bool diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index dcb0593..6c30b9e 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1,6 +1,3 @@ -# x86 configuration -mainmenu "Linux Kernel Configuration for x86" - # Select 32 or 64 bit config 64BIT bool "64-bit kernel" if ARCH = "x86" diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index ebe228d..9e4ef66 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -1,8 +1,3 @@ -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. - -mainmenu "Linux/Xtensa Kernel Configuration" - config FRAME_POINTER def_bool n diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index cef3f75..52c34b9 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -8,7 +8,7 @@ PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-c ifdef KBUILD_KCONFIG Kconfig := $(KBUILD_KCONFIG) else -Kconfig := arch/$(SRCARCH)/Kconfig +Kconfig := Kconfig endif xconfig: $(obj)/qconf -- cgit v0.10.2 From 8c41e5e363db55d91aa3b1cdce4ab02ad9821de7 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 18 Sep 2010 19:25:32 -0700 Subject: kconfig: fix menuconfig on debian lenny In 60f33b8 (kconfig: get rid of stray a.o, support ncursesw, 2006-01-15), support to link menuconfig with ncursesw library was added. To compute the linker command option -l, we check "libncursesw.{so,a,dylib}" to allow ncursesw to be used as a replacement ncurses. However, when checking what header file to include, we do not check /usr/include/ncursesw directory. Add /usr/include/ncursesw to the list of directories that are checked. With this patch, on my Debian Lenny box with libncursesw5-dev package but not libncurses5-dev package, I can say "make menuconfig". Signed-off-by: Junio C Hamano Acked-by: Sam Ravnborg Signed-off-by: Michal Marek diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh index fcef0f5..82cc3a8 100644 --- a/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -23,6 +23,8 @@ ccflags() 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 v0.10.2 From 8bea7548ee0223175bea5fddcc54af93bd252d9b Mon Sep 17 00:00:00 2001 From: Naohiro Aota Date: Fri, 1 Oct 2010 04:23:17 +0900 Subject: kconfig: Don't go out from read config loop when you read new symbol commit 8baefd30b5b0101aa07aa75da44a9eee881eed28 of linux-next replaced a `switch()' statement with some `if()' statements, but left `break's in the `switch()' statement untouched. This cause read config loop to exit and so "make oldconfig" is not much usable (see below). > $ make oldconfig > > scripts/kconfig/conf --oldconfig Kconfig > # > # using defaults found in /boot/config-2.6.34-ccs-r1 > # > * > * Restart config... > * > * > * General setup > * > Prompt for development and/or incomplete code/drivers (EXPERIMENTAL) [N/y/?] (NEW) (I've already have "CONFIG_EXPERIMENTAL=y" in the old config file. But that's not read here.) This patch should fix this problem. Signed-off-by: Naohiro Aota Signed-off-by: Michal Marek diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index f7d89d7..35c08ec 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -234,7 +234,7 @@ load: sym = sym_find(line + 2 + strlen(CONFIG_)); if (!sym) { sym_add_change_count(1); - break; + goto setsym; } } else { sym = sym_lookup(line + 2 + strlen(CONFIG_), 0); @@ -268,7 +268,7 @@ load: sym = sym_find(line + strlen(CONFIG_)); if (!sym) { sym_add_change_count(1); - break; + goto setsym; } } else { sym = sym_lookup(line + strlen(CONFIG_), 0); @@ -285,6 +285,7 @@ load: conf_warning("unexpected data"); continue; } +setsym: if (sym && sym_is_choice_value(sym)) { struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); switch (sym->def[def].tri) { -- cgit v0.10.2 From a01ebe154c03f6ad58a1ec1bda616032bfe232e0 Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Thu, 30 Sep 2010 22:17:48 +0200 Subject: kconfig: Propagate const Commit 2e7a091 made struct file->name a const char*, but forgot to constify all users of it. Reported-by: Stephen Rothwell Signed-off-by: Michal Marek diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c index dcc3fcc..e9d8e79 100644 --- a/scripts/kconfig/kxgettext.c +++ b/scripts/kconfig/kxgettext.c @@ -63,11 +63,11 @@ next: struct file_line { struct file_line *next; - char* file; - int lineno; + const char *file; + int lineno; }; -static struct file_line *file_line__new(char *file, int lineno) +static struct file_line *file_line__new(const char *file, int lineno) { struct file_line *self = malloc(sizeof(*self)); @@ -90,7 +90,8 @@ struct message { static struct message *message__list; -static struct message *message__new(const char *msg, char *option, char *file, int lineno) +static struct message *message__new(const char *msg, char *option, + const char *file, int lineno) { struct message *self = malloc(sizeof(*self)); @@ -130,7 +131,8 @@ static struct message *mesage__find(const char *msg) return m; } -static int message__add_file_line(struct message *self, char *file, int lineno) +static int message__add_file_line(struct message *self, const char *file, + int lineno) { int rc = -1; struct file_line *fl = file_line__new(file, lineno); @@ -145,7 +147,8 @@ out: return rc; } -static int message__add(const char *msg, char *option, char *file, int lineno) +static int message__add(const char *msg, char *option, const char *file, + int lineno) { int rc = 0; char bf[16384]; -- cgit v0.10.2 From 19c29f326075e2c66e34d98f2a0cf22901b2d8e9 Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Thu, 30 Sep 2010 22:21:12 +0200 Subject: kconfig: Fix realloc usage() Reported-by: Stephen Rothwell Signed-off-by: Michal Marek diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index dc5dcf2..c0efe10 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -878,7 +878,7 @@ const char *sym_expand_string_value(const char *in) newlen = strlen(res) + strlen(symval) + strlen(src); if (newlen > reslen) { reslen = newlen; - realloc(res, reslen); + res = realloc(res, reslen); } strcat(res, symval); -- cgit v0.10.2 From 1408b15b98635a13bad2e2a50b3c2ae2ccdf625b Mon Sep 17 00:00:00 2001 From: Will Newton Date: Wed, 22 Sep 2010 15:59:13 +0100 Subject: kconfig: Use PATH_MAX instead of 128 for path buffer sizes. This prevents the buffers being overflowed when using a config file with a long name. PATH_MAX is used elsewhere in the same file, so use it here as well. Signed-off-by: Will Newton Acked-by: WANG Cong Signed-off-by: Michal Marek diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 35c08ec..96110ea 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -535,7 +535,7 @@ int conf_write(const char *name) struct menu *menu; const char *basename; const char *str; - char dirname[128], tmpname[128], newname[128]; + char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1]; enum symbol_type type; time_t now; int use_timestamp = 1; @@ -654,7 +654,7 @@ next: static int conf_split_config(void) { const char *name; - char path[128]; + char path[PATH_MAX+1]; char *s, *d, c; struct symbol *sym; struct stat sb; -- cgit v0.10.2 From b1f7d6e1909c72338aa93a113d5844767434dacb Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Tue, 12 Oct 2010 15:12:23 +0200 Subject: Revert "kconfig: Temporarily disable dependency warnings" This reverts commit 71ebc01, which was a 2.6.36-only stopgap solution. Signed-off-by: Michal Marek diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index cb00568..c0efe10 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -350,7 +350,6 @@ void sym_calc_value(struct symbol *sym) } } calc_newval: -#if 0 if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) { fprintf(stderr, "warning: ("); expr_fprint(sym->rev_dep.expr, stderr); @@ -359,7 +358,6 @@ void sym_calc_value(struct symbol *sym) expr_fprint(sym->dir_dep.expr, stderr); fprintf(stderr, ")\n"); } -#endif newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri); } if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN) -- cgit v0.10.2 From b3235fe420edf7faf5e8e67b978b12d5524fb161 Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Fri, 1 Oct 2010 14:15:35 -0700 Subject: README: cite nconfig Signed-off-by: Andrea Gelmini Signed-off-by: Andrew Morton Signed-off-by: Michal Marek diff --git a/README b/README index 737838f..1b81d28 100644 --- a/README +++ b/README @@ -166,6 +166,7 @@ CONFIGURING the kernel: - Alternate configuration commands are: "make config" Plain text interface. "make menuconfig" Text based color menus, radiolists & dialogs. + "make nconfig" Enhanced text based color menus. "make xconfig" X windows (Qt) based configuration tool. "make gconfig" X windows (Gtk) based configuration tool. "make oldconfig" Default all questions based on the contents of -- cgit v0.10.2 From df4d303647ebe5e2f7e473e32ccef9f8549e9d45 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Wed, 27 Oct 2010 22:24:49 -0400 Subject: kbuild: convert `arch/tile' to the kconfig mainmenu upgrade Signed-off-by: Arnaud Lacombe Signed-off-by: Michal Marek diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index 1eb308c..d0cc5b4 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig @@ -113,8 +113,6 @@ config TILE # config HUGETLB_PAGE_SIZE_VARIABLE -mainmenu "Linux/TILE Kernel Configuration" - # Please note: TILE-Gx support is not yet finalized; this is # the preliminary support. TILE-Gx drivers are only provided # with the alpha or beta test versions for Tilera customers. -- cgit v0.10.2