All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix cc-option-yn whitespace
@ 2007-02-08  3:30 Roland McGrath
  2007-02-08  4:34 ` Linus Torvalds
  0 siblings, 1 reply; 4+ messages in thread
From: Roland McGrath @ 2007-02-08  3:30 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds; +Cc: linux-kernel

This change:

	commit 5de043f4bd11a9e0a3e8daec7d1905da575a76b7
	Author: Oleg Verych <olecom@flower.upol.cz>
	Date:   Tue Feb 6 02:18:21 2007 +0100

	    [PATCH] kbuild: improve option checking, Kbuild.include cleanup

introduced leading whitespace in the results of cc-option-yn and such.
This breaks some of their uses, like HAS_MTUNE in arch/i386/Makefile.cpu.

This patch fixes the regression.

Signed-off-by: Roland McGrath <roland@redhat.com>
---
 scripts/Kbuild.include |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 96926eb..931d52f 100644  
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -60,6 +60,7 @@ endef
 # Usage: option = $(call checker-shell, $(CC)...-o $$OUT, option-ok, otherwise)
 # Exit code chooses option. $$OUT is safe location for needless output.
 define checker-shell
+$(strip \
   $(shell set -e; \
     DIR=$(KBUILD_EXTMOD); \
     cd $${DIR:-$(objtree)}; \
@@ -70,7 +71,7 @@ define checker-shell
       then echo "$(2)"; \
       else echo "$(3)"; \
     fi; \
-    rm -f $$OUT)
+    rm -f $$OUT))
 endef
 
 # as-option

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

* Re: [PATCH] fix cc-option-yn whitespace
  2007-02-08  3:30 [PATCH] fix cc-option-yn whitespace Roland McGrath
@ 2007-02-08  4:34 ` Linus Torvalds
  2007-02-08 20:06   ` Roland McGrath
  0 siblings, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2007-02-08  4:34 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Andrew Morton, linux-kernel



On Wed, 7 Feb 2007, Roland McGrath wrote:

> This change:
> 
> 	commit 5de043f4bd11a9e0a3e8daec7d1905da575a76b7
> 	Author: Oleg Verych <olecom@flower.upol.cz>
> 	Date:   Tue Feb 6 02:18:21 2007 +0100
> 
> 	    [PATCH] kbuild: improve option checking, Kbuild.include cleanup
> 
> introduced leading whitespace in the results of cc-option-yn and such.
> This breaks some of their uses, like HAS_MTUNE in arch/i386/Makefile.cpu.

Yes.. It doesn't seem to happen with make-3.81, for some reason, and I 
don't see why the leading space happens. Maybe somebody with deep GNU make 
knowledge knows.

I committed the hopefully equivalent patch (that also removes the 
symlinking to /dev/null that Roman objected to).

			Linus

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

* Re: [PATCH] fix cc-option-yn whitespace
  2007-02-08  4:34 ` Linus Torvalds
@ 2007-02-08 20:06   ` Roland McGrath
  2007-02-08 20:54     ` Oleg Verych
  0 siblings, 1 reply; 4+ messages in thread
From: Roland McGrath @ 2007-02-08 20:06 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, linux-kernel

> Yes.. It doesn't seem to happen with make-3.81, for some reason, and I 
> don't see why the leading space happens. Maybe somebody with deep GNU make 
> knowledge knows.

You probably think that's me, but thankfully I have succeeded in forgetting
more about GNU make than anyone else knew.  I wouldn't be much surprised if
3.81 changed some details about whitespace in `call', or in `define', or
something else like that; people keep diddling with make.  At least in the
world I knew, only whitespace after an = or := is stripped like you might
have been expecting, and not whitespace after commas (I mean, why else
would make have the `strip' function?).  All of the $(call foo, a, b) uses
introduce whitespace (vs $(call foo,a,b)).  It's been luck, or silent
careful tweaking, that's made all those work out right so far.  Note also
that the new form of cc-option-yn results in:
      then echo " "y""; \
      else echo " "n""; \
in those commands.  Some other uses of the functions turned into
checker-shell uses might have doubled quotes (i.e. unquoted text) now too.
(People always think make is sh, but it's m4.)

I have long ago sworn off thinking too hard about other people's makefiles
that get arcane with GNU make features.  (You don't feel compelled to watch
every piece of porn on the net that people use Linux to get there, do you?)
So I just did the minimal tweak to fix the concrete regression, though I'd
have to say that the "cleanup" has made things messier and more obfuscated.


Thanks,
Roland

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

* Re: [PATCH] fix cc-option-yn whitespace
  2007-02-08 20:06   ` Roland McGrath
@ 2007-02-08 20:54     ` Oleg Verych
  0 siblings, 0 replies; 4+ messages in thread
From: Oleg Verych @ 2007-02-08 20:54 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Linus Torvalds, Andrew Morton, linux-kernel

> From: Roland McGrath <roland@redhat.com>
> Newsgroups: gmane.linux.kernel
> Subject: Re: [PATCH] fix cc-option-yn whitespace
> Date: Thu,  8 Feb 2007 12:06:35 -0800 (PST)

[]
> I have long ago sworn off thinking too hard about other people's makefiles
> that get arcane with GNU make features.  (You don't feel compelled to watch
> every piece of porn on the net that people use Linux to get there, do you?)

> So I just did the minimal tweak to fix the concrete regression, though I'd
> have to say that the "cleanup" has made things messier and more obfuscated.

Well, "refactoring". I think, it's hard to disagree, how messy $(CC) was
called there.

Thus, i tried to turn `m4' to `sh', because it's `sh' who does job. With
help of the mentors, it's done now. Good kick-start after stability
kernel release, nobody should relax (:.

Thanks.
____

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

end of thread, other threads:[~2007-02-08 20:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-08  3:30 [PATCH] fix cc-option-yn whitespace Roland McGrath
2007-02-08  4:34 ` Linus Torvalds
2007-02-08 20:06   ` Roland McGrath
2007-02-08 20:54     ` Oleg Verych

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.