Without this change, host's /usr/include may be used which is unwanted.
This was obsevered when building with Yocto jethro setup
with security checks (LfAgl).
While this change has been done for crosscompiling purpose,
it make sense to have this in all contexts.
(ie: those which don't set CROSS_COMPILE variable)
Bug-AGL: https://jira.automotivelinux.org/browse/SPEC-158
Origin: https://github.com/tizenteam/iotivity
Change-Id: I3027642c77cc27f2072cdc22886aa09e124cdf4c
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/8125
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: David Antler <david.a.antler@intel.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
if prefix or tc_path:
print tc_set_msg
+# If cross-compiling, honor environment settings for toolchain to avoid picking up native tools
+if os.environ.get('PKG_CONFIG') != None:
+ env["ENV"]["PKG_CONFIG"] = os.environ.get("PKG_CONFIG")
+if os.environ.get('PKG_CONFIG_PATH') != None:
+ env["ENV"]["PKG_CONFIG_PATH"] = os.environ.get("PKG_CONFIG_PATH")
+if os.environ.get('PKG_CONFIG_SYSROOT_DIR') != None:
+ env["ENV"]["PKG_CONFIG_SYSROOT_DIR"] = os.environ.get("PKG_CONFIG_SYSROOT_DIR")
+
# Ensure scons be able to change its working directory
env.SConscriptChdir(1)