Meaning of ?= and ??= in bitbake/yocto

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
What does the different assignment types mean in bitbake recipe scripts, such as:
BB_NUMBER_THREADS ?= "$@oe.utils.cpu_count()"
PARALLEL_MAKE ?= "-j $@oe.utils.cpu_count()"
MACHINE ??= "qemux86"
What of above is analogous to Ruby's bb_number_threads ||= 'something'?
embedded yocto bitbake
add a comment |Â
up vote
1
down vote
favorite
What does the different assignment types mean in bitbake recipe scripts, such as:
BB_NUMBER_THREADS ?= "$@oe.utils.cpu_count()"
PARALLEL_MAKE ?= "-j $@oe.utils.cpu_count()"
MACHINE ??= "qemux86"
What of above is analogous to Ruby's bb_number_threads ||= 'something'?
embedded yocto bitbake
That's not shell script, as far as I know, anyway. PHP?
â mikeserv
Jul 10 '15 at 8:59
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
What does the different assignment types mean in bitbake recipe scripts, such as:
BB_NUMBER_THREADS ?= "$@oe.utils.cpu_count()"
PARALLEL_MAKE ?= "-j $@oe.utils.cpu_count()"
MACHINE ??= "qemux86"
What of above is analogous to Ruby's bb_number_threads ||= 'something'?
embedded yocto bitbake
What does the different assignment types mean in bitbake recipe scripts, such as:
BB_NUMBER_THREADS ?= "$@oe.utils.cpu_count()"
PARALLEL_MAKE ?= "-j $@oe.utils.cpu_count()"
MACHINE ??= "qemux86"
What of above is analogous to Ruby's bb_number_threads ||= 'something'?
embedded yocto bitbake
edited Jun 13 at 9:40
Kusalananda
103k13202318
103k13202318
asked Jul 10 '15 at 8:53
Frankie_Fomalhaut
16616
16616
That's not shell script, as far as I know, anyway. PHP?
â mikeserv
Jul 10 '15 at 8:59
add a comment |Â
That's not shell script, as far as I know, anyway. PHP?
â mikeserv
Jul 10 '15 at 8:59
That's not shell script, as far as I know, anyway. PHP?
â mikeserv
Jul 10 '15 at 8:59
That's not shell script, as far as I know, anyway. PHP?
â mikeserv
Jul 10 '15 at 8:59
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
5
down vote
As per this section of Bitbake manual
?= is:
You can use the "?=" operator to achieve a "softer" assignment for a variable. This type of assignment allows you to define a variable if it is undefined when the statement is parsed, but to leave the value alone if the variable has a value. Here is an example:
A ?= "aval"
If A is set at the time this statement is parsed, the variable retains its value. However, if A is not set, the variable is set to "aval".
??= is:
It is possible to use a "weaker" assignment than in the previous section by using the "??=" operator. This assignment behaves identical to "?=" except that the assignment is made at the end of the parsing process rather than immediately. Consequently, when multiple "??=" assignments exist, the last one is used. Also, any "=" or "?=" assignment will override the value set with "??=". Here is an example:
A ??= "somevalue"
A ??= "someothervalue"
If A is set before the above statements are parsed, the variable
retains its value. If A is not set, the variable is set to
"someothervalue".
Again, this assignment is a "lazy" or "weak" assignment because it
does not occur until the end of the parsing process.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
As per this section of Bitbake manual
?= is:
You can use the "?=" operator to achieve a "softer" assignment for a variable. This type of assignment allows you to define a variable if it is undefined when the statement is parsed, but to leave the value alone if the variable has a value. Here is an example:
A ?= "aval"
If A is set at the time this statement is parsed, the variable retains its value. However, if A is not set, the variable is set to "aval".
??= is:
It is possible to use a "weaker" assignment than in the previous section by using the "??=" operator. This assignment behaves identical to "?=" except that the assignment is made at the end of the parsing process rather than immediately. Consequently, when multiple "??=" assignments exist, the last one is used. Also, any "=" or "?=" assignment will override the value set with "??=". Here is an example:
A ??= "somevalue"
A ??= "someothervalue"
If A is set before the above statements are parsed, the variable
retains its value. If A is not set, the variable is set to
"someothervalue".
Again, this assignment is a "lazy" or "weak" assignment because it
does not occur until the end of the parsing process.
add a comment |Â
up vote
5
down vote
As per this section of Bitbake manual
?= is:
You can use the "?=" operator to achieve a "softer" assignment for a variable. This type of assignment allows you to define a variable if it is undefined when the statement is parsed, but to leave the value alone if the variable has a value. Here is an example:
A ?= "aval"
If A is set at the time this statement is parsed, the variable retains its value. However, if A is not set, the variable is set to "aval".
??= is:
It is possible to use a "weaker" assignment than in the previous section by using the "??=" operator. This assignment behaves identical to "?=" except that the assignment is made at the end of the parsing process rather than immediately. Consequently, when multiple "??=" assignments exist, the last one is used. Also, any "=" or "?=" assignment will override the value set with "??=". Here is an example:
A ??= "somevalue"
A ??= "someothervalue"
If A is set before the above statements are parsed, the variable
retains its value. If A is not set, the variable is set to
"someothervalue".
Again, this assignment is a "lazy" or "weak" assignment because it
does not occur until the end of the parsing process.
add a comment |Â
up vote
5
down vote
up vote
5
down vote
As per this section of Bitbake manual
?= is:
You can use the "?=" operator to achieve a "softer" assignment for a variable. This type of assignment allows you to define a variable if it is undefined when the statement is parsed, but to leave the value alone if the variable has a value. Here is an example:
A ?= "aval"
If A is set at the time this statement is parsed, the variable retains its value. However, if A is not set, the variable is set to "aval".
??= is:
It is possible to use a "weaker" assignment than in the previous section by using the "??=" operator. This assignment behaves identical to "?=" except that the assignment is made at the end of the parsing process rather than immediately. Consequently, when multiple "??=" assignments exist, the last one is used. Also, any "=" or "?=" assignment will override the value set with "??=". Here is an example:
A ??= "somevalue"
A ??= "someothervalue"
If A is set before the above statements are parsed, the variable
retains its value. If A is not set, the variable is set to
"someothervalue".
Again, this assignment is a "lazy" or "weak" assignment because it
does not occur until the end of the parsing process.
As per this section of Bitbake manual
?= is:
You can use the "?=" operator to achieve a "softer" assignment for a variable. This type of assignment allows you to define a variable if it is undefined when the statement is parsed, but to leave the value alone if the variable has a value. Here is an example:
A ?= "aval"
If A is set at the time this statement is parsed, the variable retains its value. However, if A is not set, the variable is set to "aval".
??= is:
It is possible to use a "weaker" assignment than in the previous section by using the "??=" operator. This assignment behaves identical to "?=" except that the assignment is made at the end of the parsing process rather than immediately. Consequently, when multiple "??=" assignments exist, the last one is used. Also, any "=" or "?=" assignment will override the value set with "??=". Here is an example:
A ??= "somevalue"
A ??= "someothervalue"
If A is set before the above statements are parsed, the variable
retains its value. If A is not set, the variable is set to
"someothervalue".
Again, this assignment is a "lazy" or "weak" assignment because it
does not occur until the end of the parsing process.
answered Jul 10 '15 at 11:35
Frankie_Fomalhaut
16616
16616
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f215044%2fmeaning-of-and-in-bitbake-yocto%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
That's not shell script, as far as I know, anyway. PHP?
â mikeserv
Jul 10 '15 at 8:59