Skip to content

Commit

Permalink
kconfig: get CONFIG_ prefix from the environment
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yann E. MORIN authored and Michal Marek committed Nov 20, 2012
1 parent b341f78 commit 9a926d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/kconfig/gconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# include <config.h>
#endif

#include <stdlib.h>
#include "lkc.h"
#include "images.c"

Expand All @@ -22,7 +23,6 @@
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <stdlib.h>

//#define DEBUG

Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/lkc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions scripts/kconfig/nconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>

#include "lkc.h"
#include "nconf.h"
Expand Down

0 comments on commit 9a926d4

Please sign in to comment.