]> code.ossystems Code Review - openembedded-core.git/commitdiff
icecc: Support shell evaluation of KERNEL_CC
authorTobias Henkel <tobias.henkel@bmw-carit.de>
Tue, 12 Nov 2013 08:34:01 +0000 (09:34 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 12 Nov 2013 16:00:19 +0000 (16:00 +0000)
In the current implementation a KERNEL_CC variable containing shell
evaluation breaks the build process. Shell expansion is not happening
before general expansion in get_cross_kernel_cc which results in a
syntax error and an aborted parse process.

Before expanding the KERNEL_CC variable get_cross_kernel_cc now checks
for backticks or '$(' in the KERNEL_CC variable and performs a shell
evaluation using a call to echo if it finds one.

Signed-off-by: Tobias Henkel <tobias.henkel@bmw-carit.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/icecc.bbclass

index 8655883d8a6b9c71913ac122cd1e28e398ef0f26..31ad7a1691f354b0a8a52f1343677c40ba444431 100644 (file)
@@ -41,7 +41,13 @@ def icecc_dep_prepend(d):
 DEPENDS_prepend += "${@icecc_dep_prepend(d)} "
 
 def get_cross_kernel_cc(bb,d):
-    kernel_cc = d.expand('${KERNEL_CC}')
+    kernel_cc = d.getVar('KERNEL_CC')
+
+    # evaluate the expression by the shell if necessary
+    if '`' in kernel_cc or '$(' in kernel_cc:
+        kernel_cc = os.popen("echo %s" % kernel_cc).read()[:-1]
+
+    kernel_cc = d.expand(kernel_cc)
     kernel_cc = kernel_cc.replace('ccache', '').strip()
     kernel_cc = kernel_cc.split(' ')[0]
     kernel_cc = kernel_cc.strip()