]> git.sur5r.net Git - kconfig-frontends/commitdiff
Synchronise with v4.10 v4.10.0.0
authorYann E. MORIN <yann.morin.1998@free.fr>
Sat, 8 Apr 2017 07:59:37 +0000 (09:59 +0200)
committerYann E. MORIN <yann.morin.1998@free.fr>
Sat, 8 Apr 2017 07:59:37 +0000 (09:59 +0200)
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
.version
docs/kconfig-language.txt
frontends/nconf/nconf.c
frontends/nconf/nconf.gui.c
frontends/qconf/qconf.cc
libs/parser/expr.h
libs/parser/hconf.gperf
libs/parser/menu.c
libs/parser/symbol.c
libs/parser/yconf.y
scripts/ksync.log

index d7296b37a182f0e226aacbc484089835d6c4210e..8498a07983d13b021d1b39d7d85b67cad3bb072b 100644 (file)
--- a/.version
+++ b/.version
@@ -1,2 +1,2 @@
-4.9.0 69973b830859bc6529a7a0468ba0d80ee5117826 Roaring Lionus
+4.10.0 c470abd4fde40ea6a0846a2beab642a578c0b8cd Fearless Coyote
 0
 0
index 069fcb3eef6ed21f714715fb7cddf024b98470e0..262722d8867b2aa9f70f137529dd298e5e36af60 100644 (file)
@@ -113,6 +113,34 @@ applicable everywhere (see syntax).
        That will limit the usefulness but on the other hand avoid
        the illegal configurations all over.
 
        That will limit the usefulness but on the other hand avoid
        the illegal configurations all over.
 
+- weak reverse dependencies: "imply" <symbol> ["if" <expr>]
+  This is similar to "select" as it enforces a lower limit on another
+  symbol except that the "implied" symbol's value may still be set to n
+  from a direct dependency or with a visible prompt.
+
+  Given the following example:
+
+  config FOO
+       tristate
+       imply BAZ
+
+  config BAZ
+       tristate
+       depends on BAR
+
+  The following values are possible:
+
+       FOO             BAR             BAZ's default   choice for BAZ
+       ---             ---             -------------   --------------
+       n               y               n               N/m/y
+       m               y               m               M/y/n
+       y               y               y               Y/n
+       y               n               *               N
+
+  This is useful e.g. with multiple drivers that want to indicate their
+  ability to hook into a secondary subsystem while allowing the user to
+  configure that subsystem out without also having to unset these drivers.
+
 - limiting menu display: "visible if" <expr>
   This attribute is only applicable to menu blocks, if the condition is
   false, the menu block is not displayed to the user (the symbols
 - limiting menu display: "visible if" <expr>
   This attribute is only applicable to menu blocks, if the condition is
   false, the menu block is not displayed to the user (the symbols
@@ -481,6 +509,7 @@ historical issues resolved through these different solutions.
   b) Match dependency semantics:
        b1) Swap all "select FOO" to "depends on FOO" or,
        b2) Swap all "depends on FOO" to "select FOO"
   b) Match dependency semantics:
        b1) Swap all "select FOO" to "depends on FOO" or,
        b2) Swap all "depends on FOO" to "select FOO"
+  c) Consider the use of "imply" instead of "select"
 
 The resolution to a) can be tested with the sample Kconfig file
 Documentation/kbuild/Kconfig.recursion-issue-01 through the removal
 
 The resolution to a) can be tested with the sample Kconfig file
 Documentation/kbuild/Kconfig.recursion-issue-01 through the removal
index d42d534a66cd7006a38e113b4b5b8e30359e7a76..a9bc5334a478d6774d1409a837665b4f143d8597 100644 (file)
@@ -5,7 +5,9 @@
  * Derived from menuconfig.
  *
  */
  * Derived from menuconfig.
  *
  */
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 #include <string.h>
 #include <stdlib.h>
 
 #include <string.h>
 #include <stdlib.h>
 
