File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -827,6 +827,9 @@ int main(int ac, char **av)
827827 break ;
828828 }
829829
830+ if (conf_errors ())
831+ exit (1 );
832+
830833 if (sync_kconfig ) {
831834 name = getenv ("KCONFIG_NOSILENTUPDATE" );
832835 if (name && * name ) {
@@ -890,6 +893,9 @@ int main(int ac, char **av)
890893 break ;
891894 }
892895
896+ if (sym_dep_errors ())
897+ exit (1 );
898+
893899 if (input_mode == savedefconfig ) {
894900 if (conf_write_defconfig (defconfig_file )) {
895901 fprintf (stderr , "n*** Error while saving defconfig to: %s\n\n" ,
Original file line number Diff line number Diff line change @@ -155,6 +155,13 @@ static void conf_message(const char *fmt, ...)
155155static const char * conf_filename ;
156156static int conf_lineno , conf_warnings ;
157157
158+ bool conf_errors (void )
159+ {
160+ if (conf_warnings )
161+ return getenv ("KCONFIG_WERROR" );
162+ return false;
163+ }
164+
158165static void conf_warning (const char * fmt , ...)
159166{
160167 va_list ap ;
@@ -365,10 +372,9 @@ int conf_read_simple(const char *name, int def)
365372 char * p , * val ;
366373 struct symbol * sym ;
367374 int i , def_flags ;
368- const char * warn_unknown , * werror , * sym_name ;
375+ const char * warn_unknown , * sym_name ;
369376
370377 warn_unknown = getenv ("KCONFIG_WARN_UNKNOWN_SYMBOLS" );
371- werror = getenv ("KCONFIG_WERROR" );
372378 if (name ) {
373379 in = zconf_fopen (name );
374380 } else {
@@ -525,9 +531,6 @@ int conf_read_simple(const char *name, int def)
525531 free (line );
526532 fclose (in );
527533
528- if (conf_warnings && werror )
529- exit (1 );
530-
531534 return 0 ;
532535}
533536
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ void conf_set_changed(bool val);
1515bool conf_get_changed (void );
1616void conf_set_changed_callback (void (* fn )(void ));
1717void conf_set_message_callback (void (* fn )(const char * s ));
18+ bool conf_errors (void );
1819
1920/* symbol.c */
2021extern struct symbol * symbol_hash [SYMBOL_HASHSIZE ];
@@ -25,6 +26,7 @@ void print_symbol_for_listconfig(struct symbol *sym);
2526struct symbol * * sym_re_search (const char * pattern );
2627const char * sym_type_name (enum symbol_type type );
2728void sym_calc_value (struct symbol * sym );
29+ bool sym_dep_errors (void );
2830enum symbol_type sym_get_type (struct symbol * sym );
2931bool sym_tristate_within_range (struct symbol * sym ,tristate tri );
3032bool sym_set_tristate_value (struct symbol * sym ,tristate tri );
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ struct symbol symbol_no = {
3131
3232struct symbol * modules_sym ;
3333static tristate modules_val ;
34+ static int sym_warnings ;
3435
3536enum symbol_type sym_get_type (struct symbol * sym )
3637{
@@ -311,6 +312,14 @@ static void sym_warn_unmet_dep(struct symbol *sym)
311312 " Selected by [m]:\n" );
312313
313314 fputs (str_get (& gs ), stderr );
315+ sym_warnings ++ ;
316+ }
317+
318+ bool sym_dep_errors (void )
319+ {
320+ if (sym_warnings )
321+ return getenv ("KCONFIG_WERROR" );
322+ return false;
314323}
315324
316325void sym_calc_value (struct symbol * sym )
You can’t perform that action at this time.
0 commit comments