8.1.7. Yocto/Poky/BitBake

8.1.7.1. Background

Your project is built using Yocto/Poky/BitBake.

8.1.7.2. What can be configured?

You need to take care of:

  • compiler profile creation for the used Yocto compiler

  • build system injection of the Axivion toolchain

8.1.7.3. What needs to be done?

Compiler profile

Yocto comes with setup scripts, usually with a name like /opt/poky/environment-* that can be sourced and set up a complete environment.

. /opt/poky/environment-xyz-init

The environment file defines variables like CC and CXX to point to the used GCC compiler including relevant switches such that after sourcing such an environment file, you can easily configure the profile with

gccsetup --cc "$CC" --cxx "$CXX" --config "$BAUHAUS_CONFIG"

Then, depending on your build system (e.g. Make, CMake, QMake, …) just inject cafeCC as usual, e.g.:

make CC=cafeCC CXX=cafeCC

Build system

In order to only build one part of a whole Yocto project, you can make use of BitBake’s devshell command to download and prepare all dependencies and open a shell with the environment already set up to just build the desired component. This is done e.g. with

bitbake -c devshell component-to-build

BitBake uses a separate terminal to open the developer shell. The terminal type can be configured with the environment variable OE_TERMINAL like

OE_TERMINAL=tmux bitbake -c devshell component-to-build

OE_TERMINAL=screen bitbake -c devshell component-to-build

OE_TERMINAL=custom OE_TERMINAL_CUSTOMCMD=bash bitbake -c devshell component-to-build

In the developer shell, variables like CC and CXX are already set, so you can use this environment directly to execute gccsetup and build with Make, CMake, QMake, etc.