aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/icecc.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/icecc.bbclass')
-rw-r--r--meta/classes/icecc.bbclass62
1 files changed, 25 insertions, 37 deletions
diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index 2171e11db0..49597175ca 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -38,6 +38,8 @@ BB_HASHBASE_WHITELIST += "ICECC_PARALLEL_MAKE ICECC_DISABLED ICECC_USER_PACKAGE_
ICECC_ENV_EXEC ?= "${STAGING_BINDIR_NATIVE}/icecc-create-env"
+HOSTTOOLS_NONFATAL += "icecc"
+
# This version can be incremented when changes are made to the environment that
# invalidate the version on the compile nodes. Changing it will cause a new
# environment to be created.
@@ -98,9 +100,11 @@ DEPENDS_prepend += "${@icecc_dep_prepend(d)} "
get_cross_kernel_cc[vardepsexclude] += "KERNEL_CC"
def get_cross_kernel_cc(bb,d):
- kernel_cc = d.getVar('KERNEL_CC')
+ if not icecc_is_kernel(bb, d):
+ return None
# evaluate the expression by the shell if necessary
+ kernel_cc = d.getVar('KERNEL_CC')
if '`' in kernel_cc or '$(' in kernel_cc:
import subprocess
kernel_cc = subprocess.check_output("echo %s" % kernel_cc, shell=True).decode("utf-8")[:-1]
@@ -113,38 +117,6 @@ def get_cross_kernel_cc(bb,d):
def get_icecc(d):
return d.getVar('ICECC_PATH') or bb.utils.which(os.getenv("PATH"), "icecc")
-def create_path(compilers, bb, d):
- """
- Create Symlinks for the icecc in the staging directory
- """
- staging = os.path.join(d.expand('${STAGING_BINDIR}'), "ice")
- if icecc_is_kernel(bb, d):
- staging += "-kernel"
-
- #check if the icecc path is set by the user
- icecc = get_icecc(d)
-
- # Create the dir if necessary
- try:
- os.stat(staging)
- except:
- try:
- os.makedirs(staging)
- except:
- pass
-
- for compiler in compilers:
- gcc_path = os.path.join(staging, compiler)
- try:
- os.stat(gcc_path)
- except:
- try:
- os.symlink(icecc, gcc_path)
- except:
- pass
-
- return staging
-
def use_icecc(bb,d):
if d.getVar('ICECC_DISABLED') == "1":
# don't even try it, when explicitly disabled
@@ -248,12 +220,11 @@ def icecc_path(bb,d):
# don't create unnecessary directories when icecc is disabled
return
+ staging = os.path.join(d.expand('${STAGING_BINDIR}'), "ice")
if icecc_is_kernel(bb, d):
- return create_path( [get_cross_kernel_cc(bb,d), ], bb, d)
+ staging += "-kernel"
- else:
- prefix = d.expand('${HOST_PREFIX}')
- return create_path( [prefix+"gcc", prefix+"g++"], bb, d)
+ return staging
def icecc_get_external_tool(bb, d, tool):
external_toolchain_bindir = d.expand('${EXTERNAL_TOOLCHAIN}${bindir_cross}')
@@ -350,6 +321,23 @@ set_icecc_env() {
return
fi
+ ICECC_BIN="${@get_icecc(d)}"
+ if [ -z "${ICECC_BIN}" ]; then
+ bbwarn "Cannot use icecc: icecc binary not found"
+ return
+ fi
+
+ # Create symlinks to icecc in the recipe-sysroot directory
+ mkdir -p ${ICE_PATH}
+ if [ -n "${KERNEL_CC}" ]; then
+ compilers="${@get_cross_kernel_cc(bb,d)}"
+ else
+ compilers="${HOST_PREFIX}gcc ${HOST_PREFIX}g++"
+ fi
+ for compiler in $compilers; do
+ ln -sf ${ICECC_BIN} ${ICE_PATH}/$compiler
+ done
+
ICECC_CC="${@icecc_get_and_check_tool(bb, d, "gcc")}"
ICECC_CXX="${@icecc_get_and_check_tool(bb, d, "g++")}"
# cannot use icecc_get_and_check_tool here because it assumes as without target_sys prefix