aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-10 19:06:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-10 19:06:46 -0400
commitb202c0d5205662fd96f7151afa83f891f2f4d542 (patch)
tree1e44a453662d0a8b26b3d7799f280f6ddbd67403 /scripts
parentcb63fc26623ee38fd84d71ea5a98189240ec2e1b (diff)
parentb57caaaed2bd127fe656e6c145970ed6a05c0125 (diff)
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kconfig updates from Michal Marek: - dependency solver fix for make defconfig - randconfig fixes, one of which had to be reverted again - more user-friendly sorting of search results - hex and range keywords support longs - fix for [mn]conf not to rely on particular behavior of the LINES and COLS variables - cleanup of magic constants in kconfig/lxdialog - [mn]conf formatting fixes - fix for scripts/config's help text in out-of-tree usage (under a different name) * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kconfig: allow "hex" and "range" to support longs Revert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG" kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG kconfig: loop as long as we changed some symbols in randconfig kconfig/[mn]conf: make it explicit in the search box that a regexp is possible kconfig: sort found symbols by relevance kconfig/conf: print the seed used to initialise the RNG for randconfig kconfig/conf: accept a base-16 seed for randconfig kconfig/conf: fix randconfig setting multiple symbols in a choice scripts/config: replace hard-coded script name by a dynamic value mconf/nconf: mark empty menus/menuconfigs different from non-empty ones nconf: use function calls instead of ncurses' variables LINES and COLS mconf: use function calls instead of ncurses' variables LINES and COLS kconfig/lxdialog: handle newline characters in print_autowrap() kconfig/lxdialog: Use new mininimum resize definitions in conf_choice() kconfig/lxdialog: Add definitions for mininimum (re)size values kconfig: Fix defconfig when one choice menu selects options that another choice menu depends on
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/config12
-rw-r--r--scripts/kconfig/conf.c6
-rw-r--r--scripts/kconfig/confdata.c33
-rw-r--r--scripts/kconfig/expr.h3
-rw-r--r--scripts/kconfig/lkc.h3
-rw-r--r--scripts/kconfig/lkc_proto.h1
-rw-r--r--scripts/kconfig/lxdialog/checklist.c8
-rw-r--r--scripts/kconfig/lxdialog/dialog.h14
-rw-r--r--scripts/kconfig/lxdialog/inputbox.c8
-rw-r--r--scripts/kconfig/lxdialog/menubox.c6
-rw-r--r--scripts/kconfig/lxdialog/textbox.c6
-rw-r--r--scripts/kconfig/lxdialog/util.c46
-rw-r--r--scripts/kconfig/lxdialog/yesno.c8
-rw-r--r--scripts/kconfig/mconf.c21
-rw-r--r--scripts/kconfig/menu.c16
-rw-r--r--scripts/kconfig/nconf.c39
-rw-r--r--scripts/kconfig/nconf.gui.c20
-rw-r--r--scripts/kconfig/symbol.c99
18 files changed, 249 insertions, 100 deletions
diff --git a/scripts/config b/scripts/config
index a65ecbbdd32a..567120a87c39 100755
--- a/scripts/config
+++ b/scripts/config
@@ -1,6 +1,8 @@
1#!/bin/bash 1#!/bin/bash
2# Manipulate options in a .config file from the command line 2# Manipulate options in a .config file from the command line
3 3
4myname=${0##*/}
5
4# If no prefix forced, use the default CONFIG_ 6# If no prefix forced, use the default CONFIG_
5CONFIG_="${CONFIG_-CONFIG_}" 7CONFIG_="${CONFIG_-CONFIG_}"
6 8
@@ -8,7 +10,7 @@ usage() {
8 cat >&2 <<EOL 10 cat >&2 <<EOL
9Manipulate options in a .config file from the command line. 11Manipulate options in a .config file from the command line.
10Usage: 12Usage:
11config options command ... 13$myname options command ...
12commands: 14commands:
13 --enable|-e option Enable option 15 --enable|-e option Enable option
14 --disable|-d option Disable option 16 --disable|-d option Disable option
@@ -33,14 +35,14 @@ options:
33 --file config-file .config file to change (default .config) 35 --file config-file .config file to change (default .config)
34 --keep-case|-k Keep next symbols' case (dont' upper-case it) 36 --keep-case|-k Keep next symbols' case (dont' upper-case it)
35 37
36config doesn't check the validity of the .config file. This is done at next 38$myname doesn't check the validity of the .config file. This is done at next
37make time. 39make time.
38 40
39By default, config will upper-case the given symbol. Use --keep-case to keep 41By default, $myname will upper-case the given symbol. Use --keep-case to keep
40the case of all following symbols unchanged. 42the case of all following symbols unchanged.
41 43
42config uses 'CONFIG_' as the default symbol prefix. Set the environment 44$myname uses 'CONFIG_' as the default symbol prefix. Set the environment
43variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" config ... 45variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" $myname ...
44EOL 46EOL
45 exit 1 47 exit 1
46} 48}
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index bde5b95c8c19..d19944f9c3ac 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -527,11 +527,12 @@ int main(int ac, char **av)
527 seed_env = getenv("KCONFIG_SEED"); 527 seed_env = getenv("KCONFIG_SEED");
528 if( seed_env && *seed_env ) { 528 if( seed_env && *seed_env ) {
529 char *endp; 529 char *endp;
530 int tmp = (int)strtol(seed_env, &endp, 10); 530 int tmp = (int)strtol(seed_env, &endp, 0);
531 if (*endp == '\0') { 531 if (*endp == '\0') {
532 seed = tmp; 532 seed = tmp;
533 } 533 }
534 } 534 }
535 fprintf( stderr, "KCONFIG_SEED=0x%X\n", seed );
535 srand(seed); 536 srand(seed);
536 break; 537 break;
537 } 538 }
@@ -653,7 +654,8 @@ int main(int ac, char **av)
653 conf_set_all_new_symbols(def_default); 654 conf_set_all_new_symbols(def_default);
654 break; 655 break;
655 case randconfig: 656 case randconfig:
656 conf_set_all_new_symbols(def_random); 657 /* Really nothing to do in this loop */
658 while (conf_set_all_new_symbols(def_random)) ;
657 break; 659 break;
658 case defconfig: 660 case defconfig:
659 conf_set_all_new_symbols(def_default); 661 conf_set_all_new_symbols(def_default);
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 43eda40c3838..c55c227af463 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -1040,7 +1040,7 @@ void conf_set_changed_callback(void (*fn)(void))
1040 conf_changed_callback = fn; 1040 conf_changed_callback = fn;
1041} 1041}
1042 1042
1043static void randomize_choice_values(struct symbol *csym) 1043static bool randomize_choice_values(struct symbol *csym)
1044{ 1044{
1045 struct property *prop; 1045 struct property *prop;
1046 struct symbol *sym; 1046 struct symbol *sym;
@@ -1053,7 +1053,7 @@ static void randomize_choice_values(struct symbol *csym)
1053 * In both cases stop. 1053 * In both cases stop.
1054 */ 1054 */
1055 if (csym->curr.tri != yes) 1055 if (csym->curr.tri != yes)
1056 return; 1056 return false;
1057 1057
1058 prop = sym_get_choice_prop(csym); 1058 prop = sym_get_choice_prop(csym);
1059 1059
@@ -1077,13 +1077,18 @@ static void randomize_choice_values(struct symbol *csym)
1077 else { 1077 else {
1078 sym->def[S_DEF_USER].tri = no; 1078 sym->def[S_DEF_USER].tri = no;
1079 } 1079 }
1080 sym->flags |= SYMBOL_DEF_USER;
1081 /* clear VALID to get value calculated */
1082 sym->flags &= ~SYMBOL_VALID;
1080 } 1083 }
1081 csym->flags |= SYMBOL_DEF_USER; 1084 csym->flags |= SYMBOL_DEF_USER;
1082 /* clear VALID to get value calculated */ 1085 /* clear VALID to get value calculated */
1083 csym->flags &= ~(SYMBOL_VALID); 1086 csym->flags &= ~(SYMBOL_VALID);
1087
1088 return true;
1084} 1089}
1085 1090
1086static void set_all_choice_values(struct symbol *csym) 1091void set_all_choice_values(struct symbol *csym)
1087{ 1092{
1088 struct property *prop; 1093 struct property *prop;
1089 struct symbol *sym; 1094 struct symbol *sym;
@@ -1100,10 +1105,10 @@ static void set_all_choice_values(struct symbol *csym)
1100 } 1105 }
1101 csym->flags |= SYMBOL_DEF_USER; 1106 csym->flags |= SYMBOL_DEF_USER;
1102 /* clear VALID to get value calculated */ 1107 /* clear VALID to get value calculated */
1103 csym->flags &= ~(SYMBOL_VALID); 1108 csym->flags &= ~(SYMBOL_VALID | SYMBOL_NEED_SET_CHOICE_VALUES);
1104} 1109}
1105 1110
1106void conf_set_all_new_symbols(enum conf_def_mode mode) 1111bool conf_set_all_new_symbols(enum conf_def_mode mode)
1107{ 1112{
1108 struct symbol *sym, *csym; 1113 struct symbol *sym, *csym;
1109 int i, cnt, pby, pty, ptm; /* pby: probability of boolean = y 1114 int i, cnt, pby, pty, ptm; /* pby: probability of boolean = y
@@ -1151,6 +1156,7 @@ void conf_set_all_new_symbols(enum conf_def_mode mode)
1151 exit( 1 ); 1156 exit( 1 );
1152 } 1157 }
1153 } 1158 }
1159 bool has_changed = false;
1154 1160
1155 for_all_symbols(i, sym) { 1161 for_all_symbols(i, sym) {
1156 if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID)) 1162 if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID))
@@ -1158,6 +1164,7 @@ void conf_set_all_new_symbols(enum conf_def_mode mode)
1158 switch (sym_get_type(sym)) { 1164 switch (sym_get_type(sym)) {
1159 case S_BOOLEAN: 1165 case S_BOOLEAN:
1160