fix boost library cross-compiling error
authorCaiwen Zhang <caiwen.zhang@intel.com>
Mon, 23 Mar 2015 09:32:52 +0000 (17:32 +0800)
committerSashi Penta <sashi.kumar.penta@intel.com>
Mon, 23 Mar 2015 19:08:52 +0000 (19:08 +0000)
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>
build_common/SConscript
extlibs/boost/SConscript

index 46cf809..56a872b 100644 (file)
@@ -87,12 +87,11 @@ if target_os in targets_support_cc:
        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)
index 751cbb6..f4c0858 100644 (file)
@@ -99,7 +99,7 @@ user_config_file.close();
 
 # 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)