diff options
author | Yann E. MORIN <yann.morin.1998@free.fr> | 2012-10-19 19:06:25 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2012-11-20 05:20:08 -0500 |
commit | 9a926d4354d84e424e738a6d401328340400331b (patch) | |
tree | 7b59baf2c6b59eb7dc8157b5ab28f3628aa53de9 /scripts/kconfig | |
parent | b341f7882f04cc70b7437583f012a8d93fbfb00e (diff) |
kconfig: get CONFIG_ prefix from the environment
Currently, the CONFIG_ prefix is hard-coded in the kconfig frontends
executables. This means that two projects that use kconfig with
different prefixes can not share the same kconfig frontends.
Instead of hard-coding the prefix in the frontends, get it from the
environment, and revert back to hard-coded value if not found.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r-- | scripts/kconfig/gconf.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/lkc.h | 2 | ||||
-rw-r--r-- | scripts/kconfig/nconf.c | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index adc230638c5b..f2bee70e26f4 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c | |||
@@ -10,6 +10,7 @@ | |||
10 | # include <config.h> | 10 | # include <config.h> |
11 | #endif | 11 | #endif |
12 | 12 | ||
13 | #include <stdlib.h> | ||
13 | #include "lkc.h" | 14 | #include "lkc.h" |
14 | #include "images.c" | 15 | #include "images.c" |
15 | 16 | ||
@@ -22,7 +23,6 @@ | |||
22 | #include <string.h> | 23 | #include <string.h> |
23 | #include <unistd.h> | 24 | #include <unistd.h> |
24 | #include <time.h> | 25 | #include <time.h> |
25 | #include <stdlib.h> | ||
26 | 26 | ||
27 | //#define DEBUG | 27 | //#define DEBUG |
28 | 28 | ||
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 7aa9db0b2a77..7577a7fbb405 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h | |||
@@ -41,7 +41,7 @@ extern "C" { | |||
41 | #endif | 41 | #endif |
42 | static inline const char *CONFIG_prefix(void) | 42 | static inline const char *CONFIG_prefix(void) |
43 | { | 43 | { |
44 | return CONFIG_; | 44 | return getenv( "CONFIG_" ) ?: CONFIG_; |
45 | } | 45 | } |
46 | #undef CONFIG_ | 46 | #undef CONFIG_ |
47 | #define CONFIG_ CONFIG_prefix() | 47 | #define CONFIG_ CONFIG_prefix() |
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 261f926d8f4b..ce93e879a29c 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c | |||
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | #define _GNU_SOURCE | 8 | #define _GNU_SOURCE |
9 | #include <string.h> | 9 | #include <string.h> |
10 | #include <stdlib.h> | ||
10 | 11 | ||
11 | #include "lkc.h" | 12 | #include "lkc.h" |
12 | #include "nconf.h" | 13 | #include "nconf.h" |