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.
Unified · Split
| @@ -11,27 +11,31 @@ else · 10 unmodified lines | ||
| 11 | 11 | Kconfig := Kconfig |
| 12 | 12 | endif |
| 13 | 13 | |
| 14 | +ifeq ($(quiet),silent_) | |
| 15 | +silent := -s | |
| 16 | +endif | |
| 17 | + | |
| 14 | 18 | # We need this, in case the user has it in its environment |
| 15 | 19 | unexport CONFIG_ |
| 16 | 20 | |
| 17 | 21 | xconfig: $(obj)/qconf |
| 18 | − $< $(Kconfig) | |
| 22 | + $< $(silent) $(Kconfig) | |
| 19 | 23 | |
| 20 | 24 | gconfig: $(obj)/gconf |
| 21 | − $< $(Kconfig) | |
| 25 | + $< $(silent) $(Kconfig) | |
| 22 | 26 | |
| 23 | 27 | menuconfig: $(obj)/mconf |
| 24 | − $< $(Kconfig) | |
| 28 | + $< $(silent) $(Kconfig) | |
| 25 | 29 | |
| 26 | 30 | config: $(obj)/conf |
| 27 | − $< --oldaskconfig $(Kconfig) | |
| 31 | + $< $(silent) --oldaskconfig $(Kconfig) | |
| 28 | 32 | |
| 29 | 33 | nconfig: $(obj)/nconf |
| 30 | − $< $(Kconfig) | |
| 34 | + $< $(silent) $(Kconfig) | |
| 31 | 35 | |
| 32 | 36 | silentoldconfig: $(obj)/conf |
| 33 | 37 | $(Q)mkdir -p include/config include/generated |
| 34 | − $< --$@ $(Kconfig) | |
| 38 | + $< $(silent) --$@ $(Kconfig) | |
| 35 | 39 | |
| 36 | 40 | localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf |
| 37 | 41 | $(Q)mkdir -p include/config include/generated |
| @@ -40,18 +44,18 @@ localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf · 2 unmodified lines | ||
| 40 | 44 | cmp -s .tmp.config .config || \ |
| 41 | 45 | (mv -f .config .config.old.1; \ |
| 42 | 46 | mv -f .tmp.config .config; \ |
| 43 | − $(obj)/conf --silentoldconfig $(Kconfig); \ | |
| 47 | + $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \ | |
| 44 | 48 | mv -f .config.old.1 .config.old) \ |
| 45 | 49 | else \ |
| 46 | 50 | mv -f .tmp.config .config; \ |
| 47 | − $(obj)/conf --silentoldconfig $(Kconfig); \ | |
| 51 | + $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \ | |
| 48 | 52 | fi |
| 49 | 53 | $(Q)rm -f .tmp.config |
| 50 | 54 | |
| 51 | 55 | # Create new linux.pot file |
| 52 | 56 | # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files |
| 53 | 57 | update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h |
| 54 | − $(Q)echo " GEN config.pot" | |
| 58 | + $(Q)$(kecho) " GEN config.pot" | |
| 55 | 59 | $(Q)xgettext --default-domain=linux \ |
| 56 | 60 | --add-comments --keyword=_ --keyword=N_ \ |
| 57 | 61 | --from-code=UTF-8 \ |
| @@ -62,11 +66,11 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h · 4 unmodified lines | ||
| 62 | 66 | $(Q)(for i in `ls $(srctree)/arch/*/Kconfig \ |
| 63 | 67 | $(srctree)/arch/*/um/Kconfig`; \ |
| 64 | 68 | do \ |
| 65 | − echo " GEN $$i"; \ | |
| 69 | + $(kecho) " GEN $$i"; \ | |
| 66 | 70 | $(obj)/kxgettext $$i \ |
| 67 | 71 | >> $(obj)/config.pot; \ |
| 68 | 72 | done ) |
| 69 | − $(Q)echo " GEN linux.pot" | |
| 73 | + $(Q)$(kecho) " GEN linux.pot" | |
| 70 | 74 | $(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \ |
| 71 | 75 | --output $(obj)/linux.pot |
| 72 | 76 | $(Q)rm -f $(obj)/config.pot |
| @@ -77,7 +81,7 @@ simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \ · 4 unmodified lines | ||
| 77 | 81 | PHONY += $(simple-targets) |
| 78 | 82 | |
| 79 | 83 | $(simple-targets): $(obj)/conf |
| 80 | − $< --$@ $(Kconfig) | |
| 84 | + $< $(silent) --$@ $(Kconfig) | |
| 81 | 85 | |
| 82 | 86 | PHONY += oldnoconfig savedefconfig defconfig |
| 83 | 87 | |
| @@ -87,18 +91,18 @@ PHONY += oldnoconfig savedefconfig defconfig · 3 unmodified lines | ||
| 87 | 91 | oldnoconfig: olddefconfig |
| 88 | 92 | |
| 89 | 93 | savedefconfig: $(obj)/conf |
| 90 | − $< --$@=defconfig $(Kconfig) | |
| 94 | + $< $(silent) --$@=defconfig $(Kconfig) | |
| 91 | 95 | |
| 92 | 96 | defconfig: $(obj)/conf |
| 93 | 97 | ifeq ($(KBUILD_DEFCONFIG),) |
| 94 | − $< --defconfig $(Kconfig) | |
| 98 | + $< $(silent) --defconfig $(Kconfig) | |
| 95 | 99 | else |
| 96 | − @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" | |
| 97 | − $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) | |
| 100 | + @$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" | |
| 101 | + $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) | |
| 98 | 102 | endif |
| 99 | 103 | |
| 100 | 104 | %_defconfig: $(obj)/conf |
| 101 | − $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) | |
| 105 | + $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) | |
| 102 | 106 | |
| 103 | 107 | configfiles=$(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 | 220 | # QT needs some extra effort... |
| 217 | 221 | $(obj)/.tmp_qtcheck: |
| 218 | − @set -e; echo " CHECK qt"; dir=""; pkg=""; \ | |
| 222 | + @set -e; $(kecho) " CHECK qt"; dir=""; pkg=""; \ | |
| 219 | 223 | if ! pkg-config --exists QtCore 2> /dev/null; then \ |
| 220 | 224 | echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \ |
| 221 | 225 | pkg-config --exists qt 2> /dev/null && pkg=qt; \ |
| @@ -471,7 +471,7 @@ static struct option long_opts[] = { · 470 unmodified lines | ||
| 471 | 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 | 475 | printf("[option] is _one_ of the following:\n"); |
| 476 | 476 | printf(" --listnewconfig List new options\n"); |
| 477 | 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 | 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 | 509 | input_mode = (enum input_mode)opt; |
| 506 | 510 | switch (opt) { |
| 507 | 511 | case silentoldconfig: |
| @@ -1474,9 +1474,12 @@ int main(int ac, char *av[]) · 1473 unmodified lines | ||
| 1474 | 1474 | case 'a': |
| 1475 | 1475 | //showAll = 1; |
| 1476 | 1476 | break; |
| 1477 | + case 's': | |
| 1478 | + conf_set_message_callback(NULL); | |
| 1479 | + break; | |
| 1477 | 1480 | case 'h': |
| 1478 | 1481 | case '?': |
| 1479 | − printf("%s <config>\n", av[0]); | |
| 1482 | + printf("%s [-s] <config>\n", av[0]); | |
| 1480 | 1483 | exit(0); |
| 1481 | 1484 | } |
| 1482 | 1485 | name = av[2]; |
| @@ -279,6 +279,7 @@ static int child_count; · 278 unmodified lines | ||
| 279 | 279 | static int single_menu_mode; |
| 280 | 280 | static int show_all_options; |
| 281 | 281 | static int save_and_exit; |
| 282 | +static int silent; | |
| 282 | 283 | |
| 283 | 284 | static void conf(struct menu *menu, struct menu *active_menu); |
| 284 | 285 | static 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 | 778 | char buf[PATH_MAX+1]; |
| 778 | 779 | |
| 779 | 780 | vsnprintf(buf, sizeof(buf), fmt, ap); |
| 780 | − if (save_and_exit) | |
| 781 | − printf("%s", buf); | |
| 782 | − else | |
| 781 | + if (save_and_exit) { | |
| 782 | + if (!silent) | |
| 783 | + printf("%s", buf); | |
| 784 | + } else { | |
| 783 | 785 | show_textbox(NULL, buf, 6, 60); |
| 786 | + } | |
| 784 | 787 | } |
| 785 | 788 | |
| 786 | 789 | static void show_help(struct menu *menu) |
| @@ -977,16 +980,18 @@ static int handle_exit(void) · 190 unmodified lines | ||
| 977 | 980 | } |
| 978 | 981 | /* fall through */ |
| 979 | 982 | case -1: |
| 980 | − printf(_("\n\n" | |
| 981 | − "*** End of the configuration.\n" | |
| 982 | − "*** Execute 'make' to start the build or try 'make help'." | |
| 983 | − "\n\n")); | |
| 983 | + if (!silent) | |
| 984 | + printf(_("\n\n" | |
| 985 | + "*** End of the configuration.\n" | |
| 986 | + "*** Execute 'make' to start the build or try 'make help'." | |
| 987 | + "\n\n")); | |
| 984 | 988 | res = 0; |
| 985 | 989 | break; |
| 986 | 990 | default: |
| 987 | − fprintf(stderr, _("\n\n" | |
| 988 | − "Your configuration changes were NOT saved." | |
| 989 | − "\n\n")); | |
| 991 | + if (!silent) | |
| 992 | + fprintf(stderr, _("\n\n" | |
| 993 | + "Your configuration changes were NOT saved." | |
| 994 | + "\n\n")); | |
| 990 | 995 | if (res != KEY_ESC) |
| 991 | 996 | res = 0; |
| 992 | 997 | } |
| @@ -1010,6 +1015,12 @@ int main(int ac, char **av) · 17 unmodified lines | ||
| 1010 | 1015 | |
| 1011 | 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 | 1024 | conf_parse(av[1]); |
| 1014 | 1025 | conf_read(NULL); |
| 1015 | 1026 | |
| @@ -1482,6 +1482,11 @@ int main(int ac, char **av) · 1481 unmodified lines | ||
| 1482 | 1482 | bindtextdomain(PACKAGE, LOCALEDIR); |
| 1483 | 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 | 1490 | conf_parse(av[1]); |
| 1486 | 1491 | conf_read(NULL); |
| 1487 | 1492 | |
| @@ -1746,7 +1746,7 @@ static const char *progname; · 1745 unmodified lines | ||
| 1746 | 1746 | |
| 1747 | 1747 | static void usage(void) |
| 1748 | 1748 | { |
| 1749 | − printf(_("%s <config>\n"), progname); | |
| 1749 | + printf(_("%s [-s] <config>\n"), progname); | |
| 1750 | 1750 | exit(0); |
| 1751 | 1751 | } |
| 1752 | 1752 | |
| @@ -1762,6 +1762,9 @@ int main(int ac, char** av) · 9 unmodified lines | ||
| 1762 | 1762 | configApp = new QApplication(ac, av); |
| 1763 | 1763 | if (ac > 1 && av[1][0] == '-') { |
| 1764 | 1764 | switch (av[1][1]) { |
| 1765 | + case 's': | |
| 1766 | + conf_set_message_callback(NULL); | |
| 1767 | + break; | |
| 1765 | 1768 | case 'h': |
| 1766 | 1769 | case '?': |
| 1767 | 1770 | usage(); |