Commit 69501115 authored by Randy Dunlap's avatar Randy Dunlap Committed by Sam Ravnborg

kconfig: OVERRIDE: save kernel version in .config file

Omit .config file timestamp in the file if the environment variable
"KCONFIG_NOTIMESTAMP" exists and is non-null.
Signed-off-by: default avatarRandy Dunlap <rddunlap@osdl.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 3c25e9e9
......@@ -270,6 +270,8 @@ int conf_write(const char *name)
int type, l;
const char *str;
time_t now;
int use_timestamp = 1;
char *env;
dirname[0] = 0;
if (name && name[0]) {
......@@ -306,22 +308,28 @@ int conf_write(const char *name)
sym = sym_lookup("KERNELRELEASE", 0);
sym_calc_value(sym);
time(&now);
env = getenv("KCONFIG_NOTIMESTAMP");
if (env && *env)
use_timestamp = 0;
fprintf(out, "#\n"
"# Automatically generated make config: don't edit\n"
"# Linux kernel version: %s\n"
"# %s"
"%s%s"
"#\n",
sym_get_string_value(sym),
ctime(&now));
use_timestamp ? "# " : "",
use_timestamp ? ctime(&now) : "");
if (out_h)
fprintf(out_h, "/*\n"
" * Automatically generated C config: don't edit\n"
" * Linux kernel version: %s\n"
" * %s"
"%s%s"
" */\n"
"#define AUTOCONF_INCLUDED\n",
sym_get_string_value(sym),
ctime(&now));
use_timestamp ? " * " : "",
use_timestamp ? ctime(&now) : "");
if (!sym_change_count)
sym_clear_all_valid();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment