pass CONFIG_FOO to CC problem
Hello,
I was expecting kbuild passes CONFIG_FOO from .config to CC -DCONFIG_FOO, but it doesn't. So I have to add
ifdef CONFIG_FOOEXTRA_CFLAGS += -DCONFIG_FOO
endif
Is that the right way? thanks in advance.
Signature · 2 lines
Coywolf Qi Hunt http://ahbl.org/~coywolf/
Quoted 10 lines · Coywolf Qi Hunt
Hello,
I was expecting kbuild passes
CONFIG_FOOfrom .config to CC -DCONFIG_FOO, but it doesn't. So I have to addifdef
CONFIG_FOOEXTRA_CFLAGS+= -DCONFIG_FOO
endifIs that the right way? thanks in advance.
I think you need to #include <linux/config.h>
Ian.
Signature · 5 lines
Ian Campbell BOFH excuse #186: permission denied
Quoted 6 lines · Ian Campbell
Quoted 5 lines · Coywolf Qi Hunt
Hello,
I was expecting kbuild passes
CONFIG_FOOfrom .config to CC -DCONFIG_FOO, but it doesn't. So I have to add
Quoted 7 lines
Quoted 5 lines
ifdef
CONFIG_FOOEXTRA_CFLAGS+= -DCONFIG_FOO
endifIs that the right way? thanks in advance.
I think you need to #include <
linux/config.h>
Yes, exactly. thanks
Hi Coywolf :)
* Coywolf Qi Hunt <[email protected]> dixit:
Quoted 6 lines
I was expecting kbuild passes
CONFIG_FOOfrom .config to CC -DCONFIG_FOO, but it doesn't. So I have to addifdef
CONFIG_FOOEXTRA_CFLAGS+= -DCONFIG_FOO
endif
NO! You don't do it that way in the kernel. Think: if you have to
pass a '-D' option for each config item you set, you will end up with TONS of '-D' options, in fact you probably exceed the command line size limit.
You have to include <linux/config.h> if I recall correctly ;)
Good luck!
Raúl Núñez de Arenas Coronado
Signature · 3 lines
Linux Registered User 88736 | http://www.dervishd.net http://www.pleyades.net & http://www.gotesdelluna.net It's my PC and I'll cry if I want to...
Quoted 6 lines · DervishD
Hi Coywolf :)
* Coywolf Qi Hunt <[email protected]> dixit:
Quoted 3 lines
I was expecting kbuild passes
CONFIG_FOOfrom .config to CC -DCONFIG_FOO, but it doesn't. So I have to add
Quoted 8 lines
Quoted 3 lines
ifdef
CONFIG_FOOEXTRA_CFLAGS+= -DCONFIG_FOO
endifNO! You don't do it that way in the kernel. Think: if you have to
pass a '-D' option for each config item you set, you will end up with TONS of '-D' options, in fact you probably exceed the command line size limit.
I see. It's not only ugly, but also harmful.
Quoted 3 lines
You have to include <
linux/config.h> if I recall correctly ;)
<linux/config.h> is for this purpose, if I understand correctly.
Coywolf