History

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.

Michal Marek committed 11 years ago

Commit 0a1f00a1 parent 1cba0c36 files · +62 −32Browse files

Showing the changes to scripts (6 of 6 files). Show all

Unified · Split

6 files
  1. scripts/kconfig/Makefile +22 −18
  2. scripts/kconfig/conf.c +6 −2
  3. scripts/kconfig/gconf.c +4 −1
  4. scripts/kconfig/mconf.c +21 −10
  5. scripts/kconfig/nconf.c +5 −0
  6. scripts/kconfig/qconf.cc +4 −1
scripts/kconfig/Makefile+22−18
@@ -11,27 +11,31 @@ else · 10 unmodified lines
11Kconfig := Kconfig11Kconfig := Kconfig
12endif12endif
13 13
14ifeq ($(quiet),silent_)
15silent := -s
16endif
17
14# We need this, in case the user has it in its environment18# We need this, in case the user has it in its environment
15unexport CONFIG_19unexport CONFIG_
16 20
17xconfig: $(obj)/qconf21xconfig: $(obj)/qconf
18 $< $(Kconfig)22 $< $(silent) $(Kconfig)
19 23
20gconfig: $(obj)/gconf24gconfig: $(obj)/gconf
21 $< $(Kconfig)25 $< $(silent) $(Kconfig)
22 26
23menuconfig: $(obj)/mconf27menuconfig: $(obj)/mconf
24 $< $(Kconfig)28 $< $(silent) $(Kconfig)
25 29
26config: $(obj)/conf30config: $(obj)/conf
27 $< --oldaskconfig $(Kconfig)31 $< $(silent) --oldaskconfig $(Kconfig)
28 32
29nconfig: $(obj)/nconf33nconfig: $(obj)/nconf
30 $< $(Kconfig)34 $< $(silent) $(Kconfig)
31 35
32silentoldconfig: $(obj)/conf36silentoldconfig: $(obj)/conf
33 $(Q)mkdir -p include/config include/generated37 $(Q)mkdir -p include/config include/generated
34 $< --$@ $(Kconfig)38 $< $(silent) --$@ $(Kconfig)
35 39
36localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf40localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
37 $(Q)mkdir -p include/config include/generated41 $(Q)mkdir -p include/config include/generated
@@ -40,18 +44,18 @@ localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf · 2 unmodified lines
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 fi52 fi
49 $(Q)rm -f .tmp.config53 $(Q)rm -f .tmp.config
50 54
51# Create new linux.pot file55# Create new linux.pot file
52# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files56# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
53update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h57update-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 · 4 unmodified lines
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.pot75 --output $(obj)/linux.pot
72 $(Q)rm -f $(obj)/config.pot76 $(Q)rm -f $(obj)/config.pot
@@ -77,7 +81,7 @@ simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \ · 4 unmodified lines
77PHONY += $(simple-targets)81PHONY += $(simple-targets)
78 82
79$(simple-targets): $(obj)/conf83$(simple-targets): $(obj)/conf
80 $< --$@ $(Kconfig)84 $< $(silent) --$@ $(Kconfig)
81 85
82PHONY += oldnoconfig savedefconfig defconfig86PHONY += oldnoconfig savedefconfig defconfig
83 87
@@ -87,18 +91,18 @@ PHONY += oldnoconfig savedefconfig defconfig · 3 unmodified lines
87oldnoconfig: olddefconfig91oldnoconfig: olddefconfig
88 92
89savedefconfig: $(obj)/conf93savedefconfig: $(obj)/conf
90 $< --$@=defconfig $(Kconfig)94 $< $(silent) --$@=defconfig $(Kconfig)
91 95
92defconfig: $(obj)/conf96defconfig: $(obj)/conf
93ifeq ($(KBUILD_DEFCONFIG),)97ifeq ($(KBUILD_DEFCONFIG),)
94 $< --defconfig $(Kconfig)98 $< $(silent) --defconfig $(Kconfig)
95else99else
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)
98endif102endif
99 103
100%_defconfig: $(obj)/conf104%_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 · 110 unmodified lines
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; \
scripts/kconfig/conf.c+6−2
@@ -471,7 +471,7 @@ static struct option long_opts[] = { · 470 unmodified lines
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) · 23 unmodified lines
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:
scripts/kconfig/gconf.c+4−1
@@ -1474,9 +1474,12 @@ int main(int ac, char *av[]) · 1473 unmodified lines
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];
scripts/kconfig/mconf.c+21−10
@@ -279,6 +279,7 @@ static int child_count; · 278 unmodified lines
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) · 492 unmodified lines
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 else783 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) · 190 unmodified lines
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) · 17 unmodified lines
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
scripts/kconfig/nconf.c+5−0
@@ -1482,6 +1482,11 @@ int main(int ac, char **av) · 1481 unmodified lines
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
scripts/kconfig/qconf.cc+4−1
@@ -1746,7 +1746,7 @@ static const char *progname; · 1745 unmodified lines
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) · 9 unmodified lines
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();