From 0045e061ff96d06c22077bde720e8227a9ea45a6 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 25 Sep 2018 15:57:28 +0200 Subject: [PATCH] phase1: rework MakeEnv() Always set CCC and CCXX since ./staging_dir/host/bin/{gcc,g++} might be symlinked to the ccache wrapper which uses $CCC / $CCXX to refer to the actual compiler, even when we intend to invoke the build without ccache. While being at it, shuffle the code around somewhat to reduce some redundancy and to make the function a bit shorter. Signed-off-by: Jo-Philipp Wich --- phase1/master.cfg | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/phase1/master.cfg b/phase1/master.cfg index 71b3c81..de46c1b 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -334,25 +334,18 @@ def GetNextBuild(builder, requests): return requests[0] def MakeEnv(overrides=None, tryccache=False): - if tryccache: - envcc = Interpolate("%(kw:cwd)s/ccache_cc.sh", cwd=GetCwd) - envcxx = Interpolate("%(kw:cwd)s/ccache_cxx.sh", cwd=GetCwd) - envccache = Interpolate("%(kw:ccache)s", ccache=GetCCache) - envccc = Interpolate("%(kw:cc)s", cc=GetCC) - envccxx = Interpolate("%(kw:cxx)s", cxx=GetCXX) - else: - envcc = Interpolate("%(kw:cc)s", cc=GetCC) - envcxx = Interpolate("%(kw:cxx)s", cxx=GetCXX) - envccache = "" - envccc = "" - envccxx = "" env = { - 'CC': envcc, - 'CXX': envcxx, - 'CCACHE': envccache, - 'CCC': envccc, - 'CCXX': envccxx, + 'CCC': Interpolate("%(kw:cc)s", cc=GetCC), + 'CCXX': Interpolate("%(kw:cxx)s", cxx=GetCXX), } + if tryccache: + env['CC'] = Interpolate("%(kw:cwd)s/ccache_cc.sh", cwd=GetCwd) + env['CXX'] = Interpolate("%(kw:cwd)s/ccache_cxx.sh", cwd=GetCwd) + env['CCACHE'] = Interpolate("%(kw:ccache)s", ccache=GetCCache) + else: + env['CC'] = env['CCC'] + env['CXX'] = env['CCXX'] + env['CCACHE'] = '' if overrides is not None: env.update(overrides) return env -- 2.30.2