mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-19 04:47:52 +00:00
kconfig: Sync with upstream v5.3
This commit introduces the following upstream changes: 0c5b6c28ed68 kconfig: Clear "written" flag to avoid data loss 8e2442a5f86e kconfig: fix missing choice values in auto.conf 3266c806dc86 kconfig: run olddefconfig instead of oldconfig after merging fragments e3cd5136a4ec kconfig: remove meaningless if-conditional in conf_read() baa23ec86092 kconfig: Fix spelling of sym_is_changable cd238effefa2 docs: kbuild: convert docs to ReST and rename to *.rst bd305f259cd3 kconfig: make arch/*/configs/defconfig the default of KBUILD_DEFCONFIG 5533397d1ec8 kconfig: add static qualifier to expand_string() b6f7e9f7050b kconfig: require the argument of --defconfig e0a2668665a5 kconfig: remove always false ifeq ($(KBUILD_DEFCONFIG,) conditional Signed-off-by: Chris Packham <judge.packham@gmail.com>
This commit is contained in:
parent
141f88a5f6
commit
31695dd2b0
@ -90,7 +90,7 @@ static int conf_askvalue(struct symbol *sym, const char *def)
|
|||||||
line[0] = '\n';
|
line[0] = '\n';
|
||||||
line[1] = 0;
|
line[1] = 0;
|
||||||
|
|
||||||
if (!sym_is_changable(sym)) {
|
if (!sym_is_changeable(sym)) {
|
||||||
printf("%s\n", def);
|
printf("%s\n", def);
|
||||||
line[0] = '\n';
|
line[0] = '\n';
|
||||||
line[1] = 0;
|
line[1] = 0;
|
||||||
@ -234,7 +234,7 @@ static int conf_choice(struct menu *menu)
|
|||||||
|
|
||||||
sym = menu->sym;
|
sym = menu->sym;
|
||||||
is_new = !sym_has_value(sym);
|
is_new = !sym_has_value(sym);
|
||||||
if (sym_is_changable(sym)) {
|
if (sym_is_changeable(sym)) {
|
||||||
conf_sym(menu);
|
conf_sym(menu);
|
||||||
sym_calc_value(sym);
|
sym_calc_value(sym);
|
||||||
switch (sym_get_tristate_value(sym)) {
|
switch (sym_get_tristate_value(sym)) {
|
||||||
@ -418,7 +418,7 @@ static void check_conf(struct menu *menu)
|
|||||||
|
|
||||||
sym = menu->sym;
|
sym = menu->sym;
|
||||||
if (sym && !sym_has_value(sym)) {
|
if (sym && !sym_has_value(sym)) {
|
||||||
if (sym_is_changable(sym) ||
|
if (sym_is_changeable(sym) ||
|
||||||
(sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
|
(sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
|
||||||
if (input_mode == listnewconfig) {
|
if (input_mode == listnewconfig) {
|
||||||
if (sym->name) {
|
if (sym->name) {
|
||||||
@ -451,7 +451,7 @@ static struct option long_opts[] = {
|
|||||||
{"oldaskconfig", no_argument, NULL, oldaskconfig},
|
{"oldaskconfig", no_argument, NULL, oldaskconfig},
|
||||||
{"oldconfig", no_argument, NULL, oldconfig},
|
{"oldconfig", no_argument, NULL, oldconfig},
|
||||||
{"syncconfig", no_argument, NULL, syncconfig},
|
{"syncconfig", no_argument, NULL, syncconfig},
|
||||||
{"defconfig", optional_argument, NULL, defconfig},
|
{"defconfig", required_argument, NULL, defconfig},
|
||||||
{"savedefconfig", required_argument, NULL, savedefconfig},
|
{"savedefconfig", required_argument, NULL, savedefconfig},
|
||||||
{"allnoconfig", no_argument, NULL, allnoconfig},
|
{"allnoconfig", no_argument, NULL, allnoconfig},
|
||||||
{"allyesconfig", no_argument, NULL, allyesconfig},
|
{"allyesconfig", no_argument, NULL, allyesconfig},
|
||||||
@ -542,8 +542,6 @@ int main(int ac, char **av)
|
|||||||
|
|
||||||
switch (input_mode) {
|
switch (input_mode) {
|
||||||
case defconfig:
|
case defconfig:
|
||||||
if (!defconfig_file)
|
|
||||||
defconfig_file = conf_get_default_confname();
|
|
||||||
if (conf_read(defconfig_file)) {
|
if (conf_read(defconfig_file)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"***\n"
|
"***\n"
|
||||||
|
@ -177,8 +177,6 @@ static void conf_message(const char *fmt, ...)
|
|||||||
static const char *conf_filename;
|
static const char *conf_filename;
|
||||||
static int conf_lineno, conf_warnings;
|
static int conf_lineno, conf_warnings;
|
||||||
|
|
||||||
const char conf_defname[] = "arch/$(ARCH)/defconfig";
|
|
||||||
|
|
||||||
static void conf_warning(const char *fmt, ...)
|
static void conf_warning(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
@ -233,21 +231,6 @@ static const char *conf_get_autoconfig_name(void)
|
|||||||
return name ? name : "include/config/auto.conf";
|
return name ? name : "include/config/auto.conf";
|
||||||
}
|
}
|
||||||
|
|
||||||
char *conf_get_default_confname(void)
|
|
||||||
{
|
|
||||||
static char fullname[PATH_MAX+1];
|
|
||||||
char *env, *name;
|
|
||||||
|
|
||||||
name = expand_string(conf_defname);
|
|
||||||
env = getenv(SRCTREE);
|
|
||||||
if (env) {
|
|
||||||
snprintf(fullname, sizeof(fullname), "%s/%s", env, name);
|
|
||||||
if (is_present(fullname))
|
|
||||||
return fullname;
|
|
||||||
}
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
|
static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
|
||||||
{
|
{
|
||||||
char *p2;
|
char *p2;
|
||||||
@ -551,11 +534,9 @@ int conf_read(const char *name)
|
|||||||
switch (sym->type) {
|
switch (sym->type) {
|
||||||
case S_BOOLEAN:
|
case S_BOOLEAN:
|
||||||
case S_TRISTATE:
|
case S_TRISTATE:
|
||||||
if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym))
|
if (sym->def[S_DEF_USER].tri == sym_get_tristate_value(sym))
|
||||||
break;
|
|
||||||
if (!sym_is_choice(sym))
|
|
||||||
continue;
|
continue;
|
||||||
/* fall through */
|
break;
|
||||||
default:
|
default:
|
||||||
if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val))
|
if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val))
|
||||||
continue;
|
continue;
|
||||||
@ -813,7 +794,7 @@ int conf_write_defconfig(const char *filename)
|
|||||||
goto next_menu;
|
goto next_menu;
|
||||||
sym->flags &= ~SYMBOL_WRITE;
|
sym->flags &= ~SYMBOL_WRITE;
|
||||||
/* If we cannot change the symbol - skip */
|
/* If we cannot change the symbol - skip */
|
||||||
if (!sym_is_changable(sym))
|
if (!sym_is_changeable(sym))
|
||||||
goto next_menu;
|
goto next_menu;
|
||||||
/* If symbol equals to default value - skip */
|
/* If symbol equals to default value - skip */
|
||||||
if (strcmp(sym_get_string_value(sym), sym_get_string_default(sym)) == 0)
|
if (strcmp(sym_get_string_value(sym), sym_get_string_default(sym)) == 0)
|
||||||
@ -867,6 +848,7 @@ int conf_write(const char *name)
|
|||||||
const char *str;
|
const char *str;
|
||||||
char tmpname[PATH_MAX + 1], oldname[PATH_MAX + 1];
|
char tmpname[PATH_MAX + 1], oldname[PATH_MAX + 1];
|
||||||
char *env;
|
char *env;
|
||||||
|
int i;
|
||||||
bool need_newline = false;
|
bool need_newline = false;
|
||||||
|
|
||||||
if (!name)
|
if (!name)
|
||||||
@ -914,7 +896,8 @@ int conf_write(const char *name)
|
|||||||
"# %s\n"
|
"# %s\n"
|
||||||
"#\n", str);
|
"#\n", str);
|
||||||
need_newline = false;
|
need_newline = false;
|
||||||
} else if (!(sym->flags & SYMBOL_CHOICE)) {
|
} else if (!(sym->flags & SYMBOL_CHOICE) &&
|
||||||
|
!(sym->flags & SYMBOL_WRITTEN)) {
|
||||||
sym_calc_value(sym);
|
sym_calc_value(sym);
|
||||||
if (!(sym->flags & SYMBOL_WRITE))
|
if (!(sym->flags & SYMBOL_WRITE))
|
||||||
goto next;
|
goto next;
|
||||||
@ -922,7 +905,7 @@ int conf_write(const char *name)
|
|||||||
fprintf(out, "\n");
|
fprintf(out, "\n");
|
||||||
need_newline = false;
|
need_newline = false;
|
||||||
}
|
}
|
||||||
sym->flags &= ~SYMBOL_WRITE;
|
sym->flags |= SYMBOL_WRITTEN;
|
||||||
conf_write_symbol(out, sym, &kconfig_printer_cb, NULL);
|
conf_write_symbol(out, sym, &kconfig_printer_cb, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -948,6 +931,9 @@ next:
|
|||||||
}
|
}
|
||||||
fclose(out);
|
fclose(out);
|
||||||
|
|
||||||
|
for_all_symbols(i, sym)
|
||||||
|
sym->flags &= ~SYMBOL_WRITTEN;
|
||||||
|
|
||||||
if (*tmpname) {
|
if (*tmpname) {
|
||||||
if (is_same(name, tmpname)) {
|
if (is_same(name, tmpname)) {
|
||||||
conf_message("No change to %s", name);
|
conf_message("No change to %s", name);
|
||||||
@ -1082,8 +1068,6 @@ int conf_write_autoconf(int overwrite)
|
|||||||
if (!overwrite && is_present(autoconf_name))
|
if (!overwrite && is_present(autoconf_name))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
sym_clear_all_valid();
|
|
||||||
|
|
||||||
conf_write_dep("include/config/auto.conf.cmd");
|
conf_write_dep("include/config/auto.conf.cmd");
|
||||||
|
|
||||||
if (conf_touch_deps())
|
if (conf_touch_deps())
|
||||||
|
@ -141,6 +141,7 @@ struct symbol {
|
|||||||
#define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */
|
#define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */
|
||||||
#define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */
|
#define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */
|
||||||
#define SYMBOL_CHANGED 0x0400 /* ? */
|
#define SYMBOL_CHANGED 0x0400 /* ? */
|
||||||
|
#define SYMBOL_WRITTEN 0x0800 /* track info to avoid double-write to .config */
|
||||||
#define SYMBOL_NO_WRITE 0x1000 /* Symbol for internal use only; it will not be written */
|
#define SYMBOL_NO_WRITE 0x1000 /* Symbol for internal use only; it will not be written */
|
||||||
#define SYMBOL_CHECKED 0x2000 /* used during dependency checking */
|
#define SYMBOL_CHECKED 0x2000 /* used during dependency checking */
|
||||||
#define SYMBOL_WARNED 0x8000 /* warning has been issued */
|
#define SYMBOL_WARNED 0x8000 /* warning has been issued */
|
||||||
|
@ -49,7 +49,6 @@ const char *zconf_curname(void);
|
|||||||
|
|
||||||
/* confdata.c */
|
/* confdata.c */
|
||||||
const char *conf_get_configname(void);
|
const char *conf_get_configname(void);
|
||||||
char *conf_get_default_confname(void);
|
|
||||||
void sym_set_change_count(int count);
|
void sym_set_change_count(int count);
|
||||||
void sym_add_change_count(int count);
|
void sym_add_change_count(int count);
|
||||||
bool conf_set_all_new_symbols(enum conf_def_mode mode);
|
bool conf_set_all_new_symbols(enum conf_def_mode mode);
|
||||||
|
@ -42,7 +42,7 @@ tristate sym_toggle_tristate_value(struct symbol *sym);
|
|||||||
bool sym_string_valid(struct symbol *sym, const char *newval);
|
bool sym_string_valid(struct symbol *sym, const char *newval);
|
||||||
bool sym_string_within_range(struct symbol *sym, const char *str);
|
bool sym_string_within_range(struct symbol *sym, const char *str);
|
||||||
bool sym_set_string_value(struct symbol *sym, const char *newval);
|
bool sym_set_string_value(struct symbol *sym, const char *newval);
|
||||||
bool sym_is_changable(struct symbol *sym);
|
bool sym_is_changeable(struct symbol *sym);
|
||||||
struct property * sym_get_choice_prop(struct symbol *sym);
|
struct property * sym_get_choice_prop(struct symbol *sym);
|
||||||
const char * sym_get_string_value(struct symbol *sym);
|
const char * sym_get_string_value(struct symbol *sym);
|
||||||
|
|
||||||
@ -58,7 +58,6 @@ void env_write_dep(FILE *f, const char *auto_conf_name);
|
|||||||
void variable_add(const char *name, const char *value,
|
void variable_add(const char *name, const char *value,
|
||||||
enum variable_flavor flavor);
|
enum variable_flavor flavor);
|
||||||
void variable_all_del(void);
|
void variable_all_del(void);
|
||||||
char *expand_string(const char *in);
|
|
||||||
char *expand_dollar(const char **str);
|
char *expand_dollar(const char **str);
|
||||||
char *expand_one_token(const char **str);
|
char *expand_one_token(const char **str);
|
||||||
|
|
||||||
|
@ -536,7 +536,7 @@ static void build_conf(struct menu *menu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
val = sym_get_tristate_value(sym);
|
val = sym_get_tristate_value(sym);
|
||||||
if (sym_is_changable(sym)) {
|
if (sym_is_changeable(sym)) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case S_BOOLEAN:
|
case S_BOOLEAN:
|
||||||
item_make("[%c]", val == no ? ' ' : '*');
|
item_make("[%c]", val == no ? ' ' : '*');
|
||||||
@ -587,7 +587,7 @@ static void build_conf(struct menu *menu)
|
|||||||
} else {
|
} else {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case S_BOOLEAN:
|
case S_BOOLEAN:
|
||||||
if (sym_is_changable(sym))
|
if (sym_is_changeable(sym))
|
||||||
item_make("[%c]", val == no ? ' ' : '*');
|
item_make("[%c]", val == no ? ' ' : '*');
|
||||||
else
|
else
|
||||||
item_make("-%c-", val == no ? ' ' : '*');
|
item_make("-%c-", val == no ? ' ' : '*');
|
||||||
@ -600,7 +600,7 @@ static void build_conf(struct menu *menu)
|
|||||||
case mod: ch = 'M'; break;
|
case mod: ch = 'M'; break;
|
||||||
default: ch = ' '; break;
|
default: ch = ' '; break;
|
||||||
}
|
}
|
||||||
if (sym_is_changable(sym)) {
|
if (sym_is_changeable(sym)) {
|
||||||
if (sym->rev_dep.tri == mod)
|
if (sym->rev_dep.tri == mod)
|
||||||
item_make("{%c}", ch);
|
item_make("{%c}", ch);
|
||||||
else
|
else
|
||||||
@ -617,7 +617,7 @@ static void build_conf(struct menu *menu)
|
|||||||
if (tmp < 0)
|
if (tmp < 0)
|
||||||
tmp = 0;
|
tmp = 0;
|
||||||
item_add_str("%*c%s%s", tmp, ' ', menu_get_prompt(menu),
|
item_add_str("%*c%s%s", tmp, ' ', menu_get_prompt(menu),
|
||||||
(sym_has_value(sym) || !sym_is_changable(sym)) ?
|
(sym_has_value(sym) || !sym_is_changeable(sym)) ?
|
||||||
"" : " (NEW)");
|
"" : " (NEW)");
|
||||||
item_set_tag('s');
|
item_set_tag('s');
|
||||||
item_set_data(menu);
|
item_set_data(menu);
|
||||||
@ -625,7 +625,7 @@ static void build_conf(struct menu *menu)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
item_add_str("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu),
|
item_add_str("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu),
|
||||||
(sym_has_value(sym) || !sym_is_changable(sym)) ?
|
(sym_has_value(sym) || !sym_is_changeable(sym)) ?
|
||||||
"" : " (NEW)");
|
"" : " (NEW)");
|
||||||
if (menu->prompt->type == P_MENU) {
|
if (menu->prompt->type == P_MENU) {
|
||||||
item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->");
|
item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->");
|
||||||
|
@ -806,7 +806,7 @@ static void build_conf(struct menu *menu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
val = sym_get_tristate_value(sym);
|
val = sym_get_tristate_value(sym);
|
||||||
if (sym_is_changable(sym)) {
|
if (sym_is_changeable(sym)) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case S_BOOLEAN:
|
case S_BOOLEAN:
|
||||||
item_make(menu, 't', "[%c]",
|
item_make(menu, 't', "[%c]",
|
||||||
@ -860,7 +860,7 @@ static void build_conf(struct menu *menu)
|
|||||||
} else {
|
} else {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case S_BOOLEAN:
|
case S_BOOLEAN:
|
||||||
if (sym_is_changable(sym))
|
if (sym_is_changeable(sym))
|
||||||
item_make(menu, 't', "[%c]",
|
item_make(menu, 't', "[%c]",
|
||||||
val == no ? ' ' : '*');
|
val == no ? ' ' : '*');
|
||||||
else
|
else
|
||||||
@ -879,7 +879,7 @@ static void build_conf(struct menu *menu)
|
|||||||
ch = ' ';
|
ch = ' ';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (sym_is_changable(sym)) {
|
if (sym_is_changeable(sym)) {
|
||||||
if (sym->rev_dep.tri == mod)
|
if (sym->rev_dep.tri == mod)
|
||||||
item_make(menu,
|
item_make(menu,
|
||||||
't', "{%c}", ch);
|
't', "{%c}", ch);
|
||||||
@ -899,14 +899,14 @@ static void build_conf(struct menu *menu)
|
|||||||
item_add_str("%*c%s%s", tmp, ' ',
|
item_add_str("%*c%s%s", tmp, ' ',
|
||||||
menu_get_prompt(menu),
|
menu_get_prompt(menu),
|
||||||
(sym_has_value(sym) ||
|
(sym_has_value(sym) ||
|
||||||
!sym_is_changable(sym)) ? "" :
|
!sym_is_changeable(sym)) ? "" :
|
||||||
" (NEW)");
|
" (NEW)");
|
||||||
goto conf_childs;
|
goto conf_childs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item_add_str("%*c%s%s", indent + 1, ' ',
|
item_add_str("%*c%s%s", indent + 1, ' ',
|
||||||
menu_get_prompt(menu),
|
menu_get_prompt(menu),
|
||||||
(sym_has_value(sym) || !sym_is_changable(sym)) ?
|
(sym_has_value(sym) || !sym_is_changeable(sym)) ?
|
||||||
"" : " (NEW)");
|
"" : " (NEW)");
|
||||||
if (menu->prompt && menu->prompt->type == P_MENU) {
|
if (menu->prompt && menu->prompt->type == P_MENU) {
|
||||||
item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->");
|
item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->");
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||||
|
|
||||||
static char *expand_string_with_args(const char *in, int argc, char *argv[]);
|
static char *expand_string_with_args(const char *in, int argc, char *argv[]);
|
||||||
|
static char *expand_string(const char *in);
|
||||||
|
|
||||||
static void __attribute__((noreturn)) pperror(const char *format, ...)
|
static void __attribute__((noreturn)) pperror(const char *format, ...)
|
||||||
{
|
{
|
||||||
@ -550,7 +551,7 @@ static char *expand_string_with_args(const char *in, int argc, char *argv[])
|
|||||||
return __expand_string(&in, is_end_of_str, argc, argv);
|
return __expand_string(&in, is_end_of_str, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *expand_string(const char *in)
|
static char *expand_string(const char *in)
|
||||||
{
|
{
|
||||||
return expand_string_with_args(in, 0, NULL);
|
return expand_string_with_args(in, 0, NULL);
|
||||||
}
|
}
|
||||||
|
@ -785,7 +785,7 @@ const char *sym_get_string_value(struct symbol *sym)
|
|||||||
return (const char *)sym->curr.val;
|
return (const char *)sym->curr.val;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sym_is_changable(struct symbol *sym)
|
bool sym_is_changeable(struct symbol *sym)
|
||||||
{
|
{
|
||||||
return sym->visible > sym->rev_dep.tri;
|
return sym->visible > sym->rev_dep.tri;
|
||||||
}
|
}
|
||||||
@ -1114,7 +1114,7 @@ static void sym_check_print_recursive(struct symbol *last_sym)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"For a resolution refer to Documentation/kbuild/kconfig-language.txt\n"
|
"For a resolution refer to Documentation/kbuild/kconfig-language.rst\n"
|
||||||
"subsection \"Kconfig recursive dependency limitations\"\n"
|
"subsection \"Kconfig recursive dependency limitations\"\n"
|
||||||
"\n");
|
"\n");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user