aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/mconf.c
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/mconf.c
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/mconf.c')
-rw-r--r--scripts/kconfig/mconf.c31
1 files changed, 21 insertions, 10 deletions
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