The native
class provides common
functionality for recipes that build tools to run on the
build host
(i.e. tools that use the compiler or other tools from the
build host).
You can create a recipe that builds tools that run natively on the host a couple different ways:
Create a
myrecipe
-native.bb
recipe that inherits the native
class.
If you use this method, you must order the inherit statement
in the recipe after all other inherit statements so that the
native
class is inherited last.
myrecipe
-native.bb
Not using this naming convention can lead to subtle
problems caused by existing code that depends on that
naming convention.
Create or modify a target recipe that contains the following:
BBCLASSEXTEND
= "native"
Inside the recipe, use _class-native
and
_class-target
overrides to specify any
functionality specific to the respective native or target
case.
Although applied differently, the native
class is
used with both methods.
The advantage of the second method is that you do not need to have two
separate recipes (assuming you need both) for native and target.
All common parts of the recipe are automatically shared.