build: fix grep invocation in cc-options
authorKeir Fraser <keir@xen.org>
Fri, 30 Sep 2011 20:17:47 +0000 (21:17 +0100)
committerKeir Fraser <keir@xen.org>
Fri, 30 Sep 2011 20:17:47 +0000 (21:17 +0100)
Currently the build produces lots of
        Usage: grep [OPTION]... PATTERN [FILE]...
        Try `grep --help' for more information.

This is due to the "grep -- $(2)" in cc-options. It seems that the
default of reading stdin is disabled when using "--". I don't know if
this is a bug in grep or how it is supposed to be but we can work
around it by explicitly passing in "-"

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Config.mk

index 6505697df1dd841837a7cc277f2324d2ca60c06c..6cb37ca6b9be067319932b439773d7169c776764 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -84,7 +84,7 @@ PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)"
 #
 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
 cc-option = $(shell if test -z "`echo 'void*p=1;' | \
-              $(1) $(2) -S -o /dev/null -xc - 2>&1 | grep -- $(2)`"; \
+              $(1) $(2) -S -o /dev/null -xc - 2>&1 | grep -- $(2) -`"; \
               then echo "$(2)"; else echo "$(3)"; fi ;)
 
 # cc-option-add: Add an option to compilation flags, but only if supported.