index 8275f0e55106bc0055d0a1adfe2a169ad1b54193..4b2f44c20caf8941d150f261074b40d589a10376 100644 (file)
@@ -364,12 +364,14 @@ int dialog_inputbox(WINDOW *main_window,
        WINDOW *prompt_win;
        WINDOW *form_win;
        PANEL *panel;
        WINDOW *prompt_win;
        WINDOW *form_win;
        PANEL *panel;
-       int i, x, y;
+       int i, x, y, lines, columns, win_lines, win_cols;
        int res = -1;
        int cursor_position = strlen(init);
        int cursor_form_win;
        char *result = *resultp;
 
        int res = -1;
        int cursor_position = strlen(init);
        int cursor_form_win;
        char *result = *resultp;
 
+       getmaxyx(stdscr, lines, columns);
+
        if (strlen(init)+1 > *result_len) {
                *result_len = strlen(init)+1;
                *resultp = result = realloc(result, *result_len);
        if (strlen(init)+1 > *result_len) {
                *result_len = strlen(init)+1;
                *resultp = result = realloc(result, *result_len);
@@ -386,14 +388,19 @@ int dialog_inputbox(WINDOW *main_window,
        if (title)
                prompt_width = max(prompt_width, strlen(title));
 
        if (title)
                prompt_width = max(prompt_width, strlen(title));
 
+       win_lines = min(prompt_lines+6, lines-2);
+       win_cols = min(prompt_width+7, columns-2);
+       prompt_lines = max(win_lines-6, 0);
+       prompt_width = max(win_cols-7, 0);
+
        /* place dialog in middle of screen */
        /* place dialog in middle of screen */
-       y = (getmaxy(stdscr)-(prompt_lines+4))/2;
-       x = (getmaxx(stdscr)-(prompt_width+4))/2;
+       y = (lines-win_lines)/2;
+       x = (columns-win_cols)/2;
 
        strncpy(result, init, *result_len);
 
        /* create the windows */
 
        strncpy(result, init, *result_len);
 
        /* create the windows */
-       win = newwin(prompt_lines+6, prompt_width+7, y, x);
+       win = newwin(win_lines, win_cols, y, x);
        prompt_win = derwin(win, prompt_lines+1, prompt_width, 2, 2);
        form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2);
        keypad(form_win, TRUE);
        prompt_win = derwin(win, prompt_lines+1, prompt_width, 2, 2);
        form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2);
        keypad(form_win, TRUE);
index 19a84c9ed1b1fb8c6c0e117e0f49ee829d148e2a..bdfb62973f2aecb23d2b01d6ffe3814a1de1aff5 100644 (file)
@@ -65,11 +65,19 @@ ConfigSettings::ConfigSettings()
 QList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
 {
        QList<int> result;
 QList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
 {
        QList<int> result;
-       QStringList entryList = value(key).toStringList();
-       QStringList::Iterator it;
 
 
-       for (it = entryList.begin(); it != entryList.end(); ++it)
-               result.push_back((*it).toInt());
+       if (contains(key))
+       {
+               QStringList entryList = value(key).toStringList();
+               QStringList::Iterator it;
+
+               for (it = entryList.begin(); it != entryList.end(); ++it)
+                       result.push_back((*it).toInt());
+
+               *ok = true;
+       }
+       else
+               *ok = false;
 
        return result;
 }
 
        return result;
 }
@@ -1014,7 +1022,7 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
 
        if (!objectName().isEmpty()) {
                configSettings->beginGroup(objectName());
 
        if (!objectName().isEmpty()) {
                configSettings->beginGroup(objectName());
-               _showDebug = configSettings->value("/showDebug", false).toBool();
+               setShowDebug(configSettings->value("/showDebug", false).toBool());
                configSettings->endGroup();
                connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
        }
                configSettings->endGroup();
                connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
        }
@@ -1474,6 +1482,7 @@ ConfigMainWindow::ConfigMainWindow(void)
        optionMenu->addSeparator();
        optionMenu->addActions(optGroup->actions());
        optionMenu->addSeparator();
        optionMenu->addSeparator();
        optionMenu->addActions(optGroup->actions());
        optionMenu->addSeparator();
+       optionMenu->addAction(showDebugAction);
 
        // create help menu
        menu->addSeparator();
 
        // create help menu
        menu->addSeparator();
index 973b6f73336829a6290a0d2bb15a841086d9a18c..a73f762c48d6964e1ef7adb97bfea9e8fb471078 100644 (file)
@@ -85,6 +85,7 @@ struct symbol {
        struct property *prop;
        struct expr_value dir_dep;
        struct expr_value rev_dep;
        struct property *prop;
        struct expr_value dir_dep;
        struct expr_value rev_dep;
+       struct expr_value implied;
 };
 
 #define for_all_symbols(i, sym) for (i = 0; i < SYMBOL_HASHSIZE; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER)
 };
 
 #define for_all_symbols(i, sym) for (i = 0; i < SYMBOL_HASHSIZE; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER)
@@ -136,6 +137,7 @@ enum prop_type {
        P_DEFAULT,  /* default y */
        P_CHOICE,   /* choice value */
        P_SELECT,   /* select BAR */
        P_DEFAULT,  /* default y */
        P_CHOICE,   /* choice value */
        P_SELECT,   /* select BAR */
+       P_IMPLY,    /* imply BAR */
        P_RANGE,    /* range 7..100 (for a symbol) */
        P_ENV,      /* value from environment variable */
        P_SYMBOL,   /* where a symbol is defined */
        P_RANGE,    /* range 7..100 (for a symbol) */
        P_ENV,      /* value from environment variable */
        P_SYMBOL,   /* where a symbol is defined */
index ac498f01b449f43476bd9a97586c359d94eaa9bb..ead02edec93614618822bc61d8fcc25197853df5 100644 (file)
@@ -38,6 +38,7 @@ int,          T_TYPE,         TF_COMMAND, S_INT
 hex,           T_TYPE,         TF_COMMAND, S_HEX
 string,                T_TYPE,         TF_COMMAND, S_STRING
 select,                T_SELECT,       TF_COMMAND
 hex,           T_TYPE,         TF_COMMAND, S_HEX
 string,                T_TYPE,         TF_COMMAND, S_STRING
 select,                T_SELECT,       TF_COMMAND
+imply,         T_IMPLY,        TF_COMMAND
 range,         T_RANGE,        TF_COMMAND
 visible,       T_VISIBLE,      TF_COMMAND
 option,                T_OPTION,       TF_COMMAND
 range,         T_RANGE,        TF_COMMAND
 visible,       T_VISIBLE,      TF_COMMAND
 option,                T_OPTION,       TF_COMMAND
index aed678e8a77750812bb9e49b7d9e7c6e32f9eea1..e9357931b47db3fdf7f63da842a045697e038ed9 100644 (file)
@@ -233,6 +233,8 @@ static void sym_check_prop(struct symbol *sym)
 {
        struct property *prop;
        struct symbol *sym2;
 {
        struct property *prop;
        struct symbol *sym2;
+       char *use;
+
        for (prop = sym->prop; prop; prop = prop->next) {
                switch (prop->type) {
                case P_DEFAULT:
        for (prop = sym->prop; prop; prop = prop->next) {
                switch (prop->type) {
                case P_DEFAULT:
@@ -252,18 +254,20 @@ static void sym_check_prop(struct symbol *sym)
                        }
                        break;
                case P_SELECT:
                        }
                        break;
                case P_SELECT:
+               case P_IMPLY:
+                       use = prop->type == P_SELECT ? "select" : "imply";
                        sym2 = prop_get_symbol(prop);
                        if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE)
                                prop_warn(prop,
                        sym2 = prop_get_symbol(prop);
                        if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE)
                                prop_warn(prop,
-                                   "config symbol '%s' uses select, but is "
-                                   "not boolean or tristate", sym->name);
+                                   "config symbol '%s' uses %s, but is "
+                                   "not boolean or tristate", sym->name, use);
                        else if (sym2->type != S_UNKNOWN &&
                                 sym2->type != S_BOOLEAN &&
                                 sym2->type != S_TRISTATE)
                                prop_warn(prop,
                        else if (sym2->type != S_UNKNOWN &&
                                 sym2->type != S_BOOLEAN &&
                                 sym2->type != S_TRISTATE)
                                prop_warn(prop,
-                                   "'%s' has wrong type. 'select' only "
+                                   "'%s' has wrong type. '%s' only "
                                    "accept arguments of boolean and "
                                    "accept arguments of boolean and "
-                                   "tristate type", sym2->name);
+                                   "tristate type", sym2->name, use);
                        break;
                case P_RANGE:
                        if (sym->type != S_INT && sym->type != S_HEX)
                        break;
                case P_RANGE:
                        if (sym->type != S_INT && sym->type != S_HEX)
@@ -333,6 +337,10 @@ void menu_finalize(struct menu *parent)
                                        struct symbol *es = prop_get_symbol(prop);
                                        es->rev_dep.expr = expr_alloc_or(es->rev_dep.expr,
                                                        expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep)));
                                        struct symbol *es = prop_get_symbol(prop);
                                        es->rev_dep.expr = expr_alloc_or(es->rev_dep.expr,
                                                        expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep)));
