From 57a31317a26ff5f55638c4f3dd8d06b8a69b78f2 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Thu, 20 Aug 2015 11:19:34 -0700 Subject: kconfig: Allow KCONFIG_STRICT outside of confdata.c To catch dependency errors in symbol.c (such as the ones fixed by I51b4ee326f082c6a656a813ee5772e9c34f5c343) we need to check for global kconfig warnings before saving config files. This patch will produce errors for wrong dependencies and add catching of errors to conf, nconf and mconf. Sorry, gconf users, you will have to wait. Change-Id: Idf7ee406ce3869941af319219aea16fab826df84 Signed-off-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/11291 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- util/kconfig/mconf.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'util/kconfig/mconf.c') diff --git a/util/kconfig/mconf.c b/util/kconfig/mconf.c index 1d651c1382..b4a08440af 100644 --- a/util/kconfig/mconf.c +++ b/util/kconfig/mconf.c @@ -952,6 +952,7 @@ static void conf_save(void) static int handle_exit(void) { int res; + char *env; save_and_exit = 1; reset_subtitle(); @@ -966,6 +967,13 @@ static int handle_exit(void) end_dialog(saved_x, saved_y); + env = getenv("KCONFIG_STRICT"); + if (env && *env && kconfig_warnings) { + fprintf(stderr, _("\n*** ERROR: %d warnings encountered, and " + "warnings are errors.\n\n"), kconfig_warnings); + res = 2; + } + switch (res) { case 0: if (conf_write(filename)) { -- cgit v1.2.3