public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [question] pass CONFIG_FOO to CC problem
@ 2005-06-22  8:39 Coywolf Qi Hunt
  2005-06-22  9:54 ` Ian Campbell
  2005-06-22 18:12 ` DervishD
  0 siblings, 2 replies; 5+ messages in thread
From: Coywolf Qi Hunt @ 2005-06-22  8:39 UTC (permalink / raw)
  To: lkml; +Cc: sam

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_FOO
EXTRA_CFLAGS += -DCONFIG_FOO
endif

Is that the right way? thanks in advance.

-- 
Coywolf Qi Hunt
http://ahbl.org/~coywolf/

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

* Re: [question] pass CONFIG_FOO to CC problem
  2005-06-22  8:39 [question] pass CONFIG_FOO to CC problem Coywolf Qi Hunt
@ 2005-06-22  9:54 ` Ian Campbell
  2005-06-22 10:11   ` Coywolf Qi Hunt
  2005-06-22 18:12 ` DervishD
  1 sibling, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2005-06-22  9:54 UTC (permalink / raw)
  To: coywolf; +Cc: lkml, sam

On Wed, 2005-06-22 at 16:39 +0800, Coywolf Qi Hunt wrote:
> 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_FOO
> EXTRA_CFLAGS += -DCONFIG_FOO
> endif
> 
> Is that the right way? thanks in advance.

I think you need to #include <linux/config.h>

Ian.
-- 
Ian Campbell

BOFH excuse #186:

permission denied


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

* Re: [question] pass CONFIG_FOO to CC problem
  2005-06-22  9:54 ` Ian Campbell
@ 2005-06-22 10:11   ` Coywolf Qi Hunt
  0 siblings, 0 replies; 5+ messages in thread
From: Coywolf Qi Hunt @ 2005-06-22 10:11 UTC (permalink / raw)
  To: Ian Campbell; +Cc: lkml, sam

On 6/22/05, Ian Campbell <ijc@hellion.org.uk> wrote:
> On Wed, 2005-06-22 at 16:39 +0800, Coywolf Qi Hunt wrote:
> > 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_FOO
> > EXTRA_CFLAGS += -DCONFIG_FOO
> > endif
> >
> > Is that the right way? thanks in advance.
> 
> I think you need to #include <linux/config.h>

Yes, exactly. thanks

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

* Re: [question] pass CONFIG_FOO to CC problem
  2005-06-22  8:39 [question] pass CONFIG_FOO to CC problem Coywolf Qi Hunt
  2005-06-22  9:54 ` Ian Campbell
@ 2005-06-22 18:12 ` DervishD
  2005-06-23  2:04   ` Coywolf Qi Hunt
  1 sibling, 1 reply; 5+ messages in thread
From: DervishD @ 2005-06-22 18:12 UTC (permalink / raw)
  To: coywolf; +Cc: lkml, sam

    Hi Coywolf :)

 * Coywolf Qi Hunt <coywolf@gmail.com> dixit:
> I was expecting kbuild passes CONFIG_FOO from .config to CC
> -DCONFIG_FOO, but it doesn't.  So I have to add
> 
> ifdef CONFIG_FOO
> EXTRA_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

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

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

* Re: [question] pass CONFIG_FOO to CC problem
  2005-06-22 18:12 ` DervishD
@ 2005-06-23  2:04   ` Coywolf Qi Hunt
  0 siblings, 0 replies; 5+ messages in thread
From: Coywolf Qi Hunt @ 2005-06-23  2:04 UTC (permalink / raw)
  To: lkml; +Cc: sam, linux-kernel

On Wed, Jun 22, 2005 at 08:12:07PM +0200, DervishD wrote:
>     Hi Coywolf :)
> 
>  * Coywolf Qi Hunt <coywolf@gmail.com> dixit:
> > I was expecting kbuild passes CONFIG_FOO from .config to CC
> > -DCONFIG_FOO, but it doesn't.  So I have to add
> > 
> > ifdef CONFIG_FOO
> > EXTRA_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.

I see. It's not only ugly, but also harmful.

> 
>     You have to include <linux/config.h> if I recall correctly ;)
> 

<linux/config.h> is for this purpose, if I understand correctly.


		Coywolf

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

end of thread, other threads:[~2005-06-23  2:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-22  8:39 [question] pass CONFIG_FOO to CC problem Coywolf Qi Hunt
2005-06-22  9:54 ` Ian Campbell
2005-06-22 10:11   ` Coywolf Qi Hunt
2005-06-22 18:12 ` DervishD
2005-06-23  2:04   ` Coywolf Qi Hunt

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