aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2015-04-08 07:30:42 -0400
committerMichal Marek <mmarek@suse.cz>2015-04-09 11:44:34 -0400
commit0a1f00a1c86421cc07cec87011c7cf4df68ee54b (patch)
tree06a6169a2c87dea29e62d44abfc493337c4854d5 /scripts/kconfig
parent1cba0c305758c3c1786ecaceb03e142c95a4edc9 (diff)
kconfig: Do not print status messages in make -s mode
Add an -s option to the various frontends and pass it when make -s is used. Also, use $(kecho) instead of @echo in the Makefile. Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/Makefile40
-rw-r--r--scripts/kconfig/conf.c8
-rw-r--r--scripts/kconfig/gconf.c5
-rw-r--r--scripts/kconfig/mconf.c31
-rw-r--r--scripts/kconfig/nconf.c5
-rw-r--r--scripts/kconfig/qconf.cc5
6 files changed, 62 insertions, 32 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 1f5e45355731..d9b1fef0c67e 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -11,27 +11,31 @@ else
11Kconfig := Kconfig 11Kconfig := Kconfig
12endif 12endif
13 13
14ifeq ($(quiet),silent_)
15silent := -s
16endif
17
14# We need this, in case the user has it in its environment 18# We need this, in case the user has it in its environment
15unexport CONFIG_ 19unexport CONFIG_
16 20
17xconfig: $(obj)/qconf 21xconfig: $(obj)/qconf
18 $< $(Kconfig) 22 $< $(silent) $(Kconfig)
19 23
20gconfig: $(obj)/gconf 24gconfig: $(obj)/gconf
21 $< $(Kconfig) 25 $< $(silent) $(Kconfig)
22 26
23menuconfig: $(obj)/mconf 27menuconfig: $(obj)/mconf
24 $< $(Kconfig) 28 $< $(silent) $(Kconfig)
25 29
26config: $(obj)/conf 30config: $(obj)/conf
27 $< --oldaskconfig $(Kconfig) 31 $< $(silent) --oldaskconfig $(Kconfig)
28 32
29nconfig: $(obj)/nconf 33nconfig: $(obj)/nconf
30 $< $(Kconfig) 34 $< $(silent) $(Kconfig)
31 35
32silentoldconfig: $(obj)/conf 36silentoldconfig: $(obj)/conf
33 $(Q)mkdir -p include/config include/generated 37 $(Q)mkdir -p include/config include/generated
34 $< --$@ $(Kconfig) 38 $< $(silent) --$@ $(Kconfig)
35 39
36localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf 40localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
37 $(Q)mkdir -p include/config include/generated 41 $(Q)mkdir -p include/config include/generated
@@ -40,18 +44,18 @@ localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
40 cmp -s .tmp.config .config || \ 44 cmp -s .tmp.config .config || \
41 (mv -f .config .config.old.1; \ 45 (mv -f .config .config.old.1; \
42 mv -f .tmp.config .config; \ 46 mv -f .tmp.config .config; \
43 $(obj)/conf --silentoldconfig $(Kconfig); \ 47 $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \
44 mv -f .config.old.1 .config.old) \ 48 mv -f .config.old.1 .config.old) \
45 else \ 49 else \
46 mv -f .tmp.config .config; \ 50 mv -f .tmp.config .config; \
47 $(obj)/conf --silentoldconfig $(Kconfig); \ 51 $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \
48 fi 52 fi
49 $(Q)rm -f .tmp.config 53 $(Q)rm -f .tmp.config
50 54
51# Create new linux.pot file 55# Create new linux.pot file
52# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files 56# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
53update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h 57update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
54 $(Q)echo " GEN config.pot" 58 $(Q)$(kecho) " GEN config.pot"
55 $(Q)xgettext --default-domain=linux \ 59 $(Q)xgettext --default-domain=linux \
56 --add-comments --keyword=_ --keyword=N_ \ 60 --add-comments --keyword=_ --keyword=N_ \
57 --from-code=UTF-8 \ 61 --from-code=UTF-8 \
@@ -62,11 +66,11 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
62 $(Q)(for i in `ls $(srctree)/arch/*/Kconfig \ 66 $(Q)(for i in `ls $(srctree)/arch/*/Kconfig \
63 $(srctree)/arch/*/um/Kconfig`; \ 67 $(srctree)/arch/*/um/Kconfig`; \
64 do \ 68 do \
65 echo " GEN $$i"; \ 69 $(kecho) " GEN $$i"; \
66 $(obj)/kxgettext $$i \ 70 $(obj)/kxgettext $$i \
67 >> $(obj)/config.pot; \ 71 >> $(obj)/config.pot; \
68 done ) 72 done )
69 $(Q)echo " GEN linux.pot" 73 $(Q)$(kecho) " GEN linux.pot"
70 $(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \ 74 $(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
71 --output $(obj)/linux.pot 75 --output $(obj)/linux.pot
72 $(Q)rm -f $(obj)/config.pot 76 $(Q)rm -f $(obj)/config.pot
@@ -77,7 +81,7 @@ simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \
77PHONY += $(simple-targets) 81PHONY += $(simple-targets)
78 82
79$(simple-targets): $(obj)/conf 83$(simple-targets): $(obj)/conf
80 $< --$@ $(Kconfig) 84 $< $(silent) --$@ $(Kconfig)
81 85
82PHONY += oldnoconfig savedefconfig defconfig 86PHONY += oldnoconfig savedefconfig defconfig
83 87
@@ -87,18 +91,18 @@ PHONY += oldnoconfig savedefconfig defconfig
87oldnoconfig: olddefconfig 91oldnoconfig: olddefconfig
88 92
89savedefconfig: $(obj)/conf 93savedefconfig: $(obj)/conf
90 $< --$@=defconfig $(Kconfig) 94 $< $(silent) --$@=defconfig $(Kconfig)
91 95
92defconfig: $(obj)/conf 96defconfig: $(obj)/conf
93ifeq ($(KBUILD_DEFCONFIG),) 97ifeq ($(KBUILD_DEFCONFIG),)
94 $< --defconfig $(Kconfig) 98 $< $(silent) --defconfig $(Kconfig)
95else 99else
96 @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" 100 @$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
97 $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) 101 $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
98endif 102endif
99 103
100%_defconfig: $(obj)/conf 104%_defconfig: $(obj)/conf
101 $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) 105 $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
102 106
103configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@) 107configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@)
104 108
@@ -215,7 +219,7 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile
215 219
216# QT needs some extra effort... 220# QT needs some extra effort...
217$(obj)/.tmp_qtcheck: 221$(obj)/.tmp_qtcheck:
218 @set -e; echo " CHECK qt"; dir=""; pkg=""; \ 222 @set -e; $(kecho) " CHECK qt"; dir=""; pkg=""; \
219 if ! pkg-config --exists QtCore 2> /dev/null; then \ 223 if ! pkg-config --exists QtCore 2> /dev/null; then \
220 echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \ 224 echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \
221 pkg-config --exists qt 2> /dev/null && pkg=qt; \ 225 pkg-config --exists qt 2> /dev/null && pkg=qt; \
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index fef75fc756f4..6c204318bc94 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -471,7 +471,7 @@ static struct option long_opts[] = {
471static void conf_usage(const char *progname) 471static void conf_usage(const char *progname)
472{ 472{
473 473
474 printf("Usage: %s [option] <kconfig-file>\n", progname); 474 printf("Usage: %s [-s] [option] <kconfig-file>\n", progname);
475 printf("[option] is _one_ of the following:\n"); 475 printf("[option] is _one_ of the following:\n");
476 printf(" --listnewconfig List new options\n"); 476 printf(" --listnewconfig List new options\n");
477 printf(" --oldaskconfig Start a new configuration using a line-oriented program\n"); 477 printf(" --oldaskconfig Start a new configuration using a line-oriented program\n");
@@ -501,7 +501,11 @@ int main(int ac, char **av)
501 501
502 tty_stdio = isatty(0) && isatty(1) && isatty(2); 502 tty_stdio = isatty(0) && isatty(1) && isatty(2);
503 503
504 while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) { 504 while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) {
505 if (opt == 's') {
506 conf_set_message_callback(NULL);
507 continue;
508 }
505 input_mode = (enum input_mode)opt; 509 input_mode = (enum input_mode)opt;
506 switch (opt) { 510 switch (opt) {
507 case silentoldconfig: 511 case silentoldconfig:
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 344b9e340ecb..26d208b435a0 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -1474,9 +1474,12 @@ int main(int ac, char *av[])
1474 case 'a': 1474 case 'a':
1475 //showAll = 1; 1475 //showAll = 1;
1476 break; 1476 break;
1477 case 's':
1478 conf_set_message_callback(NULL);
1479 break;
1477 case 'h': 1480 case 'h':
1478 case '?': 1481 case '?':
1479 printf("%s <config>\n", av[0]); 1482 printf("%s [-s] <config>\n", av[0]);
1480 exit(0); 1483 exit(0);
1481 } 1484 }
1482 name = av[2]; 1485 name = av[2];
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 4dd37552abc2..315ce2c7cb9d 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -279,6 +279,7 @@ static int child_count;
279static int single_menu_mode; 279static int single_menu_mode;
280static int show_all_options; 280static int show_all_options;
281static int save_and_exit; 281static int save_and_exit;
282static int silent;
282 283
283static void conf(struct menu *menu, struct menu *active_menu); 284static void conf(struct menu *menu, struct menu *active_menu);
284static void conf_choice(struct menu *menu); 285static void conf_choice(struct menu *menu);
@@ -777,10 +778,12 @@ static void conf_message_callback(const char *fmt, va_list ap)
777 char buf[PATH_MAX+1]; 778 char buf[PATH_MAX+1];
778 779
779 vsnprintf(buf, sizeof(buf), fmt, ap); 780 vsnprintf(buf, sizeof(buf), fmt, ap);
780 if (save_and_exit) 781 if (save_and_exit) {
781 printf("%s", buf); 782 if (!silent)
782 else 783 printf("%s", buf);
784 } else {
783 show_textbox(NULL, buf, 6, 60); 785 show_textbox(NULL, buf, 6, 60);
786 }
784} 787}
785 788
786static void show_help(struct menu *menu) 789static void show_help(struct menu *menu)
@@ -977,16 +980,18 @@ static int handle_exit(void)
977 } 980 }
978 /* fall through */ 981 /* fall through */
979 case -1: 982 case -1:
980 printf(_("\n\n" 983 if (!silent)
981 "*** End of the configuration.\n" 984 printf(_("\n\n"
982 "*** Execute 'make' to start the build or try 'make help'." 985 "*** End of the configuration.\n"
983 "\n\n")); 986 "*** Execute 'make' to start the build or try 'make help'."
987 "\n\n"));
984 res = 0; 988 res = 0;
985 break; 989 break;
986 default: 990 default:
987 fprintf(stderr, _("\n\n" 991 if (!silent)
988 "Your configuration changes were NOT saved." 992 fprintf(stderr, _("\n\n"
989 "\n\n")); 993 "Your configuration changes were NOT saved."
994 "\n\n"));
990 if (res != KEY_ESC) 995 if (res != KEY_ESC)
991 res = 0; 996 res = 0;
992 } 997 }
@@ -1010,6 +1015,12 @@ int main(int ac, char **av)
1010 1015
1011 signal(SIGINT, sig_handler); 1016 signal(SIGINT, sig_handler);
1012 1017
1018 if (ac > 1 && strcmp(av[1], "-s") == 0) {
1019 silent = 1;
1020 /* Silence conf_read() until the real callback is set up */
1021 conf_set_message_callback(NULL);
1022 av++;
1023 }
1013 conf_parse(av[1]); 1024 conf_parse(av[1]);
1014 conf_read(NULL); 1025 conf_read(NULL);
1015 1026
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index 984489ef2b46..d42d534a66cd 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -1482,6 +1482,11 @@ int main(int ac, char **av)
1482 bindtextdomain(PACKAGE, LOCALEDIR); 1482 bindtextdomain(PACKAGE, LOCALEDIR);
1483 textdomain(PACKAGE); 1483 textdomain(PACKAGE);
1484 1484
1485 if (ac > 1 && strcmp(av[1], "-s") == 0) {
1486 /* Silence conf_read() until the real callback is set up */
1487 conf_set_message_callback(NULL);
1488 av++;
1489 }
1485 conf_parse(av[1]); 1490 conf_parse(av[1]);
1486 conf_read(NULL); 1491 conf_read(NULL);
1487 1492
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 9d3b04b0769c..c3bb7fe8dfa6 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1746,7 +1746,7 @@ static const char *progname;
1746 1746
1747static void usage(void) 1747static void usage(void)
1748{ 1748{
1749 printf(_("%s <config>\n"), progname); 1749 printf(_("%s [-s] <config>\n"), progname);
1750 exit(0); 1750 exit(0);
1751} 1751}
1752 1752
@@ -1762,6 +1762,9 @@ int main(int ac, char** av)
1762 configApp = new QApplication(ac, av); 1762 configApp = new QApplication(ac, av);
1763 if (ac > 1 && av[1][0] == '-') { 1763 if (ac > 1 && av[1][0] == '-') {
1764 switch (av[1][1]) { 1764 switch (av[1][1]) {
1765 case 's':
1766 conf_set_message_callback(NULL);
1767 break;
1765 case 'h': 1768 case 'h':
1766 case '?': 1769 case '?':
1767 usage(); 1770 usage();