aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/Makefile35
-rw-r--r--scripts/kconfig/confdata.c37
-rw-r--r--scripts/kconfig/kxgettext.c4
-rw-r--r--scripts/kconfig/lxdialog/check-lxdialog.sh2
-rw-r--r--scripts/kconfig/mconf.c11
5 files changed, 57 insertions, 32 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index fb2bb3099dd9..8986a48c8c49 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -22,24 +22,25 @@ oldconfig: $(obj)/conf
22silentoldconfig: $(obj)/conf 22silentoldconfig: $(obj)/conf
23 $< -s arch/$(ARCH)/Kconfig 23 $< -s arch/$(ARCH)/Kconfig
24 24
25# Create new linux.po file
26# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
27# The symlink is used to repair a deficiency in arch/um
25update-po-config: $(obj)/kxgettext 28update-po-config: $(obj)/kxgettext
26 xgettext --default-domain=linux \ 29 xgettext --default-domain=linux \
27 --add-comments --keyword=_ --keyword=N_ \ 30 --add-comments --keyword=_ --keyword=N_ \
28 --files-from=scripts/kconfig/POTFILES.in \ 31 --from-code=UTF-8 \
29 --output scripts/kconfig/config.pot 32 --files-from=scripts/kconfig/POTFILES.in \
30 $(Q)ln -fs Kconfig_i386 arch/um/Kconfig_arch 33 --output $(obj)/config.pot
31 $(Q)for i in `ls arch/`; \ 34 $(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot
32 do \ 35 $(Q)ln -fs Kconfig.i386 arch/um/Kconfig.arch
33 scripts/kconfig/kxgettext arch/$$i/Kconfig \ 36 (for i in `ls arch/`; \
34 | msguniq -o scripts/kconfig/linux_$${i}.pot; \ 37 do \
35 done 38 $(obj)/kxgettext arch/$$i/Kconfig; \
36 $(Q)msgcat scripts/kconfig/config.pot \ 39 done ) >> $(obj)/config.pot
37 `find scripts/kconfig/ -type f -name linux_*.pot` \ 40 msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
38 --output scripts/kconfig/linux_raw.pot 41 --output $(obj)/linux.pot
39 $(Q)msguniq --sort-by-file scripts/kconfig/linux_raw.pot \ 42 $(Q)rm -f arch/um/Kconfig.arch
40 --output scripts/kconfig/linux.pot 43 $(Q)rm -f $(obj)/config.pot
41 $(Q)rm -f arch/um/Kconfig_arch
42 $(Q)rm -f scripts/kconfig/linux_*.pot scripts/kconfig/config.pot
43 44
44PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig 45PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig
45 46
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 664fe29dacef..b2913e9da495 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -341,27 +341,42 @@ int conf_read(const char *name)
341 conf_unsaved++; 341 conf_unsaved++;
342 /* maybe print value in verbose mode... */ 342 /* maybe print value in verbose mode... */
343 sym_ok: 343 sym_ok:
344 if (!sym_is_choice(sym))
345 continue;
346 /* The choice symbol only has a set value (and thus is not new)
347 * if all its visible childs have values.
348 */
349 prop = sym_get_choice_prop(sym);
350 flags = sym->flags;
351 for (e = prop->expr; e; e = e->left.expr)
352 if (e->right.sym->visible != no)
353 flags &= e->right.sym->flags;
354 sym->flags &= flags | ~SYMBOL_DEF_USER;
355 }
356
357 for_all_symbols(i, sym) {
344 if (sym_has_value(sym) && !sym_is_choice_value(sym)) { 358 if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
345 if (sym->visible == no) 359 /* Reset values of generates values, so they'll appear
360 * as new, if they should become visible, but that
361 * doesn't quite work if the Kconfig and the saved
362 * configuration disagree.
363 */
364 if (sym->visible == no && !conf_unsaved)
346 sym->flags &= ~SYMBOL_DEF_USER; 365 sym->flags &= ~SYMBOL_DEF_USER;
347 switch (sym->type) { 366 switch (sym->type) {
348 case S_STRING: 367 case S_STRING:
349 case S_INT: 368 case S_INT:
350 case S_HEX: 369 case S_HEX:
351 if (!sym_string_within_range(sym, sym->def[S_DEF_USER].val)) 370 /* Reset a string value if it's out of range */
352 sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER); 371 if (sym_string_within_range(sym, sym->def[S_DEF_USER].val))
372 break;
373 sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER);
374 conf_unsaved++;
375 break;
353 default: 376 default:
354 break; 377 break;
355 } 378 }
356 } 379 }
357 if (!sym_is_choice(sym))
358 continue;
359 prop = sym_get_choice_prop(sym);
360 flags = sym->flags;
361 for (e = prop->expr; e; e = e->left.expr)
362 if (e->right.sym->visible != no)
363 flags &= e->right.sym->flags;
364 sym->flags &= flags | ~SYMBOL_DEF_USER;
365 } 380 }
366 381
367 sym_add_change_count(conf_warnings || conf_unsaved); 382 sym_add_change_count(conf_warnings || conf_unsaved);
diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c
index abee55ca6174..11f7dab94715 100644
--- a/scripts/kconfig/kxgettext.c
+++ b/scripts/kconfig/kxgettext.c
@@ -212,7 +212,9 @@ void menu__xgettext(void)
212 struct message *m = message__list; 212 struct message *m = message__list;
213 213
214 while (m != NULL) { 214 while (m != NULL) {
215 message__print_gettext_msgid_msgstr(m); 215 /* skip empty lines ("") */
216 if (strlen(m->msg) > sizeof("\"\""))
217 message__print_gettext_msgid_msgstr(m);
216 m = m->next; 218 m = m->next;
217 } 219 }
218} 220}
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index cdca7388e0f1..9681476b96e7 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -51,7 +51,7 @@ usage() {
51 printf "Usage: $0 [-check compiler options|-header|-library]\n" 51 printf "Usage: $0 [-check compiler options|-header|-library]\n"
52} 52}
53 53
54if [ $# == 0 ]; then 54if [ $# -eq 0 ]; then
55 usage 55 usage
56 exit 1 56 exit 1
57fi 57fi
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index d0e4fa594fc7..d2c2a429887b 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -419,11 +419,13 @@ static void search_conf(void)
419{ 419{
420 struct symbol **sym_arr; 420 struct symbol **sym_arr;
421 struct gstr res; 421 struct gstr res;
422 char *dialog_input;
422 int dres; 423 int dres;
423again: 424again:
424 dialog_clear(); 425 dialog_clear();
425 dres = dialog_inputbox(_("Search Configuration Parameter"), 426 dres = dialog_inputbox(_("Search Configuration Parameter"),
426 _("Enter CONFIG_ (sub)string to search for (omit CONFIG_)"), 427 _("Enter CONFIG_ (sub)string to search for "
428 "(with or without \"CONFIG\")"),
427 10, 75, ""); 429 10, 75, "");
428 switch (dres) { 430 switch (dres) {
429 case 0: 431 case 0:
@@ -435,7 +437,12 @@ again:
435 return; 437 return;
436 } 438 }
437 439
438 sym_arr = sym_re_search(dialog_input_result); 440 /* strip CONFIG_ if necessary */
441 dialog_input = dialog_input_result;
442 if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0)
443 dialog_input += 7;
444
445 sym_arr = sym_re_search(dialog_input);
439 res = get_relations_str(sym_arr); 446 res = get_relations_str(sym_arr);
440 free(sym_arr); 447 free(sym_arr);
441 show_textbox(_("Search Results"), str_get(&res), 0, 0); 448 show_textbox(_("Search Results"), str_get(&res), 0, 0);