Make sure the cross compile toolchain path is added into the 'PATH' key
of the environment.
Change-Id: Iebe881052d5f9c351a86311d86536e5038b1e53d
Signed-off-by: Caiwen Zhang <caiwen.zhang@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/533
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Yuliya Kamatkova <yuliya.kamatkova@intel.com>
Reviewed-by: Sashi Penta <sashi.kumar.penta@intel.com>
prefix = env.get('TC_PREFIX')
tc_path = env.get('TC_PATH')
if prefix:
prefix = env.get('TC_PREFIX')
tc_path = env.get('TC_PATH')
if prefix:
- env.Replace(CC = prefix + 'gcc')
- env.Replace(CXX = prefix + 'g++')
- env.Replace(AR = prefix + 'ar')
- env.Replace(AS = prefix + 'as')
- env.Replace(LINK = prefix + 'ld')
- env.Replace(RANLIB = prefix + 'ranlib')
+ env.Replace(CC = prefix + env.get('CC', 'gcc'))
+ env.Replace(CXX = prefix + env.get('CXX', 'g++'))
+ env.Replace(AR = prefix + env.get('AR', 'ar'))
+ env.Replace(AS = prefix + env.get('AS', 'as'))
+ env.Replace(RANLIB = prefix + env.get('RANLIB', 'ranlib'))
if tc_path:
env.PrependENVPath('PATH', tc_path)
if tc_path:
env.PrependENVPath('PATH', tc_path)
# Ensure that the toolchain is in the PATH
penv = os.environ.copy()
# Ensure that the toolchain is in the PATH
penv = os.environ.copy()
-penv["PATH"] = tool_path + ":" + penv["PATH"]
+penv["PATH"] = tool_path + ":" + env['ENV'].get('PATH', '') + ':' + penv["PATH"]
build_path = os.path.join('build', target_os, target_arch)
build_path = os.path.join('build', target_os, target_arch)