summaryrefslogtreecommitdiffstats
path: root/meta/classes-global/base.bbclass
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2022-12-23 11:38:40 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-23 12:05:52 +0000
commit06763de40af8dd0c152bfb536f3d6e83e1c03000 (patch)
tree3bd2023114191c0b403528b5649ce14169f55afe /meta/classes-global/base.bbclass
parent79e57d41d2febbbd6c66622fd8376ef97c584621 (diff)
downloadpoky-06763de40af8dd0c152bfb536f3d6e83e1c03000.tar.gz
base.bbclass: Fix way to check ccache path
The previous code had 2 issues: 1. make hosttools/ccache always link to host's ccache (/usr/bin/ccache) even we have one buildtools 2. make hosttools/gcc etc, link to host's gcc event we have one buildtools when keyword ccache in buildtools's path, eg: /mnt/ccache/bin/buildtools This patch is for fix above issues. Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global/base.bbclass')
-rw-r--r--meta/classes-global/base.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index c4ac43c569..64e805c947 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -116,7 +116,7 @@ def setup_hosttools_dir(dest, toolsvar, d, fatal=True):
116 # /usr/local/bin/ccache/gcc -> /usr/bin/ccache, then which(gcc) 116 # /usr/local/bin/ccache/gcc -> /usr/bin/ccache, then which(gcc)
117 # would return /usr/local/bin/ccache/gcc, but what we need is 117 # would return /usr/local/bin/ccache/gcc, but what we need is
118 # /usr/bin/gcc, this code can check and fix that. 118 # /usr/bin/gcc, this code can check and fix that.
119 if "ccache" in srctool: 119 if os.path.islink(srctool) and os.path.basename(os.readlink(srctool)) == 'ccache':
120 srctool = bb.utils.which(path, tool, executable=True, direction=1) 120 srctool = bb.utils.which(path, tool, executable=True, direction=1)
121 if srctool: 121 if srctool:
122 os.symlink(srctool, desttool) 122 os.symlink(srctool, desttool)