+                               } else if (prop->type == P_IMPLY) {
+                                       struct symbol *es = prop_get_symbol(prop);
+                                       es->implied.expr = expr_alloc_or(es->implied.expr,
+                                                       expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep)));
                                }
                        }
                }
                                }
                        }
                }
@@ -612,13 +620,30 @@ static struct property *get_symbol_prop(struct symbol *sym)
        return prop;
 }
 
        return prop;
 }
 
+static void get_symbol_props_str(struct gstr *r, struct symbol *sym,
+                                enum prop_type tok, const char *prefix)
+{
+       bool hit = false;
+       struct property *prop;
+
+       for_all_properties(sym, prop, tok) {
+               if (!hit) {
+                       str_append(r, prefix);
+                       hit = true;
+               } else
+                       str_printf(r, " && ");
+               expr_gstr_print(prop->expr, r);
+       }
+       if (hit)
+               str_append(r, "\n");
+}
+
 /*
  * head is optional and may be NULL
  */
 static void get_symbol_str(struct gstr *r, struct symbol *sym,
                    struct list_head *head)
 {
 /*
  * head is optional and may be NULL
  */
 static void get_symbol_str(struct gstr *r, struct symbol *sym,
                    struct list_head *head)
 {
-       bool hit;
        struct property *prop;
 
        if (sym && sym->name) {
        struct property *prop;
 
        if (sym && sym->name) {
@@ -648,22 +673,20 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym,
                }
        }
 
                }
        }
 
