OIC scons build patch for Yocto
authorKishen Maloor <kishen.maloor@intel.com>
Wed, 17 Dec 2014 01:43:22 +0000 (17:43 -0800)
committerKishen Maloor <kishen.maloor@intel.com>
Wed, 17 Dec 2014 01:45:29 +0000 (17:45 -0800)
commit585ea764d6919815454632f93422b3c348233f0b
tree09ab6a1ccd0ec42c1a95d6b1fabb41b8568a0bde
parent5d066c63a68d19d620e470421a7ec8e1a65d5a7f
OIC scons build patch for Yocto

Function:
Adds Yocto as a build target for OIC. Code is
executed ONLY when TARGET_OS=yocto.
It WILL NOT affect a build for any other target.

Background:
Yocto cross-toolchains for platforms would have
to be fetched, installed and configured in their
standard way. This configuration is done by
sourcing in an “environment setup” script that
comes with the toolchain. scons is run after this
step.

Details:
The code in this patch reads the variables set
by Yocto’s script and: 1) Learns of tool names and
build flags (varies by target and arch.), 2) Finds
absolute path of these tools (yocto’s script adds
these to PATH) by looking in PATH, 3) Modifies the
scons construction environment to point to tools
+ all their required flags, 4) Switches TARGET_OS
to Linux so that it uses the Linux build configuration
for OIC, 5) Elects to preserve debug symbols (using -g)
so that Yocto’s build process can generate both
DEBUG and RELEASE packages for OIC (This is the
default recommendation of Yocto’s BitBake)

Additional notes:
-The pre-existing TC_PREFIX/TC_PATH framework is
not sufficient to support Yocto’s cross-toolchain.
-Supported architectures for the yocto target are x86
and x86_64. These have been tested to work for Intel
Edison and Minnowboard platforms.

Usage:
From a user’s perspective, there are no unexpected
steps.
1) source <yocto-env-setup-script>
2) …/oic-resource$ scons TARGET_OS=yocto <regular options>
For eg. “scons TARGET_OS=yocto TARGET_ARCH=x86 RELEASE=1”
The results of a build will now go into “out/yocto/x86/…”.
If step 1) hasn’t been done before step 2), the build will
fail with an error message.

Change-Id: I55efab20f9c174f46446e9d59e3fca6eef3df7f2
Signed-off-by: Kishen Maloor <kishen.maloor@intel.com>
build_common/SConscript