summaryrefslogtreecommitdiffstats
path: root/package/config/util.c
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2009-07-27 17:24:01 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2009-07-27 17:24:01 +0200
commit76dade1788965d0d31e57d080854dddb5e74783f (patch)
treee40baee34f71aa399937b864b77165e9fc628db2 /package/config/util.c
parent6fecd53e99591775a4117e9e1ba18043fda36b27 (diff)
parent6cd6353ff9c0ce93a63e43c4cb61188c6bc0b0f5 (diff)
downloadbuildroot-novena-76dade1788965d0d31e57d080854dddb5e74783f.tar.gz
buildroot-novena-76dade1788965d0d31e57d080854dddb5e74783f.zip
Merge branch 'kconfig-update' of git://git.busybox.net/~tpetazzoni/git/buildroot
Diffstat (limited to 'package/config/util.c')
-rw-r--r--package/config/util.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/package/config/util.c b/package/config/util.c
index a68f7529e..42038385b 100644
--- a/package/config/util.c
+++ b/package/config/util.c
@@ -132,6 +132,8 @@ next:
/* write a dependency file as used by kbuild to track dependencies */
int file_write_dep(const char *name)
{
+ struct symbol *sym, *env_sym;
+ struct expr *e;
struct file *file;
FILE *out;
@@ -147,12 +149,28 @@ int file_write_dep(const char *name)
else
fprintf(out, "\t%s\n", file->name);
}
- fprintf(out, "\n$(BR2_DEPENDS_DIR)/config/auto.conf: \\\n"
- "\t$(deps_config)\n\n"
- "$(deps_config): ;\n");
+ fprintf(out, "\n%s: \\\n"
+ "\t$(deps_config)\n\n", conf_get_autoconfig_name());
+
+ expr_list_for_each_sym(sym_env_list, e, sym) {
+ struct property *prop;
+ const char *value;
+
+ prop = sym_get_env_prop(sym);
+ env_sym = prop_get_symbol(prop);
+ if (!env_sym)
+ continue;
+ value = getenv(env_sym->name);
+ if (!value)
+ value = "";
+ fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value);
+ fprintf(out, "%s: FORCE\n", conf_get_autoconfig_name());
+ fprintf(out, "endif\n");
+ }
+
+ fprintf(out, "\n$(deps_config): ;\n");
fclose(out);
rename("..config.tmp", name);
-
return write_make_deps(NULL);
}
@@ -162,7 +180,7 @@ struct gstr str_new(void)
{
struct gstr gs;
gs.s = malloc(sizeof(char) * 64);
- gs.len = 16;
+ gs.len = 64;
strcpy(gs.s, "\0");
return gs;
}