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/conf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'util/kconfig/conf.c') diff --git a/util/kconfig/conf.c b/util/kconfig/conf.c index fef75fc756..c421773114 100644 --- a/util/kconfig/conf.c +++ b/util/kconfig/conf.c @@ -17,6 +17,8 @@ #include "lkc.h" +int kconfig_warnings = 0; + static void conf(struct menu *menu); static void check_conf(struct menu *menu); static void xfgets(char *str, int size, FILE *in); @@ -493,6 +495,7 @@ int main(int ac, char **av) const char *progname = av[0]; int opt; const char *name, *defconfig_file = NULL /* gcc uninit */; + char *env; struct stat tmpstat; setlocale(LC_ALL, ""); @@ -681,6 +684,13 @@ int main(int ac, char **av) break; } + env = getenv("KCONFIG_STRICT"); + if (env && *env && kconfig_warnings) { + fprintf(stderr, _("\n*** ERROR: %d warnings encountered, and " + "warnings are errors.\n\n"), kconfig_warnings); + exit(1); + } + if (sync_kconfig) { /* silentoldconfig is used during the build so we shall update autoconf. * All other commands are only used to generate a config. -- cgit v1.2.3