Re: Kernel .config and kconfig general question

Re: Kernel .config and kconfig general question

am 21.11.2007 22:51:18 von Kristof Provost

--lrZ03NoBR/3+SXJZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

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

On 2007-11-21 01:16:37 (-0800), Max wrote:
> Is it the same to comment out a variable in .config than assigning 'N' to=
it?
No and yes.=20
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 =3D N" and "#CONFIG_TEST is not
set". However, the CONFIG_ variables are usually used as=20
"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:
>=20
> 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

--lrZ03NoBR/3+SXJZ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFHRKhWUEZ9DhGwDugRAiJFAJwKR+e6PZwFK2JSw3GUycT3MZVkyQCc CE1P
UK2ty41R3LYWR9+PXZrDSYA=
=Z7ab
-----END PGP SIGNATURE-----

--lrZ03NoBR/3+SXJZ--
-
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