diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 23:24:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 23:24:25 -0500 |
commit | c4184f117af7441fb83bc413d2214d92920e0289 (patch) | |
tree | d6f77ef7a5fab96f38567c58d88ccdfe0db3fcbc /scripts | |
parent | 905adce4094d64a6691df994e424fbf486301adc (diff) |
kbuild: make $(checker-shell ) strip spaces around the result
It looks like GNU make version 3.80 (but apparently not 3.81) adds
leading whitespace to the result of the checker-shell execution. This
strips them off explicitly.
Also, don't bother symlinking the output file to /dev/null. It's likely
as expensive as just writing the temp-file, and we need to remove it
anyway afterwards.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Kbuild.include | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index d65c40331e66..8d7eabf238c0 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -60,17 +60,16 @@ endef | |||
60 | # Usage: option = $(call checker-shell,$(CC)...-o $$OUT,option-ok,otherwise) | 60 | # Usage: option = $(call checker-shell,$(CC)...-o $$OUT,option-ok,otherwise) |
61 | # Exit code chooses option. $$OUT is safe location for needless output. | 61 | # Exit code chooses option. $$OUT is safe location for needless output. |
62 | define checker-shell | 62 | define checker-shell |
63 | $(strip | ||
63 | $(shell set -e; \ | 64 | $(shell set -e; \ |
64 | DIR=$(KBUILD_EXTMOD); \ | 65 | DIR=$(KBUILD_EXTMOD); \ |
65 | cd $${DIR:-$(objtree)}; \ | 66 | cd $${DIR:-$(objtree)}; \ |
66 | OUT=$$PWD/.$$$$.null; \ | 67 | OUT=$$PWD/.$$$$.null; \ |
67 | \ | ||
68 | ln -s /dev/null $$OUT; \ | ||
69 | if $(1) >/dev/null 2>&1; \ | 68 | if $(1) >/dev/null 2>&1; \ |
70 | then echo "$(2)"; \ | 69 | then echo "$(2)"; \ |
71 | else echo "$(3)"; \ | 70 | else echo "$(3)"; \ |
72 | fi; \ | 71 | fi; \ |
73 | rm -f $$OUT) | 72 | rm -f $$OUT)) |
74 | endef | 73 | endef |
75 | 74 | ||
76 | # as-option | 75 | # as-option |