-       hit = false;
-       for_all_properties(sym, prop, P_SELECT) {
-               if (!hit) {
-                       str_append(r, "  Selects: ");
-                       hit = true;
-               } else
-                       str_printf(r, " && ");
-               expr_gstr_print(prop->expr, r);
-       }
-       if (hit)
-               str_append(r, "\n");
+       get_symbol_props_str(r, sym, P_SELECT, _("  Selects: "));
        if (sym->rev_dep.expr) {
                str_append(r, _("  Selected by: "));
                expr_gstr_print(sym->rev_dep.expr, r);
                str_append(r, "\n");
        }
        if (sym->rev_dep.expr) {
                str_append(r, _("  Selected by: "));
                expr_gstr_print(sym->rev_dep.expr, r);
                str_append(r, "\n");
        }
+
+       get_symbol_props_str(r, sym, P_IMPLY, _("  Implies: "));
+       if (sym->implied.expr) {
+               str_append(r, _("  Implied by: "));
+               expr_gstr_print(sym->implied.expr, r);
+               str_append(r, "\n");
+       }
+
        str_append(r, "\n\n");
 }
 
        str_append(r, "\n\n");
 }
 
index 2432298487fb330d04e365fa2b1c81ed6fbba691..20136ffefb23b814fa8b300b70a07b821b3ec71f 100644 (file)
@@ -258,6 +258,15 @@ static void sym_calc_visibility(struct symbol *sym)
                sym->rev_dep.tri = tri;
                sym_set_changed(sym);
        }
                sym->rev_dep.tri = tri;
                sym_set_changed(sym);
        }
