From: Philippe Coval Date: Thu, 12 May 2016 17:48:14 +0000 (+0200) Subject: Build: Export pkg-config when cross compiling using yocto X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=129440510176a0badf06174f1787c63a6c74b4d6;p=contrib%2Fiotivity.git Build: Export pkg-config when cross compiling using yocto 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 Reviewed-on: https://gerrit.iotivity.org/gerrit/8125 Tested-by: jenkins-iotivity Reviewed-by: David Antler Reviewed-by: Ziran Sun --- diff --git a/build_common/SConscript b/build_common/SConscript index 2be70ce..c5651f6 100644 --- a/build_common/SConscript +++ b/build_common/SConscript @@ -180,6 +180,14 @@ if target_os in targets_support_cc: 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)