public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
From: Kristof Provost <Kristof@provost-engineering.be>
To: Max <maxw_gcc@yahoo.com>
Cc: linux-newbie@vger.kernel.org
Subject: Re: Kernel .config  and kconfig general question
Date: Wed, 21 Nov 2007 22:51:18 +0100	[thread overview]
Message-ID: <20071121215118.GA1165@berith> (raw)
In-Reply-To: <505418.54128.qm@web33012.mail.mud.yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 1713 bytes --]

Hi,

I've moved this discussion to kernel newbies as Robert suggested.

On 2007-11-21 01:16:37 (-0800), Max <maxw_gcc@yahoo.com> wrote:
> Is it the same to comment out a variable in .config than assigning 'N' to it?
No and yes. 
I guess that doesn't help, so I'll try the long answer:

The .config file is generated by kconfig and parsed by Make. That means
there's a difference between "CONFIG_TEST = N" and "#CONFIG_TEST is not
set". However, the CONFIG_ variables are usually used as 
"obj-$(CONFIG_TEST)". The kernel makefiles don't add obj-n to the list
of files to build, so nothing is done for those variables.

> Also could somebody explain the big picture of how does the kernel
> configuration/build process treats the commented out variables in
> .config?
They're ignored, just like all commented out lines are ignored in a
Makefile.

> Or even more general:
> 
> Could anybody please help me in understanding the main picture of how a .config variable gets #define'd or #undefine'd in the kernel
> header files?
That's actually done by kconfig. It generates the .config file (based on
user choices or defaults) but it also generates
include/linux/autoconf.h. That header file does "#define CONFIG_TEST".

It will also touch include/config/test so the build system can be clever
when rebuilding. It allows the system to avoid rebuilding everything
which includes autoconf.h when the configuration is updated. The system
will replace the dependency on autoconf.h with a dependency on
config/test. Kconfig will only touch (update) the config/test file if
the value of CONFIG_TEST changed. That way only files which actually use
CONFIG_TEST will be rebuilt.

Kristof

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

       reply	other threads:[~2007-11-21 21:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <505418.54128.qm@web33012.mail.mud.yahoo.com>
2007-11-21 21:51 ` Kristof Provost [this message]
2007-11-23  6:11 Kernel .config and kconfig general question Max

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=20071121215118.GA1165@berith \
    --to=kristof@provost-engineering.be \
    --cc=linux-newbie@vger.kernel.org \
    --cc=maxw_gcc@yahoo.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