summaryrefslogtreecommitdiff
path: root/package/config/util.c
diff options
context:
space:
mode:
authorAlper Yildirim <ayildirim@aselsan.com>2009-07-20 18:50:58 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2009-07-27 16:06:50 +0200
commit4b3e11b3e7d00881878f45cddbfe8f4bf07d1ebe (patch)
tree3740632b5196497242055f7ecdfe4be3c6210409 /package/config/util.c
parentea536503331aea875e84ae598b4610fbd059f167 (diff)
config: Update package/config to Kconfig 2.6.30
Update the package/config stuff with the code available in the Linux kernel 2.6.30. Signed-off-by: Alper Yildirim <ayildirim@aselsan.com>
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;
}