All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: linux-kbuild@vger.kernel.org
Cc: Michal Marek <mmarek@suse.cz>, "Yann E. MORIN" <yann.morin.1998@free.fr>
Subject: [PATCH 2/3] kconfig: add a function to get the CONFIG_ prefix
Date: Wed, 10 Oct 2012 00:46:32 +0200	[thread overview]
Message-ID: <1349822793-1227-3-git-send-email-yann.morin.1998@free.fr> (raw)
In-Reply-To: <1349822793-1227-1-git-send-email-yann.morin.1998@free.fr>

Currently, we get the CONFIG_ prefix via the CONFIG_ macro, which means
the CONFIG_ prefix is hard-coded at compile time. This goes against
having a run-time defined CONFIG_ prefix.

Add a function that returns the CONFIG_ prefix to use (but keep the
current hard-coded behavior, to be changed in a later patch).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 scripts/kconfig/lkc.h |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index c18f2bd..25862fd 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -36,9 +36,17 @@ extern "C" {
 #define _(text) gettext(text)
 #define N_(text) (text)
 
-#ifndef CONFIG_
-#define CONFIG_ "CONFIG_"
+/* Those two defines copied from include/linux/stringify.h */
+#define __stringify_1(x...)	#x
+#define __stringify(x...)	__stringify_1(x)
+static inline const char *CONFIG_prefix(void)
+{
+	return __stringify(CONFIG_);
+}
+#ifdef CONFIG_
+#undef CONFIG_
 #endif
+#define CONFIG_ CONFIG_prefix()
 
 #define TF_COMMAND	0x0001
 #define TF_PARAM	0x0002
-- 
1.7.2.5


  parent reply	other threads:[~2012-10-09 22:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09 22:46 [PATH 0/3] kcofnig: get the CONFIG_ prefix from the environment Yann E. MORIN
2012-10-09 22:46 ` [PATCH 1/3] kconfig: remove CONFIG_ from string constants Yann E. MORIN
2012-10-09 22:46 ` Yann E. MORIN [this message]
2012-10-09 22:46 ` [PATCH 3/3] kconfig: get CONFIG_ prefix from the environment Yann E. MORIN
2012-10-12 17:23 ` [PATH 0/3] kcofnig: get the " Yann E. MORIN
2012-10-18 19:50 [PATCH 0/3 v2] kconfig: " Yann E. MORIN
2012-10-18 19:50 ` [PATCH 2/3] kconfig: add a function to get the CONFIG_ prefix Yann E. MORIN
2012-10-19 17:01   ` Michal Marek
2012-10-19 17:59     ` Yann E. MORIN
2012-10-19 23:06 [PATCH 0/3 v3] kconfig: get the CONFIG_ prefix from the environment Yann E. MORIN
2012-10-19 23:06 ` [PATCH 2/3] kconfig: add a function to get the CONFIG_ prefix Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1349822793-1227-3-git-send-email-yann.morin.1998@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.