diff options
author | Michal Marek <mmarek@suse.cz> | 2015-04-08 07:30:42 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2015-04-09 11:44:34 -0400 |
commit | 0a1f00a1c86421cc07cec87011c7cf4df68ee54b (patch) | |
tree | 06a6169a2c87dea29e62d44abfc493337c4854d5 /scripts/kconfig | |
parent | 1cba0c305758c3c1786ecaceb03e142c95a4edc9 (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/Makefile | 40 | ||||
-rw-r--r-- | scripts/kconfig/conf.c | 8 | ||||
-rw-r--r-- | scripts/kconfig/gconf.c | 5 | ||||
-rw-r--r-- | scripts/kconfig/mconf.c | 31 | ||||
-rw-r--r-- | scripts/kconfig/nconf.c | 5 | ||||
-rw-r--r-- | scripts/kconfig/qconf.cc | 5 |
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 | |||
11 | Kconfig := Kconfig | 11 | Kconfig := Kconfig |
12 | endif | 12 | endif |
13 | 13 | ||
14 | ifeq ($(quiet),silent_) | ||
15 | silent := -s | ||
16 | endif | ||
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 |
15 | unexport CONFIG_ | 19 | unexport CONFIG_ |
16 | 20 | ||
17 | xconfig: $(obj)/qconf | 21 | xconfig: $(obj)/qconf |
18 | $< $(Kconfig) | 22 | $< $(silent) $(Kconfig) |
19 | 23 | ||
20 | gconfig: $(obj)/gconf | 24 | gconfig: $(obj)/gconf |
21 | $< $(Kconfig) | 25 | $< $(silent) $(Kconfig) |
22 | 26 | ||
23 | menuconfig: $(obj)/mconf | 27 | menuconfig: $(obj)/mconf |
24 | $< $(Kconfig) | 28 | $< $(silent) $(Kconfig) |
25 | 29 | ||
26 | config: $(obj)/conf | 30 | config: $(obj)/conf |
27 | $< --oldaskconfig $(Kconfig) | 31 | $< $(silent) --oldaskconfig $(Kconfig) |
28 | 32 | ||
29 | nconfig: $(obj)/nconf | 33 | nconfig: $(obj)/nconf |
30 | $< $(Kconfig) | 34 | $< $(silent) $(Kconfig) |
31 | 35 | ||
32 | silentoldconfig: $(obj)/conf | 36 | silentoldconfig: $(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 | ||
36 | localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf | 40 | localyesconfig 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 |
53 | update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h | 57 | update-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 \ | |||
77 | PHONY += $(simple-targets) | 81 | PHONY += $(simple-targets) |
78 | 82 | ||
79 | $(simple-targets): $(obj)/conf | 83 | $(simple-targets): $(obj)/conf |
80 | $< --$@ $(Kconfig) | 84 | $< $(silent) --$@ $(Kconfig) |
81 | 85 | ||
82 | PHONY += oldnoconfig savedefconfig defconfig | 86 | PHONY += oldnoconfig savedefconfig defconfig |
83 | 87 | ||
@@ -87,18 +91,18 @@ PHONY += oldnoconfig savedefconfig defconfig | |||
87 | oldnoconfig: olddefconfig | 91 | oldnoconfig: olddefconfig |
88 | 92 | ||
89 | savedefconfig: $(obj)/conf | 93 | savedefconfig: $(obj)/conf |
90 | $< --$@=defconfig $(Kconfig) | 94 | $< $(silent) --$@=defconfig $(Kconfig) |
91 | 95 | ||
92 | defconfig: $(obj)/conf | 96 | defconfig: $(obj)/conf |
93 | ifeq ($(KBUILD_DEFCONFIG),) | 97 | ifeq ($(KBUILD_DEFCONFIG),) |
94 | $< --defconfig $(Kconfig) | 98 | $< $(silent) --defconfig $(Kconfig) |
95 | else | 99 | else |
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) |
98 | endif | 102 | endif |
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 | ||
103 | configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@) | 107 | configfiles=$(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[] = { | |||
471 | static void conf_usage(const char *progname) | 471 | static 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; | |||
279 | static int single_menu_mode; | 279 | static int single_menu_mode; |
280 | static int show_all_options; | 280 | static int show_all_options; |
281 | static int save_and_exit; | 281 | static int save_and_exit; |
282 | static int silent; | ||
282 | 283 | ||
283 | static void conf(struct menu *menu, struct menu *active_menu); | 284 | static void conf(struct menu *menu, struct menu *active_menu); |
284 | static void conf_choice(struct menu *menu); | 285 | static 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 | ||
786 | static void show_help(struct menu *menu) | 789 | static 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 | ||
1747 | static void usage(void) | 1747 | static 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(); |