From: Scott Rifenbark Date: Thu, 1 Sep 2016 21:01:21 +0000 (-0700) Subject: bitbake-user-manual: Added "Exporting Variables to the Environment" X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b543458dd67d24a228fa2db0ecb4ddd20016a560;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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. Signed-off-by: Scott Rifenbark --- diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml b/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml index 64f08157f66..d4f73ae1455 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml @@ -476,6 +476,53 @@ +
+ Exporting Variables to the Environment + + + You can export variables to the environment of running + tasks by using the export keyword. + For example, in the following example, the + do_foo task prints "value from + the environment" when run: + + export ENV_VARIABLE + ENV_VARIABLE = "value from the environment" + + do_foo() { + bbplain "$ENV_VARIABLE" + } + + + BitBake does not expand $ENV_VARIABLE + in this case because it lacks the obligatory + {}. + Rather, $ENV_VARIABLE is expanded + by the shell. + + It does not matter whether + export ENV_VARIABLE appears before or + after assignments to ENV_VARIABLE. + + + + It is also possible to combine export + with setting a value for the variable. + Here is an example: + + export ENV_VARIABLE = "variable-value" + + In the output of bitbake -e, variables + that are exported to the environment are preceded by "export". + + + + Among the variables commonly exported to the environment + are CC and CFLAGS, + which are picked up by many build systems. + +
+
Conditional Syntax (Overrides)