From: Sam Ravnborg <sam@ravnborg.org>
To: Randy Dunlap <randy.dunlap@oracle.com>
Cc: linux-kbuild <linux-kbuild@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: kbuild: Preparing for merge window
Date: Mon, 28 Jan 2008 22:29:16 +0100 [thread overview]
Message-ID: <20080128212916.GB3842@uranus.ravnborg.org> (raw)
In-Reply-To: <20080124140422.409555b9.randy.dunlap@oracle.com>
On Thu, Jan 24, 2008 at 02:04:22PM -0800, Randy Dunlap wrote:
> On Thu, 24 Jan 2008 22:58:13 +0100 Sam Ravnborg wrote:
>
> > The following is the list of patches queued up for the merge window at the moment.
> > I have during the last week done several modpost changes to make section ismatch
> > warnings more reliable and I am happy with the modified modpost code now.
>
>
> Hi Sam,
>
> Can you add (if not already done) a paragraph to kconfig-language.txt
> about the preference of using HAVE_feature in Kconfig files vs.
> other spellings of that?
I just added this and sent it off for pull. I wanted it included and
decided that review comments could be addressed in a follow-up patch.
Hopefully it is remotely understandable.
Sam
>From ef8f5f34572a9adc9478840007d9fc4bcd7b6ad8 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Mon, 28 Jan 2008 21:49:46 +0100
Subject: [PATCH] kconfig: document use of HAVE_*
It has been discussed on lkml several times but we need
it documented as this is new stuff.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
Documentation/kbuild/kconfig-language.txt | 36 +++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt
index a43fcc6..649cb87 100644
--- a/Documentation/kbuild/kconfig-language.txt
+++ b/Documentation/kbuild/kconfig-language.txt
@@ -330,6 +330,42 @@ This is a collection of Kconfig tips, most of which aren't obvious at
first glance and most of which have become idioms in several Kconfig
files.
+Adding common features and make the usage configurable
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+It is a common idiom to implement a feature/functionality that are
+relevant for some architectures but not all.
+The recommended way to do so is to use a config variable named HAVE_*
+that is defined in a common Kconfig file and selected by the relevant
+architectures.
+An example is the generic IOMAP functionality.
+
+We would in lib/Kconfig see:
+
+# Generic IOMAP is used to ...
+config HAVE_GENERIC_IOMAP
+
+config GENERIC_IOMAP
+ depends on HAVE_GENERIC_IOMAP && FOO
+
+And in lib/Makefile we would see:
+obj-$(CONFIG_GENERIC_IOMAP) += iomap.o
+
+For each architecture using the generic IOMAP functionality we would see:
+
+config X86
+ select ...
+ select HAVE_GENERIC_IOMAP
+ select ...
+
+Note: we use the existing config option and avoid creating a new
+config variable to select HAVE_GENERIC_IOMAP.
+
+Note: the use of the internal config variable HAVE_GENERIC_IOMAP, it is
+introduced to overcome the limitation of select which will force a
+config option to 'y' no matter the dependencies.
+The dependencies are moved to the symbol GENERIC_IOMAP and we avoid the
+situation where select forces a symbol equals to 'y'.
+
Build as module only
~~~~~~~~~~~~~~~~~~~~
To restrict a component build to module-only, qualify its config symbol
--
1.5.4.rc3.14.g44397
prev parent reply other threads:[~2008-01-28 21:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-24 21:58 Sam Ravnborg
2008-01-24 22:00 ` Sam Ravnborg
2008-01-24 22:04 ` Randy Dunlap
2008-01-24 22:09 ` Sam Ravnborg
2008-01-28 21:29 ` Sam Ravnborg [this message]
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=20080128212916.GB3842@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=randy.dunlap@oracle.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®