kconfig: get CONFIG_ prefix from the environment
authorYann E. MORIN <yann.morin.1998@free.fr>
Fri, 19 Oct 2012 23:06:25 +0000 (01:06 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Fri, 22 Mar 2013 23:23:07 +0000 (00:23 +0100)
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>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
config/lkc.h

index 7aa9db0b2a7776513bfb7ad7f9a79d567509861a..7577a7fbb405f7c2d4c585b4f88ab687e90c863a 100644 (file)
@@ -41,7 +41,7 @@ extern "C" {
 #endif
 static inline const char *CONFIG_prefix(void)
 {
-       return CONFIG_;
+       return getenv( "CONFIG_" ) ?: CONFIG_;
 }
 #undef CONFIG_
 #define CONFIG_ CONFIG_prefix()