soc/amd/*/acpi: drop unneeded pstate_cnt FADT assignment
[coreboot.git] / util / kconfig / conf.c
blobe68da2d44f0444239b748391a7c710edbacd032e
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
4 */
6 #include <ctype.h>
7 #include <limits.h>
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <string.h>
11 #include <time.h>
12 #include <unistd.h>
13 #include <getopt.h>
14 #include <sys/time.h>
15 #include <errno.h>
17 #include "lkc.h"
19 int kconfig_warnings = 0;
21 static void conf(struct menu *menu);
22 static void check_conf(struct menu *menu);
24 enum input_mode {
25 oldaskconfig,
26 syncconfig,
27 oldconfig,
28 allnoconfig,
29 allyesconfig,
30 allmodconfig,
31 alldefconfig,
32 randconfig,
33 defconfig,
34 savedefconfig,
35 listnewconfig,
36 helpnewconfig,
37 olddefconfig,
38 yes2modconfig,
39 mod2yesconfig,
40 mod2noconfig,
42 static enum input_mode input_mode = oldaskconfig;
43 static int input_mode_opt;
44 static int indent = 1;
45 static int tty_stdio;
46 static int sync_kconfig;
47 static int conf_cnt;
48 static char line[PATH_MAX];
49 static struct menu *rootEntry;
51 static void print_help(struct menu *menu)
53 struct gstr help = str_new();
55 menu_get_ext_help(menu, &help);
57 printf("\n%s\n", str_get(&help));
58 str_free(&help);
61 static void strip(char *str)
63 char *p = str;
64 int l;
66 while ((isspace(*p)))
67 p++;
68 l = strlen(p);
69 if (p != str)
70 memmove(str, p, l + 1);
71 if (!l)
72 return;
73 p = str + l - 1;
74 while ((isspace(*p)))
75 *p-- = 0;
78 /* Helper function to facilitate fgets() by Jean Sacren. */
79 static void xfgets(char *str, int size, FILE *in)
81 if (!fgets(str, size, in))
82 fprintf(stderr, "\nError in reading or end of file.\n");
84 if (!tty_stdio)
85 printf("%s", str);
88 static void set_randconfig_seed(void)
90 unsigned int seed;
91 char *env;
92 bool seed_set = false;
94 env = getenv("KCONFIG_SEED");
95 if (env && *env) {
96 char *endp;
98 seed = strtol(env, &endp, 0);
99 if (*endp == '\0')
100 seed_set = true;
103 if (!seed_set) {
104 struct timeval now;
107 * Use microseconds derived seed, compensate for systems where it may
108 * be zero.
110 gettimeofday(&now, NULL);
111 seed = (now.tv_sec + 1) * (now.tv_usec + 1);
114 printf("KCONFIG_SEED=0x%X\n", seed);
115 srand(seed);
118 static bool randomize_choice_values(struct symbol *csym)
120 struct property *prop;
121 struct symbol *sym;
122 struct expr *e;
123 int cnt, def;
126 * If choice is mod then we may have more items selected
127 * and if no then no-one.
128 * In both cases stop.
130 if (csym->curr.tri != yes)
131 return false;
133 prop = sym_get_choice_prop(csym);
135 /* count entries in choice block */
136 cnt = 0;
137 expr_list_for_each_sym(prop->expr, e, sym)
138 cnt++;
141 * find a random value and set it to yes,
142 * set the rest to no so we have only one set
144 def = rand() % cnt;
146 cnt = 0;
147 expr_list_for_each_sym(prop->expr, e, sym) {
148 if (def == cnt++) {
149 sym->def[S_DEF_USER].tri = yes;
150 csym->def[S_DEF_USER].val = sym;
151 } else {
152 sym->def[S_DEF_USER].tri = no;
154 sym->flags |= SYMBOL_DEF_USER;
155 /* clear VALID to get value calculated */
156 sym->flags &= ~SYMBOL_VALID;
158 csym->flags |= SYMBOL_DEF_USER;
159 /* clear VALID to get value calculated */
160 csym->flags &= ~SYMBOL_VALID;
162 return true;
165 enum conf_def_mode {
166 def_default,
167 def_yes,
168 def_mod,
169 def_no,
170 def_random
173 static bool conf_set_all_new_symbols(enum conf_def_mode mode)
175 struct symbol *sym, *csym;
176 int i, cnt;
178 * can't go as the default in switch-case below, otherwise gcc whines
179 * about -Wmaybe-uninitialized
181 int pby = 50; /* probability of bool = y */
182 int pty = 33; /* probability of tristate = y */
183 int ptm = 33; /* probability of tristate = m */
184 bool has_changed = false;
186 if (mode == def_random) {
187 int n, p[3];
188 char *env = getenv("KCONFIG_PROBABILITY");
190 n = 0;
191 while (env && *env) {
192 char *endp;
193 int tmp = strtol(env, &endp, 10);
195 if (tmp >= 0 && tmp <= 100) {
196 p[n++] = tmp;
197 } else {
198 errno = ERANGE;
199 perror("KCONFIG_PROBABILITY");
200 exit(1);
202 env = (*endp == ':') ? endp + 1 : endp;
203 if (n >= 3)
204 break;
206 switch (n) {
207 case 1:
208 pby = p[0];
209 ptm = pby / 2;
210 pty = pby - ptm;
211 break;
212 case 2:
213 pty = p[0];
214 ptm = p[1];
215 pby = pty + ptm;
216 break;
217 case 3:
218 pby = p[0];
219 pty = p[1];
220 ptm = p[2];
221 break;
224 if (pty + ptm > 100) {
225 errno = ERANGE;
226 perror("KCONFIG_PROBABILITY");
227 exit(1);
231 for_all_symbols(i, sym) {
232 if (sym_has_value(sym) || sym->flags & SYMBOL_VALID)
233 continue;
234 switch (sym_get_type(sym)) {
235 case S_BOOLEAN:
236 case S_TRISTATE:
237 has_changed = true;
238 switch (mode) {
239 case def_yes:
240 sym->def[S_DEF_USER].tri = yes;
241 break;
242 case def_mod:
243 sym->def[S_DEF_USER].tri = mod;
244 break;
245 case def_no:
246 sym->def[S_DEF_USER].tri = no;
247 break;
248 case def_random:
249 sym->def[S_DEF_USER].tri = no;
250 cnt = rand() % 100;
251 if (sym->type == S_TRISTATE) {
252 if (cnt < pty)
253 sym->def[S_DEF_USER].tri = yes;
254 else if (cnt < pty + ptm)
255 sym->def[S_DEF_USER].tri = mod;
256 } else if (cnt < pby)
257 sym->def[S_DEF_USER].tri = yes;
258 break;
259 default:
260 continue;
262 if (!(sym_is_choice(sym) && mode == def_random))
263 sym->flags |= SYMBOL_DEF_USER;
264 break;
265 default:
266 break;
271 sym_clear_all_valid();
274 * We have different type of choice blocks.
275 * If curr.tri equals to mod then we can select several
276 * choice symbols in one block.
277 * In this case we do nothing.
278 * If curr.tri equals yes then only one symbol can be
279 * selected in a choice block and we set it to yes,
280 * and the rest to no.
282 if (mode != def_random) {
283 for_all_symbols(i, csym) {
284 if ((sym_is_choice(csym) && !sym_has_value(csym)) ||
285 sym_is_choice_value(csym))
286 csym->flags |= SYMBOL_NEED_SET_CHOICE_VALUES;
290 for_all_symbols(i, csym) {
291 if (sym_has_value(csym) || !sym_is_choice(csym))
292 continue;
294 sym_calc_value(csym);
295 if (mode == def_random)
296 has_changed |= randomize_choice_values(csym);
297 else {
298 set_all_choice_values(csym);
299 has_changed = true;
303 return has_changed;
306 static void conf_rewrite_tristates(tristate old_val, tristate new_val)
308 struct symbol *sym;
309 int i;
311 for_all_symbols(i, sym) {
312 if (sym_get_type(sym) == S_TRISTATE &&
313 sym->def[S_DEF_USER].tri == old_val)
314 sym->def[S_DEF_USER].tri = new_val;
316 sym_clear_all_valid();
319 static int conf_askvalue(struct symbol *sym, const char *def)
321 if (!sym_has_value(sym))
322 printf("(NEW) ");
324 line[0] = '\n';
325 line[1] = 0;
327 if (!sym_is_changeable(sym)) {
328 printf("%s\n", def);
329 line[0] = '\n';
330 line[1] = 0;
331 return 0;
334 switch (input_mode) {
335 case oldconfig:
336 case syncconfig:
337 if (sym_has_value(sym)) {
338 printf("%s\n", def);
339 return 0;
341 /* fall through */
342 default:
343 fflush(stdout);
344 xfgets(line, sizeof(line), stdin);
345 break;
348 return 1;
351 static int conf_string(struct menu *menu)
353 struct symbol *sym = menu->sym;
354 const char *def;
356 while (1) {
357 printf("%*s%s ", indent - 1, "", menu->prompt->text);
358 printf("(%s) ", sym->name);
359 def = sym_get_string_value(sym);
360 if (def)
361 printf("[%s] ", def);
362 if (!conf_askvalue(sym, def))
363 return 0;
364 switch (line[0]) {
365 case '\n':
366 break;
367 case '?':
368 /* print help */
369 if (line[1] == '\n') {
370 print_help(menu);
371 def = NULL;
372 break;
374 /* fall through */
375 default:
376 line[strlen(line)-1] = 0;
377 def = line;
379 if (def && sym_set_string_value(sym, def))
380 return 0;
384 static int conf_sym(struct menu *menu)
386 struct symbol *sym = menu->sym;
387 tristate oldval, newval;
389 while (1) {
390 printf("%*s%s ", indent - 1, "", menu->prompt->text);
391 if (sym->name)
392 printf("(%s) ", sym->name);
393 putchar('[');
394 oldval = sym_get_tristate_value(sym);
395 switch (oldval) {
396 case no:
397 putchar('N');
398 break;
399 case mod:
400 putchar('M');
401 break;
402 case yes:
403 putchar('Y');
404 break;
406 if (oldval != no && sym_tristate_within_range(sym, no))
407 printf("/n");
408 if (oldval != mod && sym_tristate_within_range(sym, mod))
409 printf("/m");
410 if (oldval != yes && sym_tristate_within_range(sym, yes))
411 printf("/y");
412 printf("/?] ");
413 if (!conf_askvalue(sym, sym_get_string_value(sym)))
414 return 0;
415 strip(line);
417 switch (line[0]) {
418 case 'n':
419 case 'N':
420 newval = no;
421 if (!line[1] || !strcmp(&line[1], "o"))
422 break;
423 continue;
424 case 'm':
425 case 'M':
426 newval = mod;
427 if (!line[1])
428 break;
429 continue;
430 case 'y':
431 case 'Y':
432 newval = yes;
433 if (!line[1] || !strcmp(&line[1], "es"))
434 break;
435 continue;
436 case 0:
437 newval = oldval;
438 break;
439 case '?':
440 goto help;
441 default:
442 continue;
444 if (sym_set_tristate_value(sym, newval))
445 return 0;
446 help:
447 print_help(menu);
451 static int conf_choice(struct menu *menu)
453 struct symbol *sym, *def_sym;
454 struct menu *child;
455 bool is_new;
457 sym = menu->sym;
458 is_new = !sym_has_value(sym);
459 if (sym_is_changeable(sym)) {
460 conf_sym(menu);
461 sym_calc_value(sym);
462 switch (sym_get_tristate_value(sym)) {
463 case no:
464 return 1;
465 case mod:
466 return 0;
467 case yes:
468 break;
470 } else {
471 switch (sym_get_tristate_value(sym)) {
472 case no:
473 return 1;
474 case mod:
475 printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
476 return 0;
477 case yes:
478 break;
482 while (1) {
483 int cnt, def;
485 printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
486 def_sym = sym_get_choice_value(sym);
487 cnt = def = 0;
488 line[0] = 0;
489 for (child = menu->list; child; child = child->next) {
490 if (!menu_is_visible(child))
491 continue;
492 if (!child->sym) {
493 printf("%*c %s\n", indent, '*', menu_get_prompt(child));
494 continue;
496 cnt++;
497 if (child->sym == def_sym) {
498 def = cnt;
499 printf("%*c", indent, '>');
500 } else
501 printf("%*c", indent, ' ');
502 printf(" %d. %s", cnt, menu_get_prompt(child));
503 if (child->sym->name)
504 printf(" (%s)", child->sym->name);
505 if (!sym_has_value(child->sym))
506 printf(" (NEW)");
507 printf("\n");
509 printf("%*schoice", indent - 1, "");
510 if (cnt == 1) {
511 printf("[1]: 1\n");
512 goto conf_childs;
514 printf("[1-%d?]: ", cnt);
515 switch (input_mode) {
516 case oldconfig:
517 case syncconfig:
518 if (!is_new) {
519 cnt = def;
520 printf("%d\n", cnt);
521 break;
523 /* fall through */
524 case oldaskconfig:
525 fflush(stdout);
526 xfgets(line, sizeof(line), stdin);
527 strip(line);
528 if (line[0] == '?') {
529 print_help(menu);
530 continue;
532 if (!line[0])
533 cnt = def;
534 else if (isdigit(line[0]))
535 cnt = atoi(line);
536 else
537 continue;
538 break;
539 default:
540 break;
543 conf_childs:
544 for (child = menu->list; child; child = child->next) {
545 if (!child->sym || !menu_is_visible(child))
546 continue;
547 if (!--cnt)
548 break;
550 if (!child)
551 continue;
552 if (line[0] && line[strlen(line) - 1] == '?') {
553 print_help(child);
554 continue;
556 sym_set_choice_value(sym, child->sym);
557 for (child = child->list; child; child = child->next) {
558 indent += 2;
559 conf(child);
560 indent -= 2;
562 return 1;
566 static void conf(struct menu *menu)
568 struct symbol *sym;
569 struct property *prop;
570 struct menu *child;
572 if (!menu_is_visible(menu))
573 return;
575 sym = menu->sym;
576 prop = menu->prompt;
577 if (prop) {
578 const char *prompt;
580 switch (prop->type) {
581 case P_MENU:
583 * Except in oldaskconfig mode, we show only menus that
584 * contain new symbols.
586 if (input_mode != oldaskconfig && rootEntry != menu) {
587 check_conf(menu);
588 return;
590 /* fall through */
591 case P_COMMENT:
592 prompt = menu_get_prompt(menu);
593 if (prompt)
594 printf("%*c\n%*c %s\n%*c\n",
595 indent, '*',
596 indent, '*', prompt,
597 indent, '*');
598 default:
603 if (!sym)
604 goto conf_childs;
606 if (sym_is_choice(sym)) {
607 conf_choice(menu);
608 if (sym->curr.tri != mod)
609 return;
610 goto conf_childs;
613 switch (sym->type) {
614 case S_INT:
615 case S_HEX:
616 case S_STRING:
617 conf_string(menu);
618 break;
619 default:
620 conf_sym(menu);
621 break;
624 conf_childs:
625 if (sym)
626 indent += 2;
627 for (child = menu->list; child; child = child->next)
628 conf(child);
629 if (sym)
630 indent -= 2;
633 static void check_conf(struct menu *menu)
635 struct symbol *sym;
636 struct menu *child;
638 if (!menu_is_visible(menu))
639 return;
641 sym = menu->sym;
642 if (sym && !sym_has_value(sym) &&
643 (sym_is_changeable(sym) ||
644 (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes))) {
646 switch (input_mode) {
647 case listnewconfig:
648 if (sym->name)
649 print_symbol_for_listconfig(sym);
650 break;
651 case helpnewconfig:
652 printf("-----\n");
653 print_help(menu);
654 printf("-----\n");
655 break;
656 default:
657 if (!conf_cnt++)
658 printf("*\n* Restart config...\n*\n");
659 rootEntry = menu_get_parent_menu(menu);
660 conf(rootEntry);
661 break;
665 for (child = menu->list; child; child = child->next)
666 check_conf(child);
669 static const struct option long_opts[] = {
670 {"help", no_argument, NULL, 'h'},
671 {"silent", no_argument, NULL, 's'},
672 {"oldaskconfig", no_argument, &input_mode_opt, oldaskconfig},
673 {"oldconfig", no_argument, &input_mode_opt, oldconfig},
674 {"syncconfig", no_argument, &input_mode_opt, syncconfig},
675 {"defconfig", required_argument, &input_mode_opt, defconfig},
676 {"savedefconfig", required_argument, &input_mode_opt, savedefconfig},
677 {"allnoconfig", no_argument, &input_mode_opt, allnoconfig},
678 {"allyesconfig", no_argument, &input_mode_opt, allyesconfig},
679 {"allmodconfig", no_argument, &input_mode_opt, allmodconfig},
680 {"alldefconfig", no_argument, &input_mode_opt, alldefconfig},
681 {"randconfig", no_argument, &input_mode_opt, randconfig},
682 {"listnewconfig", no_argument, &input_mode_opt, listnewconfig},
683 {"helpnewconfig", no_argument, &input_mode_opt, helpnewconfig},
684 {"olddefconfig", no_argument, &input_mode_opt, olddefconfig},
685 {"yes2modconfig", no_argument, &input_mode_opt, yes2modconfig},
686 {"mod2yesconfig", no_argument, &input_mode_opt, mod2yesconfig},
687 {"mod2noconfig", no_argument, &input_mode_opt, mod2noconfig},
688 {NULL, 0, NULL, 0}
691 static void conf_usage(const char *progname)
693 printf("Usage: %s [options] <kconfig-file>\n", progname);
694 printf("\n");
695 printf("Generic options:\n");
696 printf(" -h, --help Print this message and exit.\n");
697 printf(" -s, --silent Do not print log.\n");
698 printf("\n");
699 printf("Mode options:\n");
700 printf(" --listnewconfig List new options\n");
701 printf(" --helpnewconfig List new options and help text\n");
702 printf(" --oldaskconfig Start a new configuration using a line-oriented program\n");
703 printf(" --oldconfig Update a configuration using a provided .config as base\n");
704 printf(" --syncconfig Similar to oldconfig but generates configuration in\n"
705 " include/{generated/,config/}\n");
706 printf(" --olddefconfig Same as oldconfig but sets new symbols to their default value\n");
707 printf(" --defconfig <file> New config with default defined in <file>\n");
708 printf(" --savedefconfig <file> Save the minimal current configuration to <file>\n");
709 printf(" --allnoconfig New config where all options are answered with no\n");
710 printf(" --allyesconfig New config where all options are answered with yes\n");
711 printf(" --allmodconfig New config where all options are answered with mod\n");
712 printf(" --alldefconfig New config with all symbols set to default\n");
713 printf(" --randconfig New config with random answer to all options\n");
714 printf(" --yes2modconfig Change answers from yes to mod if possible\n");
715 printf(" --mod2yesconfig Change answers from mod to yes if possible\n");
716 printf(" --mod2noconfig Change answers from mod to no if possible\n");
717 printf(" (If none of the above is given, --oldaskconfig is the default)\n");
720 int main(int ac, char **av)
722 const char *progname = av[0];
723 int opt;
724 const char *name, *defconfig_file = NULL /* gcc uninit */;
725 char *env;
726 int no_conf_write = 0;
728 tty_stdio = isatty(0) && isatty(1);
730 while ((opt = getopt_long(ac, av, "hs", long_opts, NULL)) != -1) {
731 switch (opt) {
732 case 'h':
733 conf_usage(progname);
734 exit(1);
735 break;
736 case 's':
737 conf_set_message_callback(NULL);
738 break;
739 case 0:
740 input_mode = input_mode_opt;
741 switch (input_mode) {
742 case syncconfig:
744 * syncconfig is invoked during the build stage.
745 * Suppress distracting
746 * "configuration written to ..."
748 conf_set_message_callback(NULL);
749 sync_kconfig = 1;
750 break;
751 case defconfig:
752 case savedefconfig:
753 defconfig_file = optarg;
754 break;
755 case randconfig:
756 set_randconfig_seed();
757 break;
758 default:
759 break;
761 default:
762 break;
765 if (ac == optind) {
766 fprintf(stderr, "%s: Kconfig file missing\n", av[0]);
767 conf_usage(progname);
768 exit(1);
770 conf_parse(av[optind]);
771 //zconfdump(stdout);
773 switch (input_mode) {
774 case defconfig:
775 if (conf_read(defconfig_file)) {
776 fprintf(stderr,
777 "***\n"
778 "*** Can't find default configuration \"%s\"!\n"
779 "***\n",
780 defconfig_file);
781 exit(1);
783 break;
784 case savedefconfig:
785 case syncconfig:
786 case oldaskconfig:
787 case oldconfig:
788 case listnewconfig:
789 case helpnewconfig:
790 case olddefconfig:
791 case yes2modconfig:
792 case mod2yesconfig:
793 case mod2noconfig:
794 conf_read(NULL);
795 break;
796 case allnoconfig:
797 case allyesconfig:
798 case allmodconfig:
799 case alldefconfig:
800 case randconfig:
801 name = getenv("KCONFIG_ALLCONFIG");
802 if (!name)
803 break;
804 if ((strcmp(name, "") != 0) && (strcmp(name, "1") != 0)) {
805 if (conf_read_simple(name, S_DEF_USER)) {
806 fprintf(stderr,
807 "*** Can't read seed configuration \"%s\"!\n",
808 name);
809 exit(1);
811 break;
813 switch (input_mode) {
814 case allnoconfig: name = "allno.config"; break;
815 case allyesconfig: name = "allyes.config"; break;
816 case allmodconfig: name = "allmod.config"; break;
817 case alldefconfig: name = "alldef.config"; break;
818 case randconfig: name = "allrandom.config"; break;
819 default: break;
821 if (conf_read_simple(name, S_DEF_USER) &&
822 conf_read_simple("all.config", S_DEF_USER)) {
823 fprintf(stderr,
824 "*** KCONFIG_ALLCONFIG set, but no \"%s\" or \"all.config\" file found\n",
825 name);
826 exit(1);
828 break;
829 default:
830 break;
833 env = getenv("KCONFIG_STRICT");
834 if (env && *env && kconfig_warnings) {
835 fprintf(stderr, "\n*** ERROR: %d warnings encountered, and "
836 "warnings are errors.\n\n", kconfig_warnings);
837 exit(1);
840 if (sync_kconfig) {
841 name = getenv("KCONFIG_NOSILENTUPDATE");
842 if (name && *name) {
843 if (conf_get_changed()) {
844 fprintf(stderr,
845 "\n*** The configuration requires explicit update.\n\n");
846 return 1;
848 no_conf_write = 1;
852 switch (input_mode) {
853 case allnoconfig:
854 conf_set_all_new_symbols(def_no);
855 break;
856 case allyesconfig:
857 conf_set_all_new_symbols(def_yes);
858 break;
859 case allmodconfig:
860 conf_set_all_new_symbols(def_mod);
861 break;
862 case alldefconfig:
863 conf_set_all_new_symbols(def_default);
864 break;
865 case randconfig:
866 /* Really nothing to do in this loop */
867 while (conf_set_all_new_symbols(def_random)) ;
868 break;
869 case defconfig:
870 conf_set_all_new_symbols(def_default);
871 break;
872 case savedefconfig:
873 break;
874 case yes2modconfig:
875 conf_rewrite_tristates(yes, mod);
876 break;
877 case mod2yesconfig:
878 conf_rewrite_tristates(mod, yes);
879 break;
880 case mod2noconfig:
881 conf_rewrite_tristates(mod, no);
882 break;
883 case oldaskconfig:
884 rootEntry = &rootmenu;
885 conf(&rootmenu);
886 input_mode = oldconfig;
887 /* fall through */
888 case oldconfig:
889 case listnewconfig:
890 case helpnewconfig:
891 case syncconfig:
892 /* Update until a loop caused no more changes */
893 do {
894 conf_cnt = 0;
895 check_conf(&rootmenu);
896 } while (conf_cnt);
897 break;
898 case olddefconfig:
899 default:
900 break;
903 if (input_mode == savedefconfig) {
904 if (conf_write_defconfig(defconfig_file)) {
905 fprintf(stderr, "\n*** Error while saving defconfig to: %s\n\n",
906 defconfig_file);
907 return 1;
909 } else if (input_mode != listnewconfig && input_mode != helpnewconfig) {
910 if (!no_conf_write && conf_write(NULL)) {
911 fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
912 exit(1);
916 * Create auto.conf if it does not exist.
917 * This prevents GNU Make 4.1 or older from emitting
918 * "include/config/auto.conf: No such file or directory"
919 * in the top-level Makefile
921 * syncconfig always creates or updates auto.conf because it is
922 * used during the build.
924 if (conf_write_autoconf(sync_kconfig) && sync_kconfig) {
925 fprintf(stderr,
926 "\n*** Error during sync of the configuration.\n\n");
927 return 1;
930 return 0;