Re: [KBUILD] 2.x.x mkdep incorrectly handles serial.c (and probably

Werner Almesberger (hagopiar@vuser.vu.union.edu)
Sat, 12 Jun 1999 10:48:54 -0400 (EDT)


Doesn't the gcc dependancy generation take all the #if lines into account?
-Rob

On Fri, 11 Jun 1999, Michael Elizabeth Chastain wrote:

> Date: Fri, 11 Jun 1999 23:02:50 -0500
> From: Michael Elizabeth Chastain <mec@shout.net>
> To: kaos@ocs.com.au, linux-kernel@vger.rutgers.edu
> Cc: linux-kbuild@torque.net, tytso@mit.edu
> Subject: Re: [KBUILD] 2.x.x mkdep incorrectly handles serial.c (and probably
others)
>
> Hi Keith,
>
> > Changing CONFIG_SERIAL_SHARE_IRQ with no other changes does *not*
> > recompile serial.c but it should.
>
> Good bug report. Ok, I believe I see the problem. Here is the structure
> of drivers/char/serial.c:
>
> #if 0
> #define CONFIG_SERIAL_MANY_PORTS
> ...
> #endif
>
> ... uses of CONFIG_SERIAL_MANY_PORTS ...
>
> mkdep.c sees the definition of CONFIG_SERIAL_MANY_PORTS and says "oh
> this is not an autoconfig variable; serial.c explicitly defines it".
> This is why your patch to serial.c avoids the problem. It's really a
> bug in mkdep.c: it doesn't understand the effects of #if lines.
>
> Would you like to fool around with mkdep.c? Right around here:
>
> pound_define_undef_CONFIG_word:
> GETNEXT
> if (isalnum(current) || current == '_')
> goto pound_define_undef_CONFIG_word;
> define_config(1, map_dot, next - map_dot - 1);
> goto __start;
>
> ... try ripping out the call to define_config.
>
> Then make a copy of the include/config directory before and after the
> patch, and see how different they are. This should fix the bug, and
> also introduce lots of ugly extra lines that don't actually hurt
> anything. If it works, that's the route I would like to go.
>
> Michael
>
> -- To unsubscribe, send mail to: linux-kbuild-request@torque.net --
> -- with the single word "unsubscribe" in the body of the message. --
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/