Difference between ?= and ??= in Yocto
= operator assigns a value to the variable. Values must be surrounded by double quotes.
E.g. FOO = "hello"
The value of FOO variable is "hello"
?= operator allows you to have a default value for a variable.
When the statement with ?= is parsed
E.g. FOO = "hello"
The value of FOO variable is "hello"
?= operator allows you to have a default value for a variable.
When the statement with ?= is parsed
- If the variable is undefined at the statement, the default value is assigned
- If the variable is assigned at this statement, then it will keep the original value and will not assign this value.
When there are multiple ?= assignments to a single variable, first of these is used.
To check the value of any environmental variable:
"bitbake -e <image_name> | grep ^VAR_NAME="
E.g. bitbake -e core-image-sato | grep ^DISTRO=
??= operator allows you to achieve a "weaker" assignment for a variable. This assignment is similar to ?= except the value is assigned at the end of the parsing process.
When multiple assignments are present, the value of the last assignment is taken.
Comments
Post a Comment