summaryrefslogtreecommitdiffstats
path: root/package/config/util.c
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2010-06-20 13:43:36 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2010-06-21 22:11:31 +0200
commitb8cca06b5089821ee8fb7087d1f88e5e2c74edf8 (patch)
tree697f7b4c2df2cbf2c5d96c4ba2698970ac9206ad /package/config/util.c
parent39ca6d50d8d52a9c8cb252cffb23a9d6f0c2942d (diff)
downloadbuildroot-novena-b8cca06b5089821ee8fb7087d1f88e5e2c74edf8.tar.gz
buildroot-novena-b8cca06b5089821ee8fb7087d1f88e5e2c74edf8.zip
cleanup/simplify kconfig changes for O= builds
No functional change. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/config/util.c')
-rw-r--r--package/config/util.c47
1 files changed, 26 insertions, 21 deletions
diff --git a/package/config/util.c b/package/config/util.c
index a1e9dea21..c3821407d 100644
--- a/package/config/util.c
+++ b/package/config/util.c
@@ -51,25 +51,27 @@ static char* br2_symbol_printer(const char * const in)
}
/* write dependencies of the infividual config-symbols */
-int write_make_deps(const char *name)
+static int write_make_deps(const char *name)
{
- const char *str;
- char buf[PATH_MAX+1];
+ char *str;
+ char dir[PATH_MAX+1], buf[PATH_MAX+1], buf2[PATH_MAX+1];
struct menu *menu;
struct symbol *sym;
struct property *prop, *p;
unsigned done;
+ const char * const name_tmp = "..make.deps.tmp";
FILE *out;
if (!name)
name = ".auto.deps";
- str = strrchr(name, '/');
- memset(buf, 0, PATH_MAX+1);
- if(str)
- {
- strncpy(buf, name, str - name + 1);
- }
- strcat(buf, "..make.deps.tmp");
+ strcpy(dir, conf_get_configname());
+ str = strrchr(dir, '/');
+ if (str)
+ str[1] = 0;
+ else
+ dir[0] = 0;
+
+ sprintf(buf, "%s%s", dir, name_tmp);
out = fopen(buf, "w");
if (!out)
return 1;
@@ -129,7 +131,8 @@ next:
}
}
fclose(out);
- rename(buf, name);
+ sprintf(buf2, "%s%s", dir, name);
+ rename(buf, buf2);
printf(_("#\n"
"# make dependencies written to %s\n"
"# ATTENTION buildroot devels!\n"
@@ -141,8 +144,8 @@ next:
/* write a dependency file as used by kbuild to track dependencies */
int file_write_dep(const char *name)
{
- const char *str;
- char buf[PATH_MAX+1];
+ char *str;
+ char buf[PATH_MAX+1], buf2[PATH_MAX+1], dir[PATH_MAX+1];
struct symbol *sym, *env_sym;
struct expr *e;
struct file *file;
@@ -151,14 +154,14 @@ int file_write_dep(const char *name)
if (!name)
name = ".kconfig.d";
- str = strrchr(name, '/');
- memset(buf, 0, PATH_MAX+1);
- if(str)
- {
- strncpy(buf, name, str - name + 1);
- }
- strcat(buf, "..config.tmp");
+ strcpy(dir, conf_get_configname());
+ str = strrchr(dir, '/');
+ if (str)
+ str[1] = 0;
+ else
+ dir[0] = 0;
+ sprintf(buf, "%s..config.tmp", dir);
out = fopen(buf, "w");
if (!out)
return 1;
@@ -190,7 +193,9 @@ int file_write_dep(const char *name)
fprintf(out, "\n$(deps_config): ;\n");
fclose(out);
- rename(buf, name);
+ sprintf(buf2, "%s%s", dir, name);
+ rename(buf, buf2);
+ return write_make_deps(NULL);
}