Lines Matching +full:conf +full:- +full:ds
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
91 * For example, if 'include/config/auto.conf' is given, create 'include/config'.
99 tmp[sizeof(tmp) - 1] = 0; in make_parent_dir()
117 return -1; in make_parent_dir()
137 return -1; in conf_touch_dep()
142 if (fd == -1) in conf_touch_dep()
143 return -1; in conf_touch_dep()
209 return name ? name : "include/config/auto.conf"; in conf_get_autoconfig_name()
230 switch (sym->type) { in conf_set_sym_val()
233 sym->def[def].tri = mod; in conf_set_sym_val()
234 sym->flags |= def_flags; in conf_set_sym_val()
240 sym->def[def].tri = yes; in conf_set_sym_val()
241 sym->flags |= def_flags; in conf_set_sym_val()
245 sym->def[def].tri = no; in conf_set_sym_val()
246 sym->flags |= def_flags; in conf_set_sym_val()
251 p, sym->name); in conf_set_sym_val()
254 /* No escaping for S_DEF_AUTO (include/config/auto.conf) */ in conf_set_sym_val()
274 sym->def[def].val = xstrdup(p); in conf_set_sym_val()
275 sym->flags |= def_flags; in conf_set_sym_val()
279 p, sym->name); in conf_set_sym_val()
295 new_size += LINE_GROWTH - 1; in add_byte()
299 return -1; in add_byte()
329 return -1; in compat_getline()
339 line[slen-1] = '\0'; in compat_getline()
341 return -1; in compat_getline()
412 sym->flags |= SYMBOL_CHANGED; in conf_read_simple()
413 sym->flags &= ~(def_flags|SYMBOL_VALID); in conf_read_simple()
415 sym->flags |= def_flags; in conf_read_simple()
416 switch (sym->type) { in conf_read_simple()
420 if (sym->def[def].val) in conf_read_simple()
421 free(sym->def[def].val); in conf_read_simple()
424 sym->def[def].val = NULL; in conf_read_simple()
425 sym->def[def].tri = no; in conf_read_simple()
429 while (compat_getline(&line, &line_asize, in) != -1) { in conf_read_simple()
453 if (sym->type == S_UNKNOWN) in conf_read_simple()
454 sym->type = S_BOOLEAN; in conf_read_simple()
456 if (sym->flags & def_flags) { in conf_read_simple()
457 conf_warning("override: reassigning to symbol %s", sym->name); in conf_read_simple()
459 switch (sym->type) { in conf_read_simple()
462 sym->def[def].tri = no; in conf_read_simple()
463 sym->flags |= def_flags; in conf_read_simple()
475 *p2-- = 0; in conf_read_simple()
484 * Reading from include/config/auto.conf in conf_read_simple()
486 * auto.conf but it is missing now, in conf_read_simple()
500 if (sym->flags & def_flags) { in conf_read_simple()
501 conf_warning("override: reassigning to symbol %s", sym->name); in conf_read_simple()
515 switch (sym->def[def].tri) { in conf_read_simple()
519 if (cs->def[def].tri == yes) { in conf_read_simple()
520 conf_warning("%s creates inconsistent choice state", sym->name); in conf_read_simple()
521 cs->flags &= ~def_flags; in conf_read_simple()
525 if (cs->def[def].tri != no) in conf_read_simple()
526 conf_warning("override: %s changes choice state", sym->name); in conf_read_simple()
527 cs->def[def].val = sym; in conf_read_simple()
530 cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri); in conf_read_simple()
559 if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE)) in conf_read()
561 if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { in conf_read()
563 switch (sym->type) { in conf_read()
566 if (sym->def[S_DEF_USER].tri == sym_get_tristate_value(sym)) in conf_read()
570 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) in conf_read()
574 } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE)) in conf_read()
588 if (sym->visible == no && !conf_unsaved) in conf_read()
589 sym->flags &= ~SYMBOL_DEF_USER; in conf_read()
590 switch (sym->type) { in conf_read()
595 if (sym_string_within_range(sym, sym->def[S_DEF_USER].val)) in conf_read()
597 sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER); in conf_read()
635 fprintf(fp, "%s\n", cs->prefix); in conf_write_heading()
638 cs->decoration); in conf_write_heading()
640 fprintf(fp, "%s %s\n", cs->decoration, rootmenu.prompt->text); in conf_write_heading()
642 fprintf(fp, "%s\n", cs->postfix); in conf_write_heading()
696 if (sym->type == S_UNKNOWN) in __print_symbol()
701 if ((sym->type == S_BOOLEAN || sym->type == S_TRISTATE) && in __print_symbol()
704 fprintf(fp, "# %s%s is not set\n", CONFIG_, sym->name); in __print_symbol()
708 if (sym->type == S_STRING && escape_string) { in __print_symbol()
713 fprintf(fp, "%s%s=%s\n", CONFIG_, sym->name, val); in __print_symbol()
740 if (sym->type == S_UNKNOWN) in print_symbol_for_c()
745 switch (sym->type) { in print_symbol_for_c()
769 fprintf(fp, "#define %s%s%s %s%s\n", CONFIG_, sym->name, sym_suffix, in print_symbol_for_c()
783 if (sym->type == S_UNKNOWN) in print_symbol_for_rustccfg()
788 switch (sym->type) { in print_symbol_for_rustccfg()
800 * we provide an empty `--cfg CONFIG_X` here in both `y` in print_symbol_for_rustccfg()
804 * a `--cfg CONFIG_X="y"` or `--cfg CONFIG_X="m"`, which can in print_symbol_for_rustccfg()
807 fprintf(fp, "--cfg=%s%s\n", CONFIG_, sym->name); in print_symbol_for_rustccfg()
824 /* All values get escaped: the `--cfg` option only takes strings */ in print_symbol_for_rustccfg()
828 fprintf(fp, "--cfg=%s%s=%s\n", CONFIG_, sym->name, val); in print_symbol_for_rustccfg()
855 sym = menu->sym; in conf_write_defconfig()
861 if (!(sym->flags & SYMBOL_WRITE)) in conf_write_defconfig()
863 sym->flags &= ~SYMBOL_WRITE; in conf_write_defconfig()
864 /* If we cannot change the symbol - skip */ in conf_write_defconfig()
867 /* If symbol equals to default value - skip */ in conf_write_defconfig()
873 * default for a choice - skip. in conf_write_defconfig()
880 struct symbol *ds; in conf_write_defconfig() local
883 ds = sym_choice_default(cs); in conf_write_defconfig()
884 if (!sym_is_optional(cs) && sym == ds) { in conf_write_defconfig()
885 if ((sym->type == S_BOOLEAN) && in conf_write_defconfig()
893 if (menu->list != NULL) { in conf_write_defconfig()
894 menu = menu->list; in conf_write_defconfig()
896 else if (menu->next != NULL) { in conf_write_defconfig()
897 menu = menu->next; in conf_write_defconfig()
899 while ((menu = menu->parent)) { in conf_write_defconfig()
900 if (menu->next != NULL) { in conf_write_defconfig()
901 menu = menu->next; in conf_write_defconfig()
927 return -1; in conf_write()
932 return -1; in conf_write()
936 return -1; in conf_write()
957 sym = menu->sym; in conf_write()
967 } else if (!(sym->flags & SYMBOL_CHOICE) && in conf_write()
968 !(sym->flags & SYMBOL_WRITTEN)) { in conf_write()
970 if (!(sym->flags & SYMBOL_WRITE)) in conf_write()
976 sym->flags |= SYMBOL_WRITTEN; in conf_write()
981 if (menu->list) { in conf_write()
982 menu = menu->list; in conf_write()
987 if (!menu->sym && menu_is_visible(menu) && menu != &rootmenu && in conf_write()
988 menu->prompt->type == P_MENU) { in conf_write()
993 if (menu->next) { in conf_write()
994 menu = menu->next; in conf_write()
996 menu = menu->parent; in conf_write()
1004 sym->flags &= ~SYMBOL_WRITTEN; in conf_write()
1037 return -1; in conf_write_autoconf_cmd()
1040 return -1; in conf_write_autoconf_cmd()
1044 return -1; in conf_write_autoconf_cmd()
1049 return -1; in conf_write_autoconf_cmd()
1053 for (file = file_list; file; file = file->next) in conf_write_autoconf_cmd()
1054 fprintf(out, "\t%s \\\n", file->name); in conf_write_autoconf_cmd()
1066 return -1; in conf_write_autoconf_cmd()
1070 return -1; in conf_write_autoconf_cmd()
1084 depfile_prefix_len = tmp ? tmp - name + 1 : 0; in conf_touch_deps()
1086 return -1; in conf_touch_deps()
1096 if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name) in conf_touch_deps()
1098 if (sym->flags & SYMBOL_WRITE) { in conf_touch_deps()
1099 if (sym->flags & SYMBOL_DEF_AUTO) { in conf_touch_deps()
1104 switch (sym->type) { in conf_touch_deps()
1108 sym->def[S_DEF_AUTO].tri) in conf_touch_deps()
1115 sym->def[S_DEF_AUTO].val)) in conf_touch_deps()
1126 switch (sym->type) { in conf_touch_deps()
1136 } else if (!(sym->flags & SYMBOL_DEF_AUTO)) in conf_touch_deps()
1141 * isn't saved in auto.conf, so the old value is always in conf_touch_deps()
1145 res = conf_touch_dep(sym->name); in conf_touch_deps()
1163 return -1; in __conf_write_autoconf()
1167 return -1; in __conf_write_autoconf()
1172 return -1; in __conf_write_autoconf()
1178 if ((sym->flags & SYMBOL_WRITE) && sym->name) in __conf_write_autoconf()
1186 return -1; in __conf_write_autoconf()
1190 return -1; in __conf_write_autoconf()
1207 return -1; in conf_write_autoconf()
1228 * Create include/config/auto.conf. This must be the last step because in conf_write_autoconf()
1229 * Kbuild has a dependency on auto.conf and this marks the successful in conf_write_autoconf()
1273 * Set all non-assinged choice values to no in set_all_choice_values()
1275 expr_list_for_each_sym(prop->expr, e, sym) { in set_all_choice_values()
1277 sym->def[S_DEF_USER].tri = no; in set_all_choice_values()
1279 csym->flags |= SYMBOL_DEF_USER; in set_all_choice_values()
1281 csym->flags &= ~(SYMBOL_VALID | SYMBOL_NEED_SET_CHOICE_VALUES); in set_all_choice_values()