blob: fb85035a7c1d9bcdbd01ad72f939d501d4566e7c [file] [log] [blame]
Martin Rothb7f92a02022-11-13 15:27:08 -07001From 2a44aa33d6506a29b14d9c429410ad582d1d6636 Mon Sep 17 00:00:00 2001
2From: Martin Roth <gaumless@gmail.com>
3Date: Sun, 13 Nov 2022 15:20:57 -0700
4Subject: [PATCH] util/kconfig: Move Kconfig deps back into build/config
5
6revert commit 1b9e740a8 (kconfig: fix failing to generate auto.conf) [1]
7
8The above change caused all of the enabled kconfig options to be written
9into the top level build directory. We don't want that, so go back to
10the old behavior for the coreboot tree.
11
12[1] https://web.archive.org/web/20220316120807/https://github.com/torvalds/linux/commit/1b9e740a81f91ae338b29ed70455719804957b80
13
14Signed-off-by: Martin Roth <gaumless@gmail.com>
15Change-Id: I2904f69a5d85337ad0a6b48590ccd4b4a6e38b70
16---
17 util/kconfig/confdata.c | 20 +++++++++++---------
18 1 file changed, 11 insertions(+), 9 deletions(-)
19
20diff --git a/util/kconfig/confdata.c b/util/kconfig/confdata.c
21index 95fb960179..3da9e8b38d 100644
22--- a/util/kconfig/confdata.c
23+++ b/util/kconfig/confdata.c
24@@ -230,6 +230,13 @@ static const char *conf_get_autoheader_name(void)
25 return name ? name : "include/generated/autoconf.h";
26 }
27
28+static const char *conf_get_autobase_name(void)
29+{
30+ char *name = getenv("KCONFIG_SPLITCONFIG");
31+
32+ return name ? name : "include/config/";
33+}
34+
35 static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
36 {
37 char *p2;
38@@ -1024,19 +1031,14 @@ static int conf_write_autoconf_cmd(const char *autoconf_name)
39
40 static int conf_touch_deps(void)
41 {
42- const char *name, *tmp;
43+ const char *name;
44 struct symbol *sym;
45 int res, i;
46
47- name = conf_get_autoconfig_name();
48- tmp = strrchr(name, '/');
49- depfile_prefix_len = tmp ? tmp - name + 1 : 0;
50- if (depfile_prefix_len + 1 > sizeof(depfile_path))
51- return -1;
52-
53- strncpy(depfile_path, name, depfile_prefix_len);
54- depfile_path[depfile_prefix_len] = 0;
55+ strcpy(depfile_path, conf_get_autobase_name());
56+ depfile_prefix_len = strlen(depfile_path);
57
58+ name = conf_get_autoconfig_name();
59 conf_read_simple(name, S_DEF_AUTO);
60 sym_calc_value(modules_sym);
61
62--
632.30.2
64