diff options
author | Scott Rifenbark <srifenbark@gmail.com> | 2016-09-01 14:01:21 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-02 16:29:52 +0100 |
commit | 2f33bb30c705f1870a2e1d6de73e291250ad660d (patch) | |
tree | 8320ef78fe026e9a8e71a603fca3836abb089cc6 /bitbake | |
parent | 9b20975fc27ff6bc45c90e7aa8bbf67562450d6f (diff) | |
download | poky-2f33bb30c705f1870a2e1d6de73e291250ad660d.tar.gz |
bitbake: bitbake-user-manual: Added "Exporting Variables to the Environment"
Fixes [YOCTO #10196]
Added a new section named "Exporting Variables to the Environment".
This section provides a dedicated description for how to export
variables to the shell.
(Bitbake rev: b543458dd67d24a228fa2db0ecb4ddd20016a560)
Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml index 64f08157f6..d4f73ae145 100644 --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml | |||
@@ -476,6 +476,53 @@ | |||
476 | </section> | 476 | </section> |
477 | </section> | 477 | </section> |
478 | 478 | ||
479 | <section id='exporting-variables-to-the-environment'> | ||
480 | <title>Exporting Variables to the Environment</title> | ||
481 | |||
482 | <para> | ||
483 | You can export variables to the environment of running | ||
484 | tasks by using the <filename>export</filename> keyword. | ||
485 | For example, in the following example, the | ||
486 | <filename>do_foo</filename> task prints "value from | ||
487 | the environment" when run: | ||
488 | <literallayout class='monospaced'> | ||
489 | export ENV_VARIABLE | ||
490 | ENV_VARIABLE = "value from the environment" | ||
491 | |||
492 | do_foo() { | ||
493 | bbplain "$ENV_VARIABLE" | ||
494 | } | ||
495 | </literallayout> | ||
496 | <note> | ||
497 | BitBake does not expand <filename>$ENV_VARIABLE</filename> | ||
498 | in this case because it lacks the obligatory | ||
499 | <filename>{}</filename>. | ||
500 | Rather, <filename>$ENV_VARIABLE</filename> is expanded | ||
501 | by the shell. | ||
502 | </note> | ||
503 | It does not matter whether | ||
504 | <filename>export ENV_VARIABLE</filename> appears before or | ||
505 | after assignments to <filename>ENV_VARIABLE</filename>. | ||
506 | </para> | ||
507 | |||
508 | <para> | ||
509 | It is also possible to combine <filename>export</filename> | ||
510 | with setting a value for the variable. | ||
511 | Here is an example: | ||
512 | <literallayout class='monospaced'> | ||
513 | export ENV_VARIABLE = "<replaceable>variable-value</replaceable>" | ||
514 | </literallayout> | ||
515 | In the output of <filename>bitbake -e</filename>, variables | ||
516 | that are exported to the environment are preceded by "export". | ||
517 | </para> | ||
518 | |||
519 | <para> | ||
520 | Among the variables commonly exported to the environment | ||
521 | are <filename>CC</filename> and <filename>CFLAGS</filename>, | ||
522 | which are picked up by many build systems. | ||
523 | </para> | ||
524 | </section> | ||
525 | |||
479 | <section id='conditional-syntax-overrides'> | 526 | <section id='conditional-syntax-overrides'> |
480 | <title>Conditional Syntax (Overrides)</title> | 527 | <title>Conditional Syntax (Overrides)</title> |
481 | 528 | ||