+       tri = no;
+       if (sym->implied.expr && sym->dir_dep.tri != no)
+               tri = expr_calc_value(sym->implied.expr);
+       if (tri == mod && sym_get_type(sym) == S_BOOLEAN)
+               tri = yes;
+       if (sym->implied.tri != tri) {
+               sym->implied.tri = tri;
+               sym_set_changed(sym);
+       }
 }
 
 /*
 }
 
 /*
@@ -397,6 +406,10 @@ void sym_calc_value(struct symbol *sym)
                                        newval.tri = EXPR_AND(expr_calc_value(prop->expr),
                                                              prop->visible.tri);
                                }
                                        newval.tri = EXPR_AND(expr_calc_value(prop->expr),
                                                              prop->visible.tri);
                                }
+                               if (sym->implied.tri != no) {
+                                       sym->flags |= SYMBOL_WRITE;
+                                       newval.tri = EXPR_OR(newval.tri, sym->implied.tri);
+                               }
                        }
                calc_newval:
                        if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) {
                        }
                calc_newval:
                        if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) {
@@ -413,7 +426,8 @@ void sym_calc_value(struct symbol *sym)
                        }
                        newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri);
                }
                        }
                        newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri);
                }
-               if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN)
+               if (newval.tri == mod &&
+                   (sym_get_type(sym) == S_BOOLEAN || sym->implied.tri == yes))
                        newval.tri = yes;
                break;
        case S_STRING:
                        newval.tri = yes;
                break;
        case S_STRING:
@@ -498,6 +512,8 @@ bool sym_tristate_within_range(struct symbol *sym, tristate val)
                return false;
        if (sym->visible <= sym->rev_dep.tri)
                return false;
                return false;
        if (sym->visible <= sym->rev_dep.tri)
                return false;
+       if (sym->implied.tri == yes && val == mod)
+               return false;
        if (sym_is_choice_value(sym) && sym->visible == yes)
                return val == yes;
        return val >= sym->rev_dep.tri && val <= sym->visible;
        if (sym_is_choice_value(sym) && sym->visible == yes)
                return val == yes;
        return val >= sym->rev_dep.tri && val <= sym->visible;
@@ -750,6 +766,10 @@ const char *sym_get_string_default(struct symbol *sym)
        if (sym->type == S_BOOLEAN && val == mod)
                val = yes;
 
        if (sym->type == S_BOOLEAN && val == mod)
                val = yes;
 
+       /* adjust the default value if this symbol is implied by another */
+       if (val < sym->implied.tri)
+               val = sym->implied.tri;
+
        switch (sym->type) {
        case S_BOOLEAN:
        case S_TRISTATE:
        switch (sym->type) {
        case S_BOOLEAN:
        case S_TRISTATE:
@@ -1352,6 +1372,8 @@ const char *prop_get_type_name(enum prop_type type)
                return "choice";
        case P_SELECT:
                return "select";
                return "choice";
        case P_SELECT:
                return "select";
+       case P_IMPLY:
+               return "imply";
        case P_RANGE:
                return "range";
        case P_SYMBOL:
        case P_RANGE:
                return "range";
        case P_SYMBOL:
index de90ea0b4bc22a8369943641b6d1016b09252d8c..f57c06283bce9a0bb4ba5cc5ccc78fe2751244f4 100644 (file)
@@ -31,7 +31,7 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE];
 static struct menu *current_menu, *current_entry;
 
 %}
 static struct menu *current_menu, *current_entry;
 
 %}
