public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Kernel .config  and kconfig general question
       [not found] <505418.54128.qm@web33012.mail.mud.yahoo.com>
@ 2007-11-21 21:51 ` Kristof Provost
  0 siblings, 0 replies; 2+ messages in thread
From: Kristof Provost @ 2007-11-21 21:51 UTC (permalink / raw)
  To: Max; +Cc: linux-newbie

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Kernel .config  and kconfig general question
@ 2007-11-23  6:11 Max
  0 siblings, 0 replies; 2+ messages in thread
From: Max @ 2007-11-23  6:11 UTC (permalink / raw)
  To: Kristof Provost; +Cc: linux-newbie

First of all many thanks for your help. And very useful information.

>From: Kristof Provost
>To: Max
>Hi,
>I've moved this discussion to kernel newbies as Robert suggested.

Many thanks Kristof. Now I know where to post my newbie questions ;-) Although linux-newbie traffic seems very low...

>>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.

>> 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


Let me see if I understand the whole picture:
When you do:

$ make defconfig (for example)
...
scripts/kconfig/conf -d arch/i386/Kconfig
...
Runs and the .config gets created (in this case with defaults)

Then when you do:
$ make
...
scripts/kconfig/conf -s arch/i386/Kconfig
...
Runs and the following 3 files are generated just before the whole
 shebang starts:

-include/config/auto.conf.cmd
-include/linux/autoconf.h
-include/config/auto.conf

Well I did this simple exercise

$ make defconfig

vi .config and assign 'n'  to CONFIG_HIGH_RES_TIMER (only for testing)

Then run

$ make oldconfig

And that make oldconfig automatically commented out this line. Which may suggest that 
CONFIG_HIGH_RES_TIMER=n
#CONFIG_HIGH_RES_TIMER
Are treated in an equivalent way for the compilation building process....

I don't know if this holds true for all other CONFIG_ variables. But at least is a starting point. The clues could probably arise by reading and understanding
scripts/kconfig/confdata.c


Thanks again for your help,

Max








      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-23  6:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <505418.54128.qm@web33012.mail.mud.yahoo.com>
2007-11-21 21:51 ` Kernel .config and kconfig general question Kristof Provost
2007-11-23  6:11 Max

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox