summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-01-16 17:13:28 -0500
committerMike Frysinger <vapier@gentoo.org>2012-01-16 17:16:19 -0500
commitfaf51f000e70f067b51f5f2957ddb12764ffd98f (patch)
tree578a6ae5f6b9accf82e57208a2137b96da94204f
parentfe60f8005bde1d69ed539d57c479aabc9027a0dd (diff)
buildsys: fix handling of CFLAG_-W{a,l} vars
Need a little indirection/delayed evaluation to handle variables with equal signs and commas in them. Reported-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--Rules.mak6
1 files changed, 4 insertions, 2 deletions
diff --git a/Rules.mak b/Rules.mak
index 032193e6b..a84584f40 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -197,7 +197,8 @@ endef
# as well CFLAG_-Wa<flag> (for invoking the compiler driver).
define check-as-var
$(call check-tool-var,check_as,ASFLAG,$(1))
-export CFLAG_-Wa$(1) = $$(if $$(ASFLAG_$(1)),-Wa$(comma)$$(ASFLAG_$(1)))
+_v = CFLAG_-Wa$(1)
+export $(_v) = $$(if $$(ASFLAG_$(1)),-Wa$$(comma)$$(ASFLAG_$(1)))
endef
# Usage: check-ld-var,<flag>
# Check the linker to see if it supports <flag>. Export the
@@ -205,7 +206,8 @@ endef
# as well CFLAG_-Wl<flag> (for invoking the compiler driver).
define check-ld-var
$(call check-tool-var,check_ld,LDFLAG,$(1))
-export CFLAG_-Wl$(1) = $$(if $$(LDFLAG_$(1)),-Wl$(comma)$$(LDFLAG_$(1)))
+_v = CFLAG_-Wl$(1)
+export $$(_v) = $$(if $$(LDFLAG_$(1)),-Wl$$(comma)$$(LDFLAG_$(1)))
endef
# Usage: cache-output-var,<variable>,<shell command>
# Execute <shell command> and cache the output in <variable>.