-%expect 30
+%expect 32
 
 %union
 {
 
 %union
 {
@@ -62,6 +62,7 @@ static struct menu *current_menu, *current_entry;
 %token <id>T_TYPE
 %token <id>T_DEFAULT
 %token <id>T_SELECT
 %token <id>T_TYPE
 %token <id>T_DEFAULT
 %token <id>T_SELECT
+%token <id>T_IMPLY
 %token <id>T_RANGE
 %token <id>T_VISIBLE
 %token <id>T_OPTION
 %token <id>T_RANGE
 %token <id>T_VISIBLE
 %token <id>T_OPTION
@@ -124,7 +125,7 @@ stmt_list:
 ;
 
 option_name:
 ;
 
 option_name:
-       T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_OPTIONAL | T_RANGE | T_DEFAULT | T_VISIBLE
+       T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_IMPLY | T_OPTIONAL | T_RANGE | T_DEFAULT | T_VISIBLE
 ;
 
 common_stmt:
 ;
 
 common_stmt:
@@ -216,6 +217,12 @@ config_option: T_SELECT T_WORD if_expr T_EOL
        printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
 };
 
        printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
 };
 
+config_option: T_IMPLY T_WORD if_expr T_EOL
+{
+       menu_add_symbol(P_IMPLY, sym_lookup($2, 0), $3);
+       printd(DEBUG_PARSE, "%s:%d:imply\n", zconf_curname(), zconf_lineno());
+};
+
 config_option: T_RANGE symbol symbol if_expr T_EOL
 {
        menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,$2, $3), $4);
 config_option: T_RANGE symbol symbol if_expr T_EOL
 {
        menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,$2, $3), $4);
@@ -664,6 +671,11 @@ static void print_symbol(FILE *out, struct menu *menu)
                        expr_fprint(prop->expr, out);
                        fputc('\n', out);
                        break;
                        expr_fprint(prop->expr, out);
                        fputc('\n', out);
                        break;
+               case P_IMPLY:
+                       fputs( "  imply ", out);
+                       expr_fprint(prop->expr, out);
+                       fputc('\n', out);
+                       break;
                case P_RANGE:
                        fputs( "  range ", out);
                        expr_fprint(prop->expr, out);
                case P_RANGE:
                        fputs( "  range ", out);
                        expr_fprint(prop->expr, out);
index 9c872b1c7b1d13c61d189c636d1ac6eb723feb7b..c8510587406971760bae0bed14d2f6ab84fb4465 100644 (file)
@@ -165,3 +165,8 @@ a466391 kconfig: add unexpected data itself to warning
 032a318 kconfig-language: elaborate on the type of a choice
 fa64e5f kconfig/symbol.c: handle choice_values that depend on 'm' symbols
 cfd7c612 kconfig-language: improve menuconfig usage description
 032a318 kconfig-language: elaborate on the type of a choice
 fa64e5f kconfig/symbol.c: handle choice_values that depend on 'm' symbols
 cfd7c612 kconfig-language: improve menuconfig usage description
+237e3ad Kconfig: Introduce the "imply" keyword
+0eb4734 Scripts: kconfig: nconf: fix _GNU_SOURCE redefined warning
+79e51b5 kconfig/nconf: Fix hang when editing symbol with a long prompt
+e039303 xconfig: fix 'Show Debug' functionality
+83c3a1b xconfig: fix missing suboption and help panels on first run