summaryrefslogtreecommitdiff
path: root/util/kconfig/patches/0011-remove-include-config-hardcodes.patch
blob: fa21dac4b4ee784d0ff920d5429afac12e63f9b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Index: kconfig/confdata.c
===================================================================
--- kconfig.orig/confdata.c
+++ kconfig/confdata.c
@@ -241,6 +241,13 @@ static const char *conf_get_autoconfig_n
 	return name ? name : "include/config/auto.conf";
 }
 
+static const char *conf_get_autobase_name(void)
+{
+	char *name = getenv("KCONFIG_SPLITCONFIG");
+
+	return name ? name : "include/config/";
+}
+
 static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
 {
 	char *p2;
@@ -1024,7 +1031,7 @@ static int conf_touch_deps(void)
 	struct symbol *sym;
 	int res, i;
 
-	strcpy(depfile_path, "include/config/");
+	strcpy(depfile_path, conf_get_autobase_name());
 	depfile_prefix_len = strlen(depfile_path);
 
 	name = conf_get_autoconfig_name();
@@ -1102,7 +1109,10 @@ int conf_write_autoconf(int overwrite)
 	if (!overwrite && is_present(autoconf_name))
 		return 0;
 
-	conf_write_dep("include/config/auto.conf.cmd");
+	char autoconfcmd_path[PATH_MAX];
+	snprintf(autoconfcmd_path, sizeof(autoconfcmd_path), "%s%s",
+		conf_get_autobase_name(), "auto.conf.cmd");
+	conf_write_dep(autoconfcmd_path);
 
 	if (conf_touch_deps())
 		return 1;