summaryrefslogtreecommitdiffstats
path: root/meta/classes-global
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2022-12-23 11:38:40 +0800
committerSteve Sakoman <steve@sakoman.com>2023-01-11 06:07:36 -1000
commit539bc9d15e32c9574a0c038a6d1d666b5fb40d90 (patch)
tree5a9d16480dd491c6107a3de0943ab627597eb229 /meta/classes-global
parentbfa7e82d0b53644293173571c4e149717a015eb3 (diff)
downloadopenembedded-core-539bc9d15e32c9574a0c038a6d1d666b5fb40d90.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> (cherry picked from commit 1b7c81414cf252a7203d95703810a770184d7e4d) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes-global')
-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 8203f54519..2d0e35517e 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -139,7 +139,7 @@ def setup_hosttools_dir(dest, toolsvar, d, fatal=True):
# /usr/local/bin/ccache/gcc -> /usr/bin/ccache, then which(gcc)
# would return /usr/local/bin/ccache/gcc, but what we need is
# /usr/bin/gcc, this code can check and fix that.
- if "ccache" in srctool:
+ if os.path.islink(srctool) and os.path.basename(os.readlink(srctool)) == 'ccache':
srctool = bb.utils.which(path, tool, executable=True, direction=1)
if srctool:
os.symlink(srctool, desttool)