Patchwork [2/3] WIP: icecc.bbclass: use bb.utils.which also for 'as'

login
register
mail settings
Submitter Martin Jansa
Date Dec. 4, 2013, 10:10 p.m.
Message ID <1386195032-18264-2-git-send-email-Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/62857/
State New
Headers show

Comments

Martin Jansa - Dec. 4, 2013, 10:10 p.m.
WIP: haven't properly tested it yet

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/classes/icecc.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index 5af764d..3c719ef 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -251,6 +251,8 @@  set_icecc_env() {
 
     ICECC_CC="${@icc_get_and_check_tool(bb, d, "gcc")}"
     ICECC_CXX="${@icc_get_and_check_tool(bb, d, "g++")}"
+    # cannot use icc_get_and_check_tool here because it assumes as without target_sys prefix
+    ICECC_WHICH_AS="${@bb.utils.which(os.getenv('PATH'), 'as')}"
     if [ ! -x "${ICECC_CC}" -o ! -x "${ICECC_CXX}" ]
     then
         bbwarn "Cannot use icecc: could not get ICECC_CC or ICECC_CXX"
@@ -268,7 +270,7 @@  set_icecc_env() {
     ICECC_AS="`${ICECC_CC} -print-prog-name=as`"
     if [ "`dirname "${ICECC_AS}"`" = "." ]
     then
-        ICECC_AS="`which as`"
+        ICECC_AS="${ICECC_WHICH_AS}"
     fi
 
     if [ ! -f "${ICECC_VERSION}.done" ]