summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2013-06-14 19:41:11 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2013-06-15 11:52:21 +0200
commit1d422d71122f6b0790b1ca39dabc21fa42b2adb1 (patch)
treefa60faf4a0ad4c07997b83ab520969c2f4c692c3
parentcebcdf8ca2ab11301f6b4c318cd69d6c1766afa8 (diff)
downloadptxdist-1d422d71122f6b0790b1ca39dabc21fa42b2adb1.tar.gz
ptxdist-1d422d71122f6b0790b1ca39dabc21fa42b2adb1.tar.xz
kconfig: update to v3.10-rc5
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--scripts/kconfig/conf.c19
-rw-r--r--scripts/kconfig/confdata.c59
-rw-r--r--scripts/kconfig/expr.c10
-rw-r--r--scripts/kconfig/expr.h5
-rw-r--r--scripts/kconfig/gconf.c2
-rw-r--r--scripts/kconfig/list.h131
-rw-r--r--scripts/kconfig/lkc.h8
-rw-r--r--scripts/kconfig/lkc_proto.h4
-rw-r--r--scripts/kconfig/lxdialog/check-lxdialog.sh7
-rw-r--r--scripts/kconfig/lxdialog/dialog.h8
-rw-r--r--scripts/kconfig/lxdialog/inputbox.c121
-rw-r--r--scripts/kconfig/lxdialog/menubox.c29
-rw-r--r--scripts/kconfig/lxdialog/util.c45
-rw-r--r--scripts/kconfig/mconf.c145
-rw-r--r--scripts/kconfig/menu.c64
-rwxr-xr-xscripts/kconfig/merge_config.sh28
-rw-r--r--scripts/kconfig/nconf.c340
-rw-r--r--scripts/kconfig/nconf.gui.c2
-rw-r--r--scripts/kconfig/qconf.cc1
-rw-r--r--scripts/kconfig/symbol.c12
-rw-r--r--scripts/kconfig/util.c23
-rw-r--r--scripts/kconfig/zconf.l8
-rw-r--r--scripts/kconfig/zconf.lex.c_shipped8
-rw-r--r--scripts/ptx-modifications/0001-conf-add-an-option-to-output-the-dependency-informat.patch17
-rw-r--r--scripts/ptx-modifications/0002-conf-don-t-output-autoconf-stuff.patch11
-rw-r--r--scripts/ptx-modifications/0003-Revert-kconfig-make-comments-stand-out-in-menuconfig.patch7
-rw-r--r--scripts/ptx-modifications/0004-Revert-kconfig-ignore-select-of-unknown-symbol.patch7
-rw-r--r--scripts/ptx-modifications/0005-nconf-remove-special-P_COMMENT-output.patch5
-rw-r--r--scripts/ptx-modifications/0006-mconf-fix-comment-on-exit.patch7
-rw-r--r--scripts/ptx-modifications/0007-kconfig-define-CIRCLEQ_-macros-when-needed.patch177
-rw-r--r--scripts/ptx-modifications/0008-kconfig-Fix-build-on-Darwin.patch34
-rw-r--r--scripts/ptx-modifications/series2
32 files changed, 802 insertions, 544 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index fbac5e8b1..7ecdc1490 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -13,6 +13,7 @@
#include <getopt.h>
#include <sys/stat.h>
#include <sys/time.h>
+#include <errno.h>
#include "lkc.h"
@@ -37,6 +38,7 @@ enum input_mode {
} input_mode = oldaskconfig;
static int indent = 1;
+static int tty_stdio;
static int valid_stdin = 1;
static int sync_kconfig;
static int conf_cnt;
@@ -109,6 +111,8 @@ static int conf_askvalue(struct symbol *sym, const char *def)
case oldaskconfig:
fflush(stdout);
xfgets(line, 128, stdin);
+ if (!tty_stdio)
+ printf("\n");
return 1;
default:
break;
@@ -528,6 +532,8 @@ int main(int ac, char **av)
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ tty_stdio = isatty(0) && isatty(1) && isatty(2);
+
while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) {
input_mode = (enum input_mode)opt;
switch (opt) {
@@ -546,14 +552,23 @@ int main(int ac, char **av)
{
struct timeval now;
unsigned int seed;
+ char *seed_env;
/*
* Use microseconds derived seed,
* compensate for systems where it may be zero
*/
gettimeofday(&now, NULL);
-
seed = (unsigned int)((now.tv_sec + 1) * (now.tv_usec + 1));
+
+ seed_env = getenv("KCONFIG_SEED");
+ if( seed_env && *seed_env ) {
+ char *endp;
+ int tmp = (int)strtol(seed_env, &endp, 10);
+ if (*endp == '\0') {
+ seed = tmp;
+ }
+ }
srand(seed);
break;
}
@@ -658,7 +673,7 @@ int main(int ac, char **av)
return 1;
}
}
- valid_stdin = isatty(0) && isatty(1) && isatty(2);
+ valid_stdin = tty_stdio;
}
switch (input_mode) {
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index e0dd10b97..928cb7b78 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -1108,10 +1108,54 @@ static void set_all_choice_values(struct symbol *csym)
void conf_set_all_new_symbols(enum conf_def_mode mode)
{
struct symbol *sym, *csym;
- int i, cnt;
+ int i, cnt, pby, pty, ptm; /* pby: probability of boolean = y
+ * pty: probability of tristate = y
+ * ptm: probability of tristate = m
+ */
+
+ pby = 50; pty = ptm = 33; /* can't go as the default in switch-case
+ * below, otherwise gcc whines about
+ * -Wmaybe-uninitialized */
+ if (mode == def_random) {
+ int n, p[3];
+ char *env = getenv("KCONFIG_PROBABILITY");
+ n = 0;
+ while( env && *env ) {
+ char *endp;
+ int tmp = strtol( env, &endp, 10 );
+ if( tmp >= 0 && tmp <= 100 ) {
+ p[n++] = tmp;
+ } else {
+ errno = ERANGE;
+ perror( "KCONFIG_PROBABILITY" );
+ exit( 1 );
+ }
+ env = (*endp == ':') ? endp+1 : endp;
+ if( n >=3 ) {
+ break;
+ }
+ }
+ switch( n ) {
+ case 1:
+ pby = p[0]; ptm = pby/2; pty = pby-ptm;
+ break;
+ case 2:
+ pty = p[0]; ptm = p[1]; pby = pty + ptm;
+ break;
+ case 3:
+ pby = p[0]; pty = p[1]; ptm = p[2];
+ break;
+ }
+
+ if( pty+ptm > 100 ) {
+ errno = ERANGE;
+ perror( "KCONFIG_PROBABILITY" );
+ exit( 1 );
+ }
+ }
for_all_symbols(i, sym) {
- if (sym_has_value(sym))
+ if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID))
continue;
switch (sym_get_type(sym)) {
case S_BOOLEAN:
@@ -1127,8 +1171,15 @@ void conf_set_all_new_symbols(enum conf_def_mode mode)
sym->def[S_DEF_USER].tri = no;
break;
case def_random:
- cnt = sym_get_type(sym) == S_TRISTATE ? 3 : 2;
- sym->def[S_DEF_USER].tri = (tristate)(rand() % cnt);
+ sym->def[S_DEF_USER].tri = no;
+ cnt = rand() % 100;
+ if (sym->type == S_TRISTATE) {
+ if (cnt < pty)
+ sym->def[S_DEF_USER].tri = yes;
+ else if (cnt < (pty+ptm))
+ sym->def[S_DEF_USER].tri = mod;
+ } else if (cnt < pby)
+ sym->def[S_DEF_USER].tri = yes;
break;
default:
continue;
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index 290ce41f8..d6626521f 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -13,7 +13,7 @@
struct expr *expr_alloc_symbol(struct symbol *sym)
{
- struct expr *e = calloc(1, sizeof(*e));
+ struct expr *e = xcalloc(1, sizeof(*e));
e->type = E_SYMBOL;
e->left.sym = sym;
return e;
@@ -21,7 +21,7 @@ struct expr *expr_alloc_symbol(struct symbol *sym)
struct expr *expr_alloc_one(enum expr_type type, struct expr *ce)
{
- struct expr *e = calloc(1, sizeof(*e));
+ struct expr *e = xcalloc(1, sizeof(*e));
e->type = type;
e->left.expr = ce;
return e;
@@ -29,7 +29,7 @@ struct expr *expr_alloc_one(enum expr_type type, struct expr *ce)
struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2)
{
- struct expr *e = calloc(1, sizeof(*e));
+ struct expr *e = xcalloc(1, sizeof(*e));
e->type = type;
e->left.expr = e1;
e->right.expr = e2;
@@ -38,7 +38,7 @@ struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e
struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2)
{
- struct expr *e = calloc(1, sizeof(*e));
+ struct expr *e = xcalloc(1, sizeof(*e));
e->type = type;
e->left.sym = s1;
e->right.sym = s2;
@@ -66,7 +66,7 @@ struct expr *expr_copy(const struct expr *org)
if (!org)
return NULL;
- e = malloc(sizeof(*org));
+ e = xmalloc(sizeof(*org));
memcpy(e, org, sizeof(*org));
switch (org->type) {
case E_SYMBOL:
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index 041b08ef3..cdd48600e 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -12,10 +12,10 @@ extern "C" {
#include <assert.h>
#include <stdio.h>
+#include "list.h"
#ifndef __cplusplus
#include <stdbool.h>
#endif
-#include "missing.h"
struct file {
struct file *next;
@@ -175,12 +175,11 @@ struct menu {
#define MENU_ROOT 0x0002
struct jump_key {
- CIRCLEQ_ENTRY(jump_key) entries;
+ struct list_head entries;
size_t offset;
struct menu *target;
int index;
};
-CIRCLEQ_HEAD(jk_head, jump_key);
#define JUMP_NB 9
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index adc230638..f2bee70e2 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -10,6 +10,7 @@
# include <config.h>
#endif
+#include <stdlib.h>
#include "lkc.h"
#include "images.c"
@@ -22,7 +23,6 @@
#include <string.h>
#include <unistd.h>
#include <time.h>
-#include <stdlib.h>
//#define DEBUG
diff --git a/scripts/kconfig/list.h b/scripts/kconfig/list.h
new file mode 100644
index 000000000..685d80e1b
--- /dev/null
+++ b/scripts/kconfig/list.h
@@ -0,0 +1,131 @@
+#ifndef LIST_H
+#define LIST_H
+
+/*
+ * Copied from include/linux/...
+ */
+
+#undef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+
+/**
+ * container_of - cast a member of a structure out to the containing structure
+ * @ptr: the pointer to the member.
+ * @type: the type of the container struct this is embedded in.
+ * @member: the name of the member within the struct.
+ *
+ */
+#define container_of(ptr, type, member) ({ \
+ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+ (type *)( (char *)__mptr - offsetof(type,member) );})
+
+
+struct list_head {
+ struct list_head *next, *prev;
+};
+
+
+#define LIST_HEAD_INIT(name) { &(name), &(name) }
+
+#define LIST_HEAD(name) \
+ struct list_head name = LIST_HEAD_INIT(name)
+
+/**
+ * list_entry - get the struct for this entry
+ * @ptr: the &struct list_head pointer.
+ * @type: the type of the struct this is embedded in.
+ * @member: the name of the list_struct within the struct.
+ */
+#define list_entry(ptr, type, member) \
+ container_of(ptr, type, member)
+
+/**
+ * list_for_each_entry - iterate over list of given type
+ * @pos: the type * to use as a loop cursor.
+ * @head: the head for your list.
+ * @member: the name of the list_struct within the struct.
+ */
+#define list_for_each_entry(pos, head, member) \
+ for (pos = list_entry((head)->next, typeof(*pos), member); \
+ &pos->member != (head); \
+ pos = list_entry(pos->member.next, typeof(*pos), member))
+
+/**
+ * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
+ * @pos: the type * to use as a loop cursor.
+ * @n: another type * to use as temporary storage
+ * @head: the head for your list.
+ * @member: the name of the list_struct within the struct.
+ */
+#define list_for_each_entry_safe(pos, n, head, member) \
+ for (pos = list_entry((head)->next, typeof(*pos), member), \
+ n = list_entry(pos->member.next, typeof(*pos), member); \
+ &pos->member != (head); \
+ pos = n, n = list_entry(n->member.next, typeof(*n), member))
+
+/**
+ * list_empty - tests whether a list is empty
+ * @head: the list to test.
+ */
+static inline int list_empty(const struct list_head *head)
+{
+ return head->next == head;
+}
+
+/*
+ * Insert a new entry between two known consecutive entries.
+ *
+ * This is only for internal list manipulation where we know
+ * the prev/next entries already!
+ */
+static inline void __list_add(struct list_head *_new,
+ struct list_head *prev,
+ struct list_head *next)
+{
+ next->prev = _new;
+ _new->next = next;
+ _new->prev = prev;
+ prev->next = _new;
+}
+
+/**
+ * list_add_tail - add a new entry
+ * @new: new entry to be added
+ * @head: list head to add it before
+ *
+ * Insert a new entry before the specified head.
+ * This is useful for implementing queues.
+ */
+static inline void list_add_tail(struct list_head *_new, struct list_head *head)
+{
+ __list_add(_new, head->prev, head);
+}
+
+/*
+ * Delete a list entry by making the prev/next entries
+ * point to each other.
+ *
+ * This is only for internal list manipulation where we know
+ * the prev/next entries already!
+ */
+static inline void __list_del(struct list_head *prev, struct list_head *next)
+{
+ next->prev = prev;
+ prev->next = next;
+}
+
+#define LIST_POISON1 ((void *) 0x00100100)
+#define LIST_POISON2 ((void *) 0x00200200)
+/**
+ * list_del - deletes entry from list.
+ * @entry: the element to delete from the list.
+ * Note: list_empty() on entry does not return true after this, the entry is
+ * in an undefined state.
+ */
+static inline void list_del(struct list_head *entry)
+{
+ __list_del(entry->prev, entry->next);
+ entry->next = (struct list_head*)LIST_POISON1;
+ entry->prev = (struct list_head*)LIST_POISON2;
+}
+#endif
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index c18f2bd9c..f8aee5fc6 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -39,6 +39,12 @@ extern "C" {
#ifndef CONFIG_
#define CONFIG_ "CONFIG_"
#endif
+static inline const char *CONFIG_prefix(void)
+{
+ return getenv( "CONFIG_" ) ?: CONFIG_;
+}
+#undef CONFIG_
+#define CONFIG_ CONFIG_prefix()
#define TF_COMMAND 0x0001
#define TF_PARAM 0x0002
@@ -116,6 +122,8 @@ void menu_set_type(int type);
/* util.c */
struct file *file_lookup(const char *name);
int file_write_dep(const char *name);
+void *xmalloc(size_t size);
+void *xcalloc(size_t nmemb, size_t size);
struct gstr {
size_t len;
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h
index 1d1c08537..ef1a7381f 100644
--- a/scripts/kconfig/lkc_proto.h
+++ b/scripts/kconfig/lkc_proto.h
@@ -21,9 +21,9 @@ P(menu_get_root_menu,struct menu *,(struct menu *menu));
P(menu_get_parent_menu,struct menu *,(struct menu *menu));
P(menu_has_help,bool,(struct menu *menu));
P(menu_get_help,const char *,(struct menu *menu));
-P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct jk_head
+P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct list_head
*head));
-P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct jk_head
+P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct list_head
*head));
P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help));
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index c8e8a7154..9d2a4c585 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -4,6 +4,8 @@
# What library to link
ldflags()
{
+ pkg-config --libs ncursesw 2>/dev/null && exit
+ pkg-config --libs ncurses 2>/dev/null && exit
for ext in so a dll.a dylib ; do
for lib in ncursesw ncurses curses ; do
$cc -print-file-name=lib${lib}.${ext} | grep -q /
@@ -20,11 +22,12 @@ ldflags()
ccflags()
{
if [ -f /usr/include/ncursesw/curses.h ]; then
- echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"'
+ echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
+ echo ' -DNCURSES_WIDECHAR=1'
elif [ -f /usr/include/ncurses/ncurses.h ]; then
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
elif [ -f /usr/include/ncurses/curses.h ]; then
- echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"'
+ echo '-I/usr/include/ncurses -DCURSES_LOC="<curses.h>"'
elif [ -f /usr/include/ncurses.h ]; then
echo '-DCURSES_LOC="<ncurses.h>"'
else
diff --git a/scripts/kconfig/lxdialog/dialog.h b/scripts/kconfig/lxdialog/dialog.h
index ee17a5264..109933707 100644
--- a/scripts/kconfig/lxdialog/dialog.h
+++ b/scripts/kconfig/lxdialog/dialog.h
@@ -106,8 +106,14 @@ struct dialog_color {
int hl; /* highlight this item */
};
+struct subtitle_list {
+ struct subtitle_list *next;
+ const char *text;
+};
+
struct dialog_info {
const char *backtitle;
+ struct subtitle_list *subtitles;
struct dialog_color screen;
struct dialog_color shadow;
struct dialog_color dialog;
@@ -196,6 +202,7 @@ int on_key_resize(void);
int init_dialog(const char *backtitle);
void set_dialog_backtitle(const char *backtitle);
+void set_dialog_subtitles(struct subtitle_list *subtitles);
void end_dialog(int x, int y);
void attr_clear(WINDOW * win, int height, int width, chtype attr);
void dialog_clear(void);
@@ -221,7 +228,6 @@ int dialog_menu(const char *title, const char *prompt,
const void *selected, int *s_scroll);
int dialog_checklist(const char *title, const char *prompt, int height,
int width, int list_height);
-extern char dialog_input_result[];
int dialog_inputbox(const char *title, const char *prompt, int height,
int width, const char *init);
diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c
index dd8e587c5..21404a04d 100644
--- a/scripts/kconfig/lxdialog/inputbox.c
+++ b/scripts/kconfig/lxdialog/inputbox.c
@@ -45,7 +45,8 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
const char *init)
{
int i, x, y, box_y, box_x, box_width;
- int input_x = 0, scroll = 0, key = 0, button = -1;
+ int input_x = 0, key = 0, button = -1;
+ int show_x, len, pos;
char *instr = dialog_input_result;
WINDOW *dialog;
@@ -97,14 +98,17 @@ do_resize:
wmove(dialog, box_y, box_x);
wattrset(dialog, dlg.inputbox.atr);
- input_x = strlen(instr);
+ len = strlen(instr);
+ pos = len;
- if (input_x >= box_width) {
- scroll = input_x - box_width + 1;
+ if (len >= box_width) {
+ show_x = len - box_width + 1;
input_x = box_width - 1;
for (i = 0; i < box_width - 1; i++)
- waddch(dialog, instr[scroll + i]);
+ waddch(dialog, instr[show_x + i]);
} else {
+ show_x = 0;
+ input_x = len;
waddstr(dialog, instr);
}
@@ -121,45 +125,104 @@ do_resize:
case KEY_UP:
case KEY_DOWN:
break;
- case KEY_LEFT:
- continue;
- case KEY_RIGHT:
- continue;
case KEY_BACKSPACE:
case 127:
- if (input_x || scroll) {
+ if (pos) {
wattrset(dialog, dlg.inputbox.atr);
- if (!input_x) {
- scroll = scroll < box_width - 1 ? 0 : scroll - (box_width - 1);
- wmove(dialog, box_y, box_x);
- for (i = 0; i < box_width; i++)
- waddch(dialog,
- instr[scroll + input_x + i] ?
- instr[scroll + input_x + i] : ' ');
- input_x = strlen(instr) - scroll;
+ if (input_x == 0) {
+ show_x--;
} else
input_x--;
- instr[scroll + input_x] = '\0';
- mvwaddch(dialog, box_y, input_x + box_x, ' ');
+
+ if (pos < len) {
+ for (i = pos - 1; i < len; i++) {
+ instr[i] = instr[i+1];
+ }
+ }
+
+ pos--;
+ len--;
+ instr[len] = '\0';
+ wmove(dialog, box_y, box_x);
+ for (i = 0; i < box_width; i++) {
+ if (!instr[show_x + i]) {
+ waddch(dialog, ' ');
+ break;
+ }
+ waddch(dialog, instr[show_x + i]);
+ }
wmove(dialog, box_y, input_x + box_x);
wrefresh(dialog);
}
continue;
+ case KEY_LEFT:
+ if (pos > 0) {
+ if (input_x > 0) {
+ wmove(dialog, box_y, --input_x + box_x);
+ } else if (input_x == 0) {
+ show_x--;
+ wmove(dialog, box_y, box_x);
+ for (i = 0; i < box_width; i++) {
+ if (!instr[show_x + i]) {
+ waddch(dialog, ' ');
+ break;
+ }
+ waddch(dialog, instr[show_x + i]);
+ }
+ wmove(dialog, box_y, box_x);
+ }
+ pos--;
+ }
+ continue;
+ case KEY_RIGHT:
+ if (pos < len) {
+ if (input_x < box_width - 1) {
+ wmove(dialog, box_y, ++input_x + box_x);
+ } else if (input_x == box_width - 1) {
+ show_x++;
+ wmove(dialog, box_y, box_x);
+ for (i = 0; i < box_width; i++) {
+ if (!instr[show_x + i]) {
+ waddch(dialog, ' ');
+ break;
+ }
+ waddch(dialog, instr[show_x + i]);
+ }
+ wmove(dialog, box_y, input_x + box_x);
+ }
+ pos++;
+ }
+ continue;
default:
if (key < 0x100 && isprint(key)) {
- if (scroll + input_x < MAX_LEN) {
+ if (len < MAX_LEN) {
wattrset(dialog, dlg.inputbox.atr);
- instr[scroll + input_x] = key;
- instr[scroll + input_x + 1] = '\0';
+ if (pos < len) {
+ for (i = len; i > pos; i--)
+ instr[i] = instr[i-1];
+ instr[pos] = key;
+ } else {
+ instr[len] = key;
+ }
+ pos++;
+ len++;
+ instr[len] = '\0';
+
if (input_x == box_width - 1) {
- scroll++;
- wmove(dialog, box_y, box_x);
- for (i = 0; i < box_width - 1; i++)
- waddch(dialog, instr [scroll + i]);
+ show_x++;
} else {
- wmove(dialog, box_y, input_x++ + box_x);
- waddch(dialog, key);
+ input_x++;
+ }
+
+ wmove(dialog, box_y, box_x);
+ for (i = 0; i < box_width; i++) {
+ if (!instr[show_x + i]) {
+ waddch(dialog, ' ');
+ break;
+ }
+ waddch(dialog, instr[show_x + i]);
}
+ wmove(dialog, box_y, input_x + box_x);
wrefresh(dialog);
} else
flash(); /* Alarm user about overflow */
diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
index 1d604738f..38cd69c56 100644
--- a/scripts/kconfig/lxdialog/menubox.c
+++ b/scripts/kconfig/lxdialog/menubox.c
@@ -26,7 +26,7 @@
*
* *) A bugfix for the Page-Down problem
*
- * *) Formerly when I used Page Down and Page Up, the cursor would be set
+ * *) Formerly when I used Page Down and Page Up, the cursor would be set
* to the first position in the menu box. Now lxdialog is a bit
* smarter and works more like other menu systems (just have a look at
* it).
@@ -154,12 +154,14 @@ static void print_arrows(WINDOW * win, int item_no, int scroll, int y, int x,
*/
static void print_buttons(WINDOW * win, int height, int width, int selected)
{
- int x = width / 2 - 16;
+ int x = width / 2 - 28;
int y = height - 2;
print_button(win, gettext("Select"), y, x, selected == 0);
print_button(win, gettext(" Exit "), y, x + 12, selected == 1);
print_button(win, gettext(" Help "), y, x + 24, selected == 2);
+ print_button(win, gettext(" Save "), y, x + 36, selected == 3);
+ print_button(win, gettext(" Load "), y, x + 48, selected == 4);
wmove(win, y, x + 1 + 12 * selected);
wrefresh(win);
@@ -301,10 +303,11 @@ do_resize:
}
}
- if (i < max_choice ||
- key == KEY_UP || key == KEY_DOWN ||
- key == '-' || key == '+' ||
- key == KEY_PPAGE || key == KEY_NPAGE) {
+ if (item_count() != 0 &&
+ (i < max_choice ||
+ key == KEY_UP || key == KEY_DOWN ||
+ key == '-' || key == '+' ||
+ key == KEY_PPAGE || key == KEY_NPAGE)) {
/* Remove highligt of current item */
print_item(scroll + choice, choice, FALSE);
@@ -372,7 +375,7 @@ do_resize:
case TAB:
case KEY_RIGHT:
button = ((key == KEY_LEFT ? --button : ++button) < 0)
- ? 2 : (button > 2 ? 0 : button);
+ ? 4 : (button > 4 ? 0 : button);
print_buttons(dialog, height, width, button);
wrefresh(menu);
@@ -399,17 +402,17 @@ do_resize:
return 2;
case 's':
case 'y':
- return 3;
+ return 5;
case 'n':
- return 4;
+ return 6;
case 'm':
- return 5;
+ return 7;
case ' ':
- return 6;
+ return 8;
case '/':
- return 7;
+ return 9;
case 'z':
- return 8;
+ return 10;
case '\n':
return button;
}
diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c
index 109d53117..a0e97c299 100644
--- a/scripts/kconfig/lxdialog/util.c
+++ b/scripts/kconfig/lxdialog/util.c
@@ -257,12 +257,48 @@ void dialog_clear(void)
attr_clear(stdscr, LINES, COLS, dlg.screen.atr);
/* Display background title if it exists ... - SLH */
if (dlg.backtitle != NULL) {
- int i;
+ int i, len = 0, skip = 0;
+ struct subtitle_list *pos;
wattrset(stdscr, dlg.screen.atr);
mvwaddstr(stdscr, 0, 1, (char *)dlg.backtitle);
+
+ for (pos = dlg.subtitles; pos != NULL; pos = pos->next) {
+ /* 3 is for the arrow and spaces */
+ len += strlen(pos->text) + 3;
+ }
+
wmove(stdscr, 1, 1);
- for (i = 1; i < COLS - 1; i++)
+ if (len > COLS - 2) {
+ const char *ellipsis = "[...] ";
+ waddstr(stdscr, ellipsis);
+ skip = len - (COLS - 2 - strlen(ellipsis));
+ }
+
+ for (pos = dlg.subtitles; pos != NULL; pos = pos->next) {
+ if (skip == 0)
+ waddch(stdscr, ACS_RARROW);
+ else
+ skip--;
+
+ if (skip == 0)
+ waddch(stdscr, ' ');
+ else
+ skip--;
+
+ if (skip < strlen(pos->text)) {
+ waddstr(stdscr, pos->text + skip);
+ skip = 0;
+ } else
+ skip -= strlen(pos->text);
+
+ if (skip == 0)
+ waddch(stdscr, ' ');
+ else
+ skip--;
+ }
+
+ for (i = len + 1; i < COLS - 1; i++)
waddch(stdscr, ACS_HLINE);
}
wnoutrefresh(stdscr);
@@ -302,6 +338,11 @@ void set_dialog_backtitle(const char *backtitle)
dlg.backtitle = backtitle;
}
+void set_dialog_subtitles(struct subtitle_list *subtitles)
+{
+ dlg.subtitles = subtitles;
+}
+
/*
* End using dialog functions.
*/
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 0fe09e3c7..5ce66af2b 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -280,6 +280,7 @@ static struct menu *current_menu;
static int child_count;
static int single_menu_mode;
static int show_all_options;
+static int save_and_exit;
static void conf(struct menu *menu, struct menu *active_menu);
static void conf_choice(struct menu *menu);
@@ -310,9 +311,53 @@ static void set_config_filename(const char *config_filename)
filename[sizeof(filename)-1] = '\0';
}
+struct subtitle_part {
+ struct list_head entries;
+ const char *text;
+};
+static LIST_HEAD(trail);
+
+static struct subtitle_list *subtitles;
+static void set_subtitle(void)
+{
+ struct subtitle_part *sp;
+ struct subtitle_list *pos, *tmp;
+
+ for (pos = subtitles; pos != NULL; pos = tmp) {
+ tmp = pos->next;
+ free(pos);
+ }
+
+ subtitles = NULL;
+ list_for_each_entry(sp, &trail, entries) {
+ if (sp->text) {
+ if (pos) {
+ pos->next = xcalloc(sizeof(*pos), 1);
+ pos = pos->next;
+ } else {
+ subtitles = pos = xcalloc(sizeof(*pos), 1);
+ }
+ pos->text = sp->text;
+ }
+ }
+
+ set_dialog_subtitles(subtitles);
+}
+
+static void reset_subtitle(void)
+{
+ struct subtitle_list *pos, *tmp;
+
+ for (pos = subtitles; pos != NULL; pos = tmp) {
+ tmp = pos->next;
+ free(pos);
+ }
+ subtitles = NULL;
+ set_dialog_subtitles(subtitles);
+}
struct search_data {
- struct jk_head *head;
+ struct list_head *head;
struct menu **targets;
int *keys;
};
@@ -323,7 +368,7 @@ static void update_text(char *buf, size_t start, size_t end, void *_data)
struct jump_key *pos;
int k = 0;
- CIRCLEQ_FOREACH(pos, data->head, entries) {
+ list_for_each_entry(pos, data->head, entries) {
if (pos->offset >= start && pos->offset < end) {
char header[4];
@@ -348,15 +393,21 @@ static void search_conf(void)
{
struct symbol **sym_arr;
struct gstr res;
+ struct gstr title;
char *dialog_input;
int dres, vscroll = 0, hscroll = 0;
bool again;
+ struct gstr sttext;
+ struct subtitle_part stpart;
+
+ title = str_new();
+ str_printf( &title, _("Enter %s (sub)string to search for "
+ "(with or without \"%s\")"), CONFIG_, CONFIG_);
again:
dialog_clear();
dres = dialog_inputbox(_("Search Configuration Parameter"),
- _("Enter " CONFIG_ " (sub)string to search for "
- "(with or without \"" CONFIG_ "\")"),
+ str_get(&title),
10, 75, "");
switch (dres) {
case 0:
@@ -365,6 +416,7 @@ again:
show_helptext(_("Search Configuration"), search_help);
goto again;
default:
+ str_free(&title);
return;
}
@@ -373,9 +425,14 @@ again:
if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0)
dialog_input += strlen(CONFIG_);
+ sttext = str_new();
+ str_printf(&sttext, "Search (%s)", dialog_input_result);
+ stpart.text = str_get(&sttext);
+ list_add_tail(&stpart.entries, &trail);
+
sym_arr = sym_re_search(dialog_input);
do {
- struct jk_head head = CIRCLEQ_HEAD_INITIALIZER(head);
+ LIST_HEAD(head);
struct menu *targets[JUMP_NB];
int keys[JUMP_NB + 1], i;
struct search_data data = {
@@ -383,8 +440,10 @@ again:
.targets = targets,
.keys = keys,
};
+ struct jump_key *pos, *tmp;
res = get_relations_str(sym_arr, &head);
+ set_subtitle();
dres = show_textbox_ext(_("Search Results"), (char *)
str_get(&res), 0, 0, keys, &vscroll,
&hscroll, &update_text, (void *)
@@ -396,8 +455,13 @@ again:
again = true;
}
str_free(&res);
+ list_for_each_entry_safe(pos, tmp, &head, entries)
+ free(pos);
} while (again);
free(sym_arr);
+ str_free(&title);
+ list_del(trail.prev);
+ str_free(&sttext);
}
static void build_conf(struct menu *menu)
@@ -574,35 +638,36 @@ static void conf(struct menu *menu, struct menu *active_menu)
{
struct menu *submenu;
const char *prompt = menu_get_prompt(menu);
+ struct subtitle_part stpart;
struct symbol *sym;
int res;
int s_scroll = 0;
+ if (menu != &rootmenu)
+ stpart.text = menu_get_prompt(menu);
+ else
+ stpart.text = NULL;
+ list_add_tail(&stpart.entries, &trail);
+
while (1) {
item_reset();
current_menu = menu;
build_conf(menu);
if (!child_count)
break;
- if (menu == &rootmenu) {
- item_make("--- ");
- item_set_tag(':');
- item_make(_(" Load an Alternate Configuration File"));
- item_set_tag('L');
- item_make(_(" Save an Alternate Configuration File"));
- item_set_tag('S');
- }
+ set_subtitle();
dialog_clear();
res = dialog_menu(prompt ? _(prompt) : _("Main Menu"),
_(menu_instructions),
active_menu, &s_scroll);
if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL)
break;
- if (!item_activate_selected())
- continue;
- if (!item_tag())
- continue;
-
+ if (item_count() != 0) {
+ if (!item_activate_selected())
+ continue;
+ if (!item_tag())
+ continue;
+ }
submenu = item_data();
active_menu = item_data();
if (submenu)
@@ -628,21 +693,25 @@ static void conf(struct menu *menu, struct menu *active_menu)
case 's':
conf_string(submenu);
break;
- case 'L':
- conf_load();
- break;
- case 'S':
- conf_save();
- break;
}
break;
case 2:
if (sym)
show_help(submenu);
- else
+ else {
+ reset_subtitle();
show_helptext(_("README"), _(mconf_readme));
+ }
break;
case 3:
+ reset_subtitle();
+ conf_save();
+ break;
+ case 4:
+ reset_subtitle();
+ conf_load();
+ break;
+ case 5:
if (item_is_tag('t')) {
if (sym_set_tristate_value(sym, yes))
break;
@@ -650,28 +719,30 @@ static void conf(struct menu *menu, struct menu *active_menu)
show_textbox(NULL, setmod_text, 6, 74);
}
break;
- case 4:
+ case 6:
if (item_is_tag('t'))
sym_set_tristate_value(sym, no);
break;
- case 5:
+ case 7:
if (item_is_tag('t'))
sym_set_tristate_value(sym, mod);
break;
- case 6:
+ case 8:
if (item_is_tag('t'))
sym_toggle_tristate_value(sym);
else if (item_is_tag('m'))
conf(submenu, NULL);
break;
- case 7:
+ case 9:
search_conf();
break;
- case 8:
+ case 10:
show_all_options = !show_all_options;
break;
}
}
+
+ list_del(trail.prev);
}
static int show_textbox_ext(const char *title, char *text, int r, int c, int
@@ -694,6 +765,17 @@ static void show_helptext(const char *title, const char *text)
show_textbox(title, text, 0, 0);
}
+static void conf_message_callback(const char *fmt, va_list ap)
+{
+ char buf[PATH_MAX+1];
+
+ vsnprintf(buf, sizeof(buf), fmt, ap);
+ if (save_and_exit)
+ printf("%s", buf);
+ else
+ show_textbox(NULL, buf, 6, 60);
+}
+
static void show_help(struct menu *menu)
{
struct gstr help = str_new();
@@ -862,6 +944,8 @@ static int handle_exit(void)
{
int res;
+ save_and_exit = 1;
+ reset_subtitle();
dialog_clear();
if (conf_get_changed())
res = dialog_yesno(NULL,
@@ -933,6 +1017,7 @@ int main(int ac, char **av)
}
set_config_filename(conf_get_configname());
+ conf_set_message_callback(conf_message_callback);
do {
conf(&rootmenu, NULL);
res = handle_exit();
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 5d5ff1642..395521c16 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -48,7 +48,7 @@ void menu_add_entry(struct symbol *sym)
{
struct menu *menu;
- menu = malloc(sizeof(*menu));
+ menu = xmalloc(sizeof(*menu));
memset(menu, 0, sizeof(*menu));
menu->sym = sym;
menu->parent = current_menu;
@@ -146,11 +146,24 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e
struct menu *menu = current_entry;
while ((menu = menu->parent) != NULL) {
+ struct expr *dup_expr;
+
if (!menu->visibility)
continue;
+ /*
+ * Do not add a reference to the
+ * menu's visibility expression but
+ * use a copy of it. Otherwise the
+ * expression reduction functions
+ * will modify expressions that have
+ * multiple references which can
+ * cause unwanted side effects.
+ */
+ dup_expr = expr_copy(menu->visibility);
+
prop->visible.expr
= expr_alloc_and(prop->visible.expr,
- menu->visibility);
+ dup_expr);
}
}
@@ -511,20 +524,13 @@ const char *menu_get_help(struct menu *menu)
}
static void get_prompt_str(struct gstr *r, struct property *prop,
- struct jk_head *head)
+ struct list_head *head)
{
int i, j;
struct menu *submenu[8], *menu, *location = NULL;
struct jump_key *jump;
str_printf(r, _("Prompt: %s\n"), _(prop->text));
- str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name,
- prop->menu->lineno);
- if (!expr_is_yes(prop->visible.expr)) {
- str_append(r, _(" Depends on: "));
- expr_gstr_print(prop->visible.expr, r);
- str_append(r, "\n");
- }
menu = prop->menu->parent;
for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
bool accessible = menu_is_visible(menu);
@@ -534,7 +540,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
location = menu;
}
if (head && location) {
- jump = malloc(sizeof(struct jump_key));
+ jump = xmalloc(sizeof(struct jump_key));
if (menu_is_visible(prop->menu)) {
/*
@@ -547,12 +553,13 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
} else
jump->target = location;
- if (CIRCLEQ_EMPTY(head))
+ if (list_empty(head))
jump->index = 0;
else
- jump->index = CIRCLEQ_LAST(head)->index + 1;
+ jump->index = list_entry(head->prev, struct jump_key,
+ entries)->index + 1;
- CIRCLEQ_INSERT_TAIL(head, jump, entries);
+ list_add_tail(&jump->entries, head);
}
if (i > 0) {
@@ -574,9 +581,22 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
}
/*
+ * get peoperty of type P_SYMBOL
+ */
+static struct property *get_symbol_prop(struct symbol *sym)
+{
+ struct property *prop = NULL;
+
+ for_all_properties(sym, prop, P_SYMBOL)
+ break;
+ return prop;
+}
+
+/*
* head is optional and may be NULL
*/
-void get_symbol_str(struct gstr *r, struct symbol *sym, struct jk_head *head)
+void get_symbol_str(struct gstr *r, struct symbol *sym,
+ struct list_head *head)
{
bool hit;
struct property *prop;
@@ -596,6 +616,18 @@ void get_symbol_str(struct gstr *r, struct symbol *sym, struct jk_head *head)
}
for_all_prompts(sym, prop)
get_prompt_str(r, prop, head);
+
+ prop = get_symbol_prop(sym);
+ if (prop) {
+ str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name,
+ prop->menu->lineno);
+ if (!expr_is_yes(prop->visible.expr)) {
+ str_append(r, _(" Depends on: "));
+ expr_gstr_print(prop->visible.expr, r);
+ str_append(r, "\n");
+ }
+ }
+
hit = false;
for_all_properties(sym, prop, P_SELECT) {
if (!hit) {
@@ -615,7 +647,7 @@ void get_symbol_str(struct gstr *r, struct symbol *sym, struct jk_head *head)
str_append(r, "\n\n");
}
-struct gstr get_relations_str(struct symbol **sym_arr, struct jk_head *head)
+struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head)
{
struct symbol *sym;
struct gstr res = str_new();
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index 974d5cb7e..81b0c61bb 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -32,11 +32,13 @@ usage() {
echo " -m only merge the fragments, do not execute the make command"
echo " -n use allnoconfig instead of alldefconfig"
echo " -r list redundant entries when merging fragments"
+ echo " -O dir to put generated output files"
}
MAKE=true
ALLTARGET=alldefconfig
WARNREDUN=false
+OUTPUT=.
while true; do
case $1 in
@@ -59,6 +61,16 @@ while true; do
shift
continue
;;
+ "-O")
+ if [ -d $2 ];then
+ OUTPUT=$(echo $2 | sed 's/\/*$//')
+ else
+ echo "output directory $2 does not exist" 1>&2
+ exit 1
+ fi
+ shift 2
+ continue
+ ;;
*)
break
;;
@@ -100,25 +112,33 @@ for MERGE_FILE in $MERGE_LIST ; do
done
if [ "$MAKE" = "false" ]; then
- cp $TMP_FILE .config
+ cp $TMP_FILE $OUTPUT/.config
echo "#"
- echo "# merged configuration written to .config (needs make)"
+ echo "# merged configuration written to $OUTPUT/.config (needs make)"
echo "#"
clean_up
exit
fi
+# If we have an output dir, setup the O= argument, otherwise leave
+# it blank, since O=. will create an unnecessary ./source softlink
+OUTPUT_ARG=""
+if [ "$OUTPUT" != "." ] ; then
+ OUTPUT_ARG="O=$OUTPUT"
+fi
+
+
# Use the merged file as the starting point for:
# alldefconfig: Fills in any missing symbols with Kconfig default
# allnoconfig: Fills in any missing symbols with # CONFIG_* is not set
-make KCONFIG_ALLCONFIG=$TMP_FILE $ALLTARGET
+make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
# Check all specified config values took (might have missed-dependency issues)
for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do
REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
- ACTUAL_VAL=$(grep -w -e "$CFG" .config)
+ ACTUAL_VAL=$(grep -w -e "$CFG" $OUTPUT/.config)
if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then
echo "Value requested for $CFG not in final .config"
echo "Requested value: $REQUESTED_VAL"
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index 1dac689cf..7ceeafb52 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -7,215 +7,208 @@
*/
#define _GNU_SOURCE
#include <string.h>
+#include <stdlib.h>
#include "lkc.h"
#include "nconf.h"
#include <ctype.h>
-static const char nconf_readme[] = N_(
-"Overview\n"
-"--------\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"
+static const char nconf_global_help[] = N_(
+"Help windows\n"
+"------------\n"
+"o Global help: Unless in a data entry window, pressing <F1> will give \n"
+" you the global help window, which you are just reading.\n"
"\n"
-"Menu items beginning with following braces represent features that\n"
-" [ ] can be built in or removed\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"
-"while *, M or whitespace inside braces means to build in, build as\n"
-"a module or to exclude the feature respectively.\n"
+"o A short version of the global help is available by pressing <F3>.\n"
"\n"
-"To change any of these features, highlight it with the cursor\n"
-"keys and press <Y> to build it in, <M> to make it a module or\n"
-"<N> to removed it. You may also press the <Space Bar> to cycle\n"
-"through the available options (ie. Y->N->M->Y).\n"
+"o Local help: To get help related to the current menu entry, use any\n"
+" of <?> <h>, or if in a data entry window then press <F1>.\n"
"\n"
-"Some additional keyboard hints:\n"
"\n"
-"Menus\n"
-"----------\n"
-"o Use the Up/Down arrow keys (cursor keys) to highlight the item\n"
-" you wish to change use <Enter> or <Space>. Goto submenu by \n"
-" pressing <Enter> of <right-arrow>. Use <Esc> or <left-arrow> to go back.\n"
-" Submenus are designated by \"--->\".\n"
-"\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"
+"Menu entries\n"
+"------------\n"
+"This interface lets you select features and parameters for the kernel\n"
+"build. Kernel features can either be built-in, modularized, or removed.\n"
+"Parameters must be entered as text or decimal or hexadecimal numbers.\n"
"\n"
-" You may also use the <PAGE UP> and <PAGE DOWN> keys to scroll\n"
-" unseen options into view.\n"
+"Menu entries beginning with following braces represent features that\n"
+" [ ] can be built in or removed\n"
+" < > can be built in, modularized or removed\n"
+" { } can be built in or modularized, are selected by another feature\n"
+" - - are selected by another feature\n"
+" XXX cannot be selected. Symbol Info <F2> tells you why.\n"
+"*, M or whitespace inside braces means to build in, build as a module\n"
+"or to exclude the feature respectively.\n"
"\n"
-"o To exit a menu use the just press <ESC> <F5> <F8> or <left-arrow>.\n"
+"To change any of these features, highlight it with the movement keys\n"
+"listed below and press <y> to build it in, <m> to make it a module or\n"
+"<n> to remove it. You may press the <Space> key to cycle through the\n"
+"available options.\n"
"\n"
-"o To get help with an item, press <F1>\n"
-" Shortcut: Press <h> or <?>.\n"
+"A trailing \"--->\" designates a submenu.\n"
"\n"
"\n"
-"Radiolists (Choice lists)\n"
-"-----------\n"
-"o Use the cursor keys to select the option you wish to set and press\n"
-" <S> or the <SPACE BAR>.\n"
+"Menu navigation keys\n"
+"----------------------------------------------------------------------\n"
+"Linewise up <Up>\n"
+"Linewise down <Down>\n"
+"Pagewise up <Page Up>\n"
+"Pagewise down <Page Down>\n"
+"First entry <Home>\n"
+"Last entry <End>\n"
+"Enter a submenu <Right> <Enter>\n"
+"Go back to parent menu <Left> <Esc> <F5>\n"
+"Close a help window <Enter> <Esc> <F5>\n"
+"Close entry window, apply <Enter>\n"
+"Close entry window, forget <Esc> <F5>\n"
+"Start incremental, case-insensitive search for STRING in menu entries,\n"
+" no regex support, STRING is displayed in upper left corner\n"
+" </>STRING\n"
+" Remove last character <Backspace>\n"
+" Jump to next hit <Down>\n"
+" Jump to previous hit <Up>\n"
+"Exit menu search mode </> <Esc>\n"
+"Search for configuration variables with or without leading CONFIG_\n"
+" <F8>RegExpr<Enter>\n"
+"Verbose search help <F8><F1>\n"
+"----------------------------------------------------------------------\n"
"\n"
-" Shortcut: Press the first letter of the option you wish to set then\n"
-" press <S> or <SPACE BAR>.\n"
+"Unless in a data entry window, key <1> may be used instead of <F1>,\n"
+"<2> instead of <F2>, etc.\n"
"\n"
-"o To see available help for the item, press <F1>\n"
-" Shortcut: Press <H> or <?>.\n"
"\n"
+"Radiolist (Choice list)\n"
+"-----------------------\n"
+"Use the movement keys listed above to select the option you wish to set\n"
+"and press <Space>.\n"
"\n"
-"Data Entry\n"
-"-----------\n"
-"o Enter the requested information and press <ENTER>\n"
-" If you are entering hexadecimal values, it is not necessary to\n"
-" add the '0x' prefix to the entry.\n"
"\n"
-"o For help, press <F1>.\n"
+"Data entry\n"
+"----------\n"
+"Enter the requested information and press <Enter>. Hexadecimal values\n"
+"may be entered without the \"0x\" prefix.\n"
"\n"
"\n"
-"Text Box (Help Window)\n"
-"--------\n"
-"o Use the cursor keys to scroll up/down/left/right. The VI editor\n"
-" keys h,j,k,l function here as do <u>, <d> and <SPACE BAR> for\n"
-" those who are familiar with less and lynx.\n"
+"Text Box (Help Window)\n"
+"----------------------\n"
+"Use movement keys as listed in table above.\n"
"\n"
-"o Press <Enter>, <F1>, <F5>, <F9>, <q> or <Esc> to exit.\n"
+"Press any of <Enter> <Esc> <q> <F5> <F9> to exit.\n"
"\n"
"\n"
-"Alternate Configuration Files\n"
+"Alternate configuration files\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 configurations.\n"
+"nconfig supports switching between different configurations.\n"
+"Press <F6> to save your current configuration. Press <F7> and enter\n"
+"a file name to load a previously saved configuration.\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"
-"The other option is for loading a previously saved alternate\n"
-"configuration.\n"
"\n"
-"Even if you don't use alternate configuration files, but you\n"
-"find during a nconfig session that you have completely messed\n"
-"up your settings, you may use the \"Load Alternate...\" option to\n"
-"restore your previously saved settings from \".config\" without\n"
-"restarting nconfig.\n"
+"Terminal configuration\n"
+"----------------------\n"
+"If you use nconfig in a xterm window, make sure your TERM environment\n"
+"variable specifies a terminal configuration which supports at least\n"
+"16 colors. Otherwise nconfig will look rather bad.\n"
"\n"
-"Other information\n"
-"-----------------\n"
-"If you use nconfig in an XTERM window make sure you have your\n"
-"$TERM variable set to point to a xterm definition which supports color.\n"
-"Otherwise, nconfig will look rather bad. nconfig will not\n"
-"display correctly in a RXVT window because rxvt displays only one\n"
-"intensity of color, bright.\n"
+"If the \"stty size\" command reports the current terminalsize correctly,\n"
+"nconfig will adapt to sizes larger than the traditional 80x25 \"standard\"\n"
+"and display longer menus properly.\n"
"\n"
-"nconfig will display larger menus on screens or xterms which are\n"
-"set to display more than the standard 25 row by 80 column geometry.\n"
-"In order for this to work, the \"stty size\" command must be able to\n"
-"display the screen's current row and column geometry. I STRONGLY\n"
-"RECOMMEND that you make sure you do NOT have the shell variables\n"
-"LINES and COLUMNS exported into your environment. Some distributions\n"
-"export those variables via /etc/profile. Some ncurses programs can\n"
-"become confused when those variables (LINES & COLUMNS) don't reflect\n"
-"the true screen size.\n"
"\n"
-"Optional personality available\n"
-"------------------------------\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"
+"Single menu mode\n"
+"----------------\n"
+"If you prefer to have all of the menu entries listed in a single menu,\n"
+"rather than the default multimenu hierarchy, run nconfig with\n"
+"NCONFIG_MODE environment variable set to single_menu. Example:\n"
"\n"
"make NCONFIG_MODE=single_menu nconfig\n"
"\n"
-"<Enter> will then unroll the appropriate category, or enfold it if it\n"
-"is already unrolled.\n"
+"<Enter> will then unfold the appropriate category, or fold it if it\n"
+"is already unfolded. Folded menu entries will be designated by a\n"
+"leading \"++>\" and unfolded entries by a leading \"-->\".\n"
"\n"
-"Note that this mode can eventually be a little more CPU expensive\n"
-"(especially with a larger number of unrolled categories) than the\n"
-"default mode.\n"
+"Note that this mode can eventually be a little more CPU expensive than\n"
+"the default mode, especially with a larger number of unfolded submenus.\n"
"\n"),
menu_no_f_instructions[] = N_(
-" You do not have function keys support. Please follow the\n"
-" following instructions:\n"
-" Arrow keys navigate the menu.\n"
-" <Enter> or <right-arrow> selects submenus --->.\n"
-" Capital Letters are hotkeys.\n"
-" Pressing <Y> includes, <N> excludes, <M> modularizes features.\n"
-" Pressing SpaceBar toggles between the above options.\n"
-" Press <Esc> or <left-arrow> to go back one menu,\n"
-" <?> or <h> for Help, </> for Search.\n"
-" <1> is interchangeable with <F1>, <2> with <F2>, etc.\n"
-" Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
-" <Esc> always leaves the current window.\n"),
+"Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
+"Submenus are designated by a trailing \"--->\".\n"
+"\n"
+"Use the following keys to navigate the menus:\n"
+"Move up or down with <Up> and <Down>.\n"
+"Enter a submenu with <Enter> or <Right>.\n"
+"Exit a submenu to its parent menu with <Esc> or <Left>.\n"
+"Pressing <y> includes, <n> excludes, <m> modularizes features.\n"
+"Pressing <Space> cycles through the available options.\n"
+"To search for menu entries press </>.\n"
+"<Esc> always leaves the current window.\n"
+"\n"
+"You do not have function keys support.\n"
+"Press <1> instead of <F1>, <2> instead of <F2>, etc.\n"
+"For verbose global help use key <1>.\n"
+"For help related to the current menu entry press <?> or <h>.\n"),
menu_instructions[] = N_(
-" Arrow keys navigate the menu.\n"
-" <Enter> or <right-arrow> selects submenus --->.\n"
-" Capital Letters are hotkeys.\n"
-" Pressing <Y> includes, <N> excludes, <M> modularizes features.\n"
-" Pressing SpaceBar toggles between the above options\n"
-" Press <Esc>, <F5> or <left-arrow> to go back one menu,\n"
-" <?>, <F1> or <h> for Help, </> for Search.\n"
-" <1> is interchangeable with <F1>, <2> with <F2>, etc.\n"
-" Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
-" <Esc> always leaves the current window\n"),
+"Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
+"Submenus are designated by a trailing \"--->\".\n"
+"\n"
+"Use the following keys to navigate the menus:\n"
+"Move up or down with <Up> or <Down>.\n"
+"Enter a submenu with <Enter> or <Right>.\n"
+"Exit a submenu to its parent menu with <Esc> or <Left>.\n"
+"Pressing <y> includes, <n> excludes, <m> modularizes features.\n"
+"Pressing <Space> cycles through the available options.\n"
+"To search for menu entries press </>.\n"
+"<Esc> always leaves the current window.\n"
+"\n"
+"Pressing <1> may be used instead of <F1>, <2> instead of <F2>, etc.\n"
+"For verbose global help press <F1>.\n"
+"For help related to the current menu entry press <?> or <h>.\n"),
radiolist_instructions[] = N_(
-" Use the arrow keys to navigate this window or\n"
-" press the hotkey of the item you wish to select\n"
-" followed by the <SPACE BAR>.\n"
-" Press <?>, <F1> or <h> for additional information about this option.\n"),
+"Press <Up>, <Down>, <Home> or <End> to navigate a radiolist, select\n"
+"with <Space>.\n"
+"For help related to the current entry press <?> or <h>.\n"
+"For global help press <F1>.\n"),
inputbox_instructions_int[] = N_(
"Please enter a decimal value.\n"
"Fractions will not be accepted.\n"
-"Press <RETURN> to accept, <ESC> to cancel."),
+"Press <Enter> to apply, <Esc> to cancel."),
inputbox_instructions_hex[] = N_(
"Please enter a hexadecimal value.\n"
-"Press <RETURN> to accept, <ESC> to cancel."),
+"Press <Enter> to apply, <Esc> to cancel."),
inputbox_instructions_string[] = N_(
"Please enter a string value.\n"
-"Press <RETURN> to accept, <ESC> to cancel."),
+"Press <Enter> to apply, <Esc> to cancel."),
setmod_text[] = N_(
-"This feature depends on another which\n"
-"has been configured as a module.\n"
-"As a result, this feature will be built as a module."),
+"This feature depends on another feature which has been configured as a\n"
+"module. As a result, the current feature will be built as a module too."),
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."),
+"Accept the name shown to restore the configuration you last\n"
+"retrieved. Leave empty to abort."),
load_config_help[] = N_(
-"\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"
-"default one, entering its name here will allow you to modify that\n"
-"configuration.\n"
+"default one, entering its name here will allow you to load and modify\n"
+"that 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"),
+"Leave empty to abort.\n"),
save_config_text[] = N_(
"Enter a filename to which this configuration should be saved\n"
-"as an alternate. Leave blank to abort."),
+"as an alternate. Leave empty to abort."),
save_config_help[] = N_(
-"\n"
-"For various reasons, one may wish to keep different configurations\n"
-"available on a single machine.\n"
+"For various reasons, one may wish to keep several different\n"
+"configurations 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"
"configuration options you have selected at that time.\n"
"\n"
-"If you are uncertain what all this means then you should probably\n"
-"leave this blank.\n"),
+"Leave empty to abort.\n"),
search_help[] = N_(
-"\n"
-"Search for symbols and display their relations. Regular expressions\n"
-"are allowed.\n"
-"Example: search for \"^FOO\"\n"
+"Search for symbols (configuration variable names CONFIG_*) and display\n"
+"their relations. Regular expressions are supported.\n"
+"Example: Search for \"^FOO\".\n"
"Result:\n"
"-----------------------------------------------------------------\n"
"Symbol: FOO [ = m]\n"
@@ -229,26 +222,26 @@ search_help[] = N_(
"Selects: LIBCRC32\n"
"Selected by: BAR\n"
"-----------------------------------------------------------------\n"
-"o The line 'Prompt:' shows the text used in the menu structure for\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"
-" this symbol to be visible in the menu (selectable)\n"
-"o The 'Location:' lines tell where in the menu structure this symbol\n"
-" is located\n"
-" A location followed by a [ = y] indicate that this is a selectable\n"
-" menu item - and current value is displayed inside brackets.\n"
-"o The 'Selects:' line tell what symbol will be automatically\n"
-" selected if this symbol is selected (y or m)\n"
-"o The 'Selected by' line tell what symbol has selected this symbol\n"
+"o The line 'Prompt:' shows the text displayed for this symbol in\n"
+" the menu hierarchy.\n"
+"o The 'Defined at' line tells at what file / line number the symbol is\n"
+" defined.\n"
+"o The 'Depends on:' line lists symbols that need to be defined for\n"
+" this symbol to be visible and selectable in the menu.\n"
+"o The 'Location:' lines tell, where in the menu structure this symbol\n"
+" is located. A location followed by a [ = y] indicates that this is\n"
+" a selectable menu item, and the current value is displayed inside\n"
+" brackets.\n"
+"o The 'Selects:' line tells, what symbol will be automatically selected\n"
+" if this symbol is selected (y or m).\n"
+"o The 'Selected by' line tells what symbol has selected this symbol.\n"
"\n"
"Only relevant lines are shown.\n"
"\n\n"
"Search examples:\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"
+"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 {
@@ -319,19 +312,19 @@ struct function_keys function_keys[] = {
},
{
.key_str = "F2",
- .func = "Sym Info",
+ .func = "SymInfo",
.key = F_SYMBOL,
.handler = handle_f2,
},
{
.key_str = "F3",
- .func = "Insts",
+ .func = "Help 2",
.key = F_INSTS,
.handler = handle_f3,
},
{
.key_str = "F4",
- .func = "Config",
+ .func = "ShowAll",
.key = F_CONF,
.handler = handle_f4,
},
@@ -355,7 +348,7 @@ struct function_keys function_keys[] = {
},
{
.key_str = "F8",
- .func = "Sym Search",
+ .func = "SymSearch",
.key = F_SEARCH,
.handler = handle_f8,
},
@@ -392,7 +385,7 @@ static void print_function_line(void)
static void handle_f1(int *key, struct menu *current_item)
{
show_scroll_win(main_window,
- _("README"), _(nconf_readme));
+ _("Global help"), _(nconf_global_help));
return;
}
@@ -407,7 +400,7 @@ static void handle_f2(int *key, struct menu *current_item)
static void handle_f3(int *key, struct menu *current_item)
{
show_scroll_win(main_window,
- _("Instructions"),
+ _("Short help"),
_(current_instructions));
return;
}
@@ -696,13 +689,18 @@ static void search_conf(void)
{
struct symbol **sym_arr;
struct gstr res;
+ struct gstr title;
char *dialog_input;
int dres;
+
+ title = str_new();
+ str_printf( &title, _("Enter %s (sub)string to search for "
+ "(with or without \"%s\")"), CONFIG_, CONFIG_);
+
again:
dres = dialog_inputbox(main_window,
_("Search Configuration Parameter"),
- _("Enter " CONFIG_ " (sub)string to search for "
- "(with or without \"" CONFIG_ "\")"),
+ str_get(&title),
"", &dialog_input_result, &dialog_input_result_len);
switch (dres) {
case 0:
@@ -712,6 +710,7 @@ again:
_("Search Configuration"), search_help);
goto again;
default:
+ str_free(&title);
return;
}
@@ -726,6 +725,7 @@ again:
show_scroll_win(main_window,
_("Search Results"), str_get(&res));
str_free(&res);
+ str_free(&title);
}
diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
index 379003c7a..9f8c44ecc 100644
--- a/scripts/kconfig/nconf.gui.c
+++ b/scripts/kconfig/nconf.gui.c
@@ -48,7 +48,7 @@ static void set_normal_colors(void)
init_pair(INPUT_FIELD, -1, -1);
init_pair(FUNCTION_HIGHLIGHT, -1, -1);
- init_pair(FUNCTION_TEXT, COLOR_BLUE, -1);
+ init_pair(FUNCTION_TEXT, COLOR_YELLOW, -1);
}
/* available attributes:
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index df274febb..1500c38f0 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -6,6 +6,7 @@
#include <qglobal.h>
#if QT_VERSION < 0x040000
+#include <stddef.h>
#include <qmainwindow.h>
#include <qvbox.h>
#include <qvaluelist.h>
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 22a3c400f..ecc5aa5f8 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -656,11 +656,11 @@ bool sym_set_string_value(struct symbol *sym, const char *newval)
size = strlen(newval) + 1;
if (sym->type == S_HEX && (newval[0] != '0' || (newval[1] != 'x' && newval[1] != 'X'))) {
size += 2;
- sym->def[S_DEF_USER].val = val = malloc(size);
+ sym->def[S_DEF_USER].val = val = xmalloc(size);
*val++ = '0';
*val++ = 'x';
} else if (!oldval || strcmp(oldval, newval))
- sym->def[S_DEF_USER].val = val = malloc(size);
+ sym->def[S_DEF_USER].val = val = xmalloc(size);
else
return true;
@@ -812,7 +812,7 @@ struct symbol *sym_lookup(const char *name, int flags)
hash = 0;
}
- symbol = malloc(sizeof(*symbol));
+ symbol = xmalloc(sizeof(*symbol));
memset(symbol, 0, sizeof(*symbol));
symbol->name = new_name;
symbol->type = S_UNKNOWN;
@@ -863,7 +863,7 @@ const char *sym_expand_string_value(const char *in)
size_t reslen;
reslen = strlen(in) + 1;
- res = malloc(reslen);
+ res = xmalloc(reslen);
res[0] = '\0';
while ((src = strchr(in, '$'))) {
@@ -921,7 +921,7 @@ const char *sym_escape_string_value(const char *in)
p++;
}
- res = malloc(reslen);
+ res = xmalloc(reslen);
res[0] = '\0';
strcat(res, "\"");
@@ -1228,7 +1228,7 @@ struct property *prop_alloc(enum prop_type type, struct symbol *sym)
struct property *prop;
struct property **propp;
- prop = malloc(sizeof(*prop));
+ prop = xmalloc(sizeof(*prop));
memset(prop, 0, sizeof(*prop));
prop->type = type;
prop->sym = sym;
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index d0b8b2318..6e7fbf196 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -23,7 +23,7 @@ struct file *file_lookup(const char *name)
}
}
- file = malloc(sizeof(*file));
+ file = xmalloc(sizeof(*file));
memset(file, 0, sizeof(*file));
file->name = file_name;
file->next = file_list;
@@ -81,7 +81,7 @@ int file_write_dep(const char *name)
struct gstr str_new(void)
{
struct gstr gs;
- gs.s = malloc(sizeof(char) * 64);
+ gs.s = xmalloc(sizeof(char) * 64);
gs.len = 64;
gs.max_width = 0;
strcpy(gs.s, "\0");
@@ -138,3 +138,22 @@ const char *str_get(struct gstr *gs)
return gs->s;
}
+void *xmalloc(size_t size)
+{
+ void *p = malloc(size);
+ if (p)
+ return p;
+ fprintf(stderr, "Out of memory.\n");
+ exit(1);
+}
+
+void *xcalloc(size_t nmemb, size_t size)
+{
+ void *p = calloc(nmemb, size);
+ if (p)
+ return p;
+ fprintf(stderr, "Out of memory.\n");
+ exit(1);
+}
+
+
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 00f9d3a9c..6555a4754 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -40,7 +40,7 @@ static void zconf_endfile(void);
static void new_string(void)
{
- text = malloc(START_STRSIZE);
+ text = xmalloc(START_STRSIZE);
text_asize = START_STRSIZE;
text_size = 0;
*text = 0;
@@ -62,7 +62,7 @@ static void append_string(const char *str, int size)
static void alloc_string(const char *str, int size)
{
- text = malloc(size + 1);
+ text = xmalloc(size + 1);
memcpy(text, str, size);
text[size] = 0;
}
@@ -288,7 +288,7 @@ void zconf_initscan(const char *name)
exit(1);
}
- current_buf = malloc(sizeof(*current_buf));
+ current_buf = xmalloc(sizeof(*current_buf));
memset(current_buf, 0, sizeof(*current_buf));
current_file = file_lookup(name);
@@ -299,7 +299,7 @@ void zconf_nextfile(const char *name)
{
struct file *iter;
struct file *file = file_lookup(name);
- struct buffer *buf = malloc(sizeof(*buf));
+ struct buffer *buf = xmalloc(sizeof(*buf));
memset(buf, 0, sizeof(*buf));
current_buf->state = YY_CURRENT_BUFFER;
diff --git a/scripts/kconfig/zconf.lex.c_shipped b/scripts/kconfig/zconf.lex.c_shipped
index c32b1a49f..a0521aa59 100644
--- a/scripts/kconfig/zconf.lex.c_shipped
+++ b/scripts/kconfig/zconf.lex.c_shipped
@@ -802,7 +802,7 @@ static void zconf_endfile(void);
static void new_string(void)
{
- text = malloc(START_STRSIZE);
+ text = xmalloc(START_STRSIZE);
text_asize = START_STRSIZE;
text_size = 0;
*text = 0;
@@ -824,7 +824,7 @@ static void append_string(const char *str, int size)
static void alloc_string(const char *str, int size)
{
- text = malloc(size + 1);
+ text = xmalloc(size + 1);
memcpy(text, str, size);
text[size] = 0;
}
@@ -2343,7 +2343,7 @@ void zconf_initscan(const char *name)
exit(1);
}
- current_buf = malloc(sizeof(*current_buf));
+ current_buf = xmalloc(sizeof(*current_buf));
memset(current_buf, 0, sizeof(*current_buf));
current_file = file_lookup(name);
@@ -2354,7 +2354,7 @@ void zconf_nextfile(const char *name)
{
struct file *iter;
struct file *file = file_lookup(name);
- struct buffer *buf = malloc(sizeof(*buf));
+ struct buffer *buf = xmalloc(sizeof(*buf));
memset(buf, 0, sizeof(*buf));
current_buf->state = YY_CURRENT_BUFFER;
diff --git a/scripts/ptx-modifications/0001-conf-add-an-option-to-output-the-dependency-informat.patch b/scripts/ptx-modifications/0001-conf-add-an-option-to-output-the-dependency-informat.patch
index a6eadf143..c88b3d52e 100644
--- a/scripts/ptx-modifications/0001-conf-add-an-option-to-output-the-dependency-informat.patch
+++ b/scripts/ptx-modifications/0001-conf-add-an-option-to-output-the-dependency-informat.patch
@@ -1,18 +1,17 @@
-From 72a38d63dbcb7c4dfdcd32ba4f14600d2ea55c4b Mon Sep 17 00:00:00 2001
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Mon, 1 Nov 2010 19:49:21 +0100
Subject: [PATCH] conf: add an option to output the dependency information
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
- scripts/kconfig/conf.c | 39 +++++++++++++++++++++++++++++++++++++++
+ scripts/kconfig/conf.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
-index 4da3b4a..9f5db95 100644
+index bde5b95..08d372a 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
-@@ -33,6 +33,7 @@ enum input_mode {
+@@ -34,6 +34,7 @@ enum input_mode {
savedefconfig,
listnewconfig,
olddefconfig,
@@ -20,7 +19,7 @@ index 4da3b4a..9f5db95 100644
} input_mode = oldaskconfig;
static int indent = 1;
-@@ -442,6 +443,36 @@ static void check_conf(struct menu *menu)
+@@ -446,6 +447,36 @@ static void check_conf(struct menu *menu)
check_conf(child);
}
@@ -57,7 +56,7 @@ index 4da3b4a..9f5db95 100644
static struct option long_opts[] = {
{"oldaskconfig", no_argument, NULL, oldaskconfig},
{"oldconfig", no_argument, NULL, oldconfig},
-@@ -461,6 +492,7 @@ static struct option long_opts[] = {
+@@ -465,6 +496,7 @@ static struct option long_opts[] = {
* value but not 'n') with the counter-intuitive name.
*/
{"oldnoconfig", no_argument, NULL, olddefconfig},
@@ -65,7 +64,7 @@ index 4da3b4a..9f5db95 100644
{NULL, 0, NULL, 0}
};
-@@ -490,6 +522,7 @@ int main(int ac, char **av)
+@@ -494,6 +526,7 @@ int main(int ac, char **av)
int opt;
const char *name, *defconfig_file = NULL /* gcc uninit */;
struct stat tmpstat;
@@ -73,7 +72,7 @@ index 4da3b4a..9f5db95 100644
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
-@@ -498,6 +531,10 @@ int main(int ac, char **av)
+@@ -504,6 +537,10 @@ int main(int ac, char **av)
while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) {
input_mode = (enum input_mode)opt;
switch (opt) {
@@ -84,7 +83,7 @@ index 4da3b4a..9f5db95 100644
case silentoldconfig:
sync_kconfig = 1;
break;
-@@ -663,6 +700,8 @@ int main(int ac, char **av)
+@@ -678,6 +715,8 @@ int main(int ac, char **av)
input_mode != olddefconfig));
break;
}
diff --git a/scripts/ptx-modifications/0002-conf-don-t-output-autoconf-stuff.patch b/scripts/ptx-modifications/0002-conf-don-t-output-autoconf-stuff.patch
index 07275ae24..32a7940c3 100644
--- a/scripts/ptx-modifications/0002-conf-don-t-output-autoconf-stuff.patch
+++ b/scripts/ptx-modifications/0002-conf-don-t-output-autoconf-stuff.patch
@@ -1,19 +1,18 @@
-From 9bc155c85184bdcfeec11973d9ae675f92994d8a Mon Sep 17 00:00:00 2001
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Mon, 1 Nov 2010 19:49:34 +0100
Subject: [PATCH] conf: don't output autoconf stuff
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
- scripts/kconfig/conf.c | 2 ++
- scripts/kconfig/confdata.c | 2 ++
+ scripts/kconfig/conf.c | 2 ++
+ scripts/kconfig/confdata.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
-index 9f5db95..fbac5e8 100644
+index 08d372a..7ecdc14 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
-@@ -711,10 +711,12 @@ int main(int ac, char **av)
+@@ -726,10 +726,12 @@ int main(int ac, char **av)
fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
exit(1);
}
@@ -27,7 +26,7 @@ index 9f5db95..fbac5e8 100644
if (conf_write_defconfig(defconfig_file)) {
fprintf(stderr, _("n*** Error while saving defconfig to: %s\n\n"),
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
-index 13ddf11..e0dd10b 100644
+index 43eda40..928cb7b 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -939,6 +939,7 @@ out:
diff --git a/scripts/ptx-modifications/0003-Revert-kconfig-make-comments-stand-out-in-menuconfig.patch b/scripts/ptx-modifications/0003-Revert-kconfig-make-comments-stand-out-in-menuconfig.patch
index df7ccc2ed..ae68a7175 100644
--- a/scripts/ptx-modifications/0003-Revert-kconfig-make-comments-stand-out-in-menuconfig.patch
+++ b/scripts/ptx-modifications/0003-Revert-kconfig-make-comments-stand-out-in-menuconfig.patch
@@ -1,4 +1,3 @@
-From f9f72e3b50d3c43d88879452fbb14ae369523a42 Mon Sep 17 00:00:00 2001
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Thu, 11 Nov 2010 06:01:25 +0100
Subject: [PATCH] Revert "kconfig: make comments stand out in menuconfig"
@@ -20,14 +19,14 @@ This reverts commit 48874077ddd6c0c444758059af2cf77c10204ece
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
- scripts/kconfig/mconf.c | 8 --------
+ scripts/kconfig/mconf.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
-index 48f6744..04d58b0 100644
+index a69cbd7..a67c307 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
-@@ -441,14 +441,6 @@ static void build_conf(struct menu *menu)
+@@ -505,14 +505,6 @@ static void build_conf(struct menu *menu)
if (single_menu_mode && menu->data)
goto conf_childs;
return;
diff --git a/scripts/ptx-modifications/0004-Revert-kconfig-ignore-select-of-unknown-symbol.patch b/scripts/ptx-modifications/0004-Revert-kconfig-ignore-select-of-unknown-symbol.patch
index 6309f34db..75eea38a8 100644
--- a/scripts/ptx-modifications/0004-Revert-kconfig-ignore-select-of-unknown-symbol.patch
+++ b/scripts/ptx-modifications/0004-Revert-kconfig-ignore-select-of-unknown-symbol.patch
@@ -1,4 +1,3 @@
-From c7a4639c729b5700c89ddcc8a7d932b3b55478e7 Mon Sep 17 00:00:00 2001
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Thu, 11 Nov 2010 06:00:37 +0100
Subject: [PATCH] Revert "kconfig: ignore select of unknown symbol"
@@ -21,14 +20,14 @@ This reverts commit 603d49885e023d1f68c627c2a2db599fb40eefec
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
- scripts/kconfig/menu.c | 9 ++++++---
+ scripts/kconfig/menu.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
-index a3cade6..5d5ff16 100644
+index fd3f018..395521c 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
-@@ -237,9 +237,12 @@ static void sym_check_prop(struct symbol *sym)
+@@ -250,9 +250,12 @@ static void sym_check_prop(struct symbol *sym)
prop_warn(prop,
"config symbol '%s' uses select, but is "
"not boolean or tristate", sym->name);
diff --git a/scripts/ptx-modifications/0005-nconf-remove-special-P_COMMENT-output.patch b/scripts/ptx-modifications/0005-nconf-remove-special-P_COMMENT-output.patch
index 31e31c5f4..c9a195d16 100644
--- a/scripts/ptx-modifications/0005-nconf-remove-special-P_COMMENT-output.patch
+++ b/scripts/ptx-modifications/0005-nconf-remove-special-P_COMMENT-output.patch
@@ -1,4 +1,3 @@
-From 75671d19736751b8bdf2714598f0a908ddef08b6 Mon Sep 17 00:00:00 2001
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Tue, 2 Nov 2010 20:16:11 +0100
Subject: [PATCH] nconf: remove special P_COMMENT output
@@ -7,11 +6,11 @@ This is like the patch reversing 48874077ddd6c0c444758059af2cf77c10204ece
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
- scripts/kconfig/nconf.c | 9 ---------
+ scripts/kconfig/nconf.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
-index 87d4b15..1dac689 100644
+index dbf31ed..7ceeafb 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -766,15 +766,6 @@ static void build_conf(struct menu *menu)
diff --git a/scripts/ptx-modifications/0006-mconf-fix-comment-on-exit.patch b/scripts/ptx-modifications/0006-mconf-fix-comment-on-exit.patch
index 4dc5682f5..5b9b56d90 100644
--- a/scripts/ptx-modifications/0006-mconf-fix-comment-on-exit.patch
+++ b/scripts/ptx-modifications/0006-mconf-fix-comment-on-exit.patch
@@ -1,18 +1,17 @@
-From b31a6a3a86cf79dac4017df51aa69da9be8c2862 Mon Sep 17 00:00:00 2001
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Sat, 13 Oct 2012 10:39:47 +0200
Subject: [PATCH] mconf: fix comment on exit
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
- scripts/kconfig/mconf.c | 2 +-
+ scripts/kconfig/mconf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
-index 04d58b0..0fe09e3 100644
+index a67c307..5ce66af 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
-@@ -886,7 +886,7 @@ static int handle_exit(void)
+@@ -970,7 +970,7 @@ static int handle_exit(void)
case -1:
printf(_("\n\n"
"*** End of the configuration.\n"
diff --git a/scripts/ptx-modifications/0007-kconfig-define-CIRCLEQ_-macros-when-needed.patch b/scripts/ptx-modifications/0007-kconfig-define-CIRCLEQ_-macros-when-needed.patch
deleted file mode 100644
index 857039c09..000000000
--- a/scripts/ptx-modifications/0007-kconfig-define-CIRCLEQ_-macros-when-needed.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-From 578af454f5839f74654869eb071c399f78ae36f8 Mon Sep 17 00:00:00 2001
-From: User Mol <mol@freebie.lab.pengutronix.de>
-Date: Tue, 16 Oct 2012 17:10:19 +0200
-Subject: [PATCH] kconfig: define CIRCLEQ_* macros when needed
-
-some versions of sys/queue.h do not define these
-e.g. they are undefined on FreeBSD 9.0
-
-Signed-off-by: User Mol <mol@freebie.lab.pengutronix.de>
----
- scripts/kconfig/expr.h | 1 +
- scripts/kconfig/missing.h | 144 +++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 145 insertions(+)
- create mode 100644 scripts/kconfig/missing.h
-
-diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
-index bd2e098..59402a3 100644
---- a/scripts/kconfig/expr.h
-+++ b/scripts/kconfig/expr.h
-@@ -16,6 +16,7 @@ extern "C" {
- #ifndef __cplusplus
- #include <stdbool.h>
- #endif
-+#include "missing.h"
-
- struct file {
- struct file *next;
-diff --git a/scripts/kconfig/missing.h b/scripts/kconfig/missing.h
-new file mode 100644
-index 0000000..62be112
---- /dev/null
-+++ b/scripts/kconfig/missing.h
-@@ -0,0 +1,144 @@
-+/*
-+ * Copyright (c) 1991, 1993
-+ * The Regents of the University of California. All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ * 3. Neither the name of the University nor the names of its contributors
-+ * may be used to endorse or promote products derived from this software
-+ * without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ *
-+ * @(#)queue.h 8.5 (Berkeley) 8/20/94
-+ */
-+
-+/* imported from glibc sys/queue.h */
-+
-+/* not all sys/queue.h define these, e.g. they are undefined on FreeBSD 9.0 */
-+#ifndef CIRCLEQ_HEAD
-+
-+/*
-+ * Circular queue definitions.
-+ */
-+#define CIRCLEQ_HEAD(name, type) \
-+struct name { \
-+ struct type *cqh_first; /* first element */ \
-+ struct type *cqh_last; /* last element */ \
-+}
-+
-+#define CIRCLEQ_HEAD_INITIALIZER(head) \
-+ { (void *)&head, (void *)&head }
-+
-+#define CIRCLEQ_ENTRY(type) \
-+struct { \
-+ struct type *cqe_next; /* next element */ \
-+ struct type *cqe_prev; /* previous element */ \
-+}
-+
-+/*
-+ * Circular queue functions.
-+ */
-+#define CIRCLEQ_INIT(head) do { \
-+ (head)->cqh_first = (void *)(head); \
-+ (head)->cqh_last = (void *)(head); \
-+} while (/*CONSTCOND*/0)
-+
-+#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
-+ (elm)->field.cqe_next = (listelm)->field.cqe_next; \
-+ (elm)->field.cqe_prev = (listelm); \
-+ if ((listelm)->field.cqe_next == (void *)(head)) \
-+ (head)->cqh_last = (elm); \
-+ else \
-+ (listelm)->field.cqe_next->field.cqe_prev = (elm); \
-+ (listelm)->field.cqe_next = (elm); \
-+} while (/*CONSTCOND*/0)
-+
-+#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
-+ (elm)->field.cqe_next = (listelm); \
-+ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
-+ if ((listelm)->field.cqe_prev == (void *)(head)) \
-+ (head)->cqh_first = (elm); \
-+ else \
-+ (listelm)->field.cqe_prev->field.cqe_next = (elm); \
-+ (listelm)->field.cqe_prev = (elm); \
-+} while (/*CONSTCOND*/0)
-+
-+#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
-+ (elm)->field.cqe_next = (head)->cqh_first; \
-+ (elm)->field.cqe_prev = (void *)(head); \
-+ if ((head)->cqh_last == (void *)(head)) \
-+ (head)->cqh_last = (elm); \
-+ else \
-+ (head)->cqh_first->field.cqe_prev = (elm); \
-+ (head)->cqh_first = (elm); \
-+} while (/*CONSTCOND*/0)
-+
-+#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
-+ (elm)->field.cqe_next = (void *)(head); \
-+ (elm)->field.cqe_prev = (head)->cqh_last; \
-+ if ((head)->cqh_first == (void *)(head)) \
-+ (head)->cqh_first = (elm); \
-+ else \
-+ (head)->cqh_last->field.cqe_next = (elm); \
-+ (head)->cqh_last = (elm); \
-+} while (/*CONSTCOND*/0)
-+
-+#define CIRCLEQ_REMOVE(head, elm, field) do { \
-+ if ((elm)->field.cqe_next == (void *)(head)) \
-+ (head)->cqh_last = (elm)->field.cqe_prev; \
-+ else \
-+ (elm)->field.cqe_next->field.cqe_prev = \
-+ (elm)->field.cqe_prev; \
-+ if ((elm)->field.cqe_prev == (void *)(head)) \
-+ (head)->cqh_first = (elm)->field.cqe_next; \
-+ else \
-+ (elm)->field.cqe_prev->field.cqe_next = \
-+ (elm)->field.cqe_next; \
-+} while (/*CONSTCOND*/0)
-+
-+#define CIRCLEQ_FOREACH(var, head, field) \
-+ for ((var) = ((head)->cqh_first); \
-+ (var) != (const void *)(head); \
-+ (var) = ((var)->field.cqe_next))
-+
-+#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
-+ for ((var) = ((head)->cqh_last); \
-+ (var) != (const void *)(head); \
-+ (var) = ((var)->field.cqe_prev))
-+
-+/*
-+ * Circular queue access methods.
-+ */
-+#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head))
-+#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
-+#define CIRCLEQ_LAST(head) ((head)->cqh_last)
-+#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
-+#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
-+
-+#define CIRCLEQ_LOOP_NEXT(head, elm, field) \
-+ (((elm)->field.cqe_next == (void *)(head)) \
-+ ? ((head)->cqh_first) \
-+ : (elm->field.cqe_next))
-+#define CIRCLEQ_LOOP_PREV(head, elm, field) \
-+ (((elm)->field.cqe_prev == (void *)(head)) \
-+ ? ((head)->cqh_last) \
-+ : (elm->field.cqe_prev))
-+
-+#endif
diff --git a/scripts/ptx-modifications/0008-kconfig-Fix-build-on-Darwin.patch b/scripts/ptx-modifications/0008-kconfig-Fix-build-on-Darwin.patch
deleted file mode 100644
index 3ebcdee17..000000000
--- a/scripts/ptx-modifications/0008-kconfig-Fix-build-on-Darwin.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From b55da7043756f75fa53519630d4f783cd6501fda Mon Sep 17 00:00:00 2001
-From: Bernhard Walle <bernhard@bwalle.de>
-Date: Sat, 16 Feb 2013 12:33:28 +0100
-Subject: [PATCH] kconfig: Fix build on Darwin
-
-Darwin 12.2.0 (Mac OS 10.8) defines CIRCLEQ_HEAD but doesn't define
-CIRCLEQ_HEAD_INITIALIZER. Since mconf.c uses CIRCLEQ_HEAD_INITIALIZER,
-the build fails.
-
-A simple and safe fix is to always use our own copy of the CIRCLEQ_
-macros on every platform. Include "missing.h" and don't include
-<sys/queue.h". That works also on Linux, verified on current Arch Linux
-with glibc 2.17.
-
-Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
----
- scripts/kconfig/expr.h | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
-index 59402a3..041b08e 100644
---- a/scripts/kconfig/expr.h
-+++ b/scripts/kconfig/expr.h
-@@ -12,7 +12,6 @@ extern "C" {
-
- #include <assert.h>
- #include <stdio.h>
--#include <sys/queue.h>
- #ifndef __cplusplus
- #include <stdbool.h>
- #endif
---
-1.8.2.2
-
diff --git a/scripts/ptx-modifications/series b/scripts/ptx-modifications/series
index f89a629f7..b2839fd13 100644
--- a/scripts/ptx-modifications/series
+++ b/scripts/ptx-modifications/series
@@ -8,5 +8,3 @@
0004-Revert-kconfig-ignore-select-of-unknown-symbol.patch
0005-nconf-remove-special-P_COMMENT-output.patch
0006-mconf-fix-comment-on-exit.patch
-0007-kconfig-define-CIRCLEQ_-macros-when-needed.patch
-0008-kconfig-Fix-build-on-Darwin.patch