Skip to content

Commit

Permalink
kconfig: fix failing to generate auto.conf
Browse files Browse the repository at this point in the history
When the KCONFIG_AUTOCONFIG is specified (e.g. export \
KCONFIG_AUTOCONFIG=output/config/auto.conf), the directory of
include/config/ will not be created, so kconfig can't create deps
files in it and auto.conf can't be generated.

Signed-off-by: Jing Leng <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
Jing Leng authored and masahir0y committed Feb 12, 2022
1 parent d23a0c3 commit 1b9e740
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,14 +994,19 @@ static int conf_write_autoconf_cmd(const char *autoconf_name)

static int conf_touch_deps(void)
{
const char *name;
const char *name, *tmp;
struct symbol *sym;
int res, i;

strcpy(depfile_path, "include/config/");
depfile_prefix_len = strlen(depfile_path);

name = conf_get_autoconfig_name();
tmp = strrchr(name, '/');
depfile_prefix_len = tmp ? tmp - name + 1 : 0;
if (depfile_prefix_len + 1 > sizeof(depfile_path))
return -1;

strncpy(depfile_path, name, depfile_prefix_len);
depfile_path[depfile_prefix_len] = 0;

conf_read_simple(name, S_DEF_AUTO);
sym_calc_value(modules_sym);

Expand Down

0 comments on commit 1b9e740

Please sign in to comment.