yocto: Use tools from sysroot before system PATH
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Fri, 16 Sep 2016 18:22:03 +0000 (20:22 +0200)
committerUze Choi <uzchoi@samsung.com>
Tue, 20 Sep 2016 11:15:56 +0000 (11:15 +0000)
commita85b25ef02fc3316219dc2a24c008b272c16990d
tree21561f0092d57cc0e453fda1a8f781f923727d49
parent94ffac1938bb0e655ff0b8ebe96582d7762f9428
yocto: Use tools from sysroot before system PATH

To ensure reproductibily Scons avoids to rely on environment
 but some systems like Yocto are defining their own cross compiling env.

To deal with those orthogonal paradigms,
 a new CONFIG_ENVIRONMENT_IMPORT variable has been introduced,
 It enables import of needed variables (PATH and pkg-config's ones).

Without this change, system tools might be used by scons
 instead of looking into yocto's sysroot.
 This is not not wanted and may be less reproductible.

This problem was noticed when building Ostro OS
 (on a system without all Yocto dependencies)
 reported error messages were:

  | sh: gdbus-codegen: command not found
  | /bin/sh: 1: pkg-config: not found

More information about using SCONS along Yocto, check some notes at:

https://bitbucket.org/scons/scons/wiki/Notes

Bug: https://jira.iotivity.org/browse/IOT-1219
Change-Id: I6af59a590f8be489398623d29cf85c2f568dd6a3
Origin: https://github.com/TizenTeam/iotivity/tree/sandbox/pcoval/on/master/mine
Thanks-to: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11935
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
build_common/SConscript