diff mbox series

[2/3] ref-manual: Add RECIPE_SYSROOT and RECIPE_SYSROOT_NATIVE variables

Message ID 20231016215450.3090118-1-bhstalel@gmail.com
State New
Headers show
Series [1/3] ref-manual: Add example for SYSROOT_DIRS | expand

Commit Message

Talel BELHADJ SALEM Oct. 16, 2023, 9:54 p.m. UTC
Signed-off-by: Talel BELHAJSALEM <bhstalel@gmail.com>
---
 documentation/ref-manual/variables.rst | 40 +++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

Comments

Michael Opdenacker Oct. 19, 2023, 6:12 p.m. UTC | #1
Hi Talel

On 16.10.23 at 23:54, BELHADJ SALEM Talel wrote:
> Signed-off-by: Talel BELHAJSALEM <bhstalel@gmail.com>
> ---
>   documentation/ref-manual/variables.rst | 40 +++++++++++++++++++++++++-
>   1 file changed, 39 insertions(+), 1 deletion(-)
>
> diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
> index a6e550aa5..246584fc5 100644
> --- a/documentation/ref-manual/variables.rst
> +++ b/documentation/ref-manual/variables.rst
> @@ -6945,6 +6945,40 @@ system and gives an overview of their function and contents.
>         in the ":ref:`ref-manual/devtool-reference:checking on the upgrade status of a recipe`"
>         section.
>   
> +   :term:`RECIPE_SYSROOT`
> +      This variable points to the directory that holds all files populated from
> +      recipes specified in :term:`DEPENDS`. As the name indicates,
> +      think of this variable as a custom root ``/`` for the recipe that will be
> +      used by the compiler in order to find headers and other needs to complete
s/other needs/other files needed/
> +      its job.
> +
> +      The value of this variable will be affected to :term:`TOOLCHAIN_OPTIONS`

s/affected/set/

Here too, you need the 3rd patch to compile the second one. It seems you 
sent the patches in reverse order ;-)

> +      as::
> +

Caution: you have a line with unnecessary spaces it. Git warns about 
them, and my editor flags them too.

> +         TOOLCHAIN_OPTIONS = " --sysroot=${RECIPE_SYSROOT}"
> +
> +      This variable is related to :term:`STAGING_DIR_HOST` or :term:`STAGING_DIR_TARGET`
> +      according to the type of the recipe and the build target.
> +
> +      To understand more this variable, consider the following examples:

To understand this variable better

> +
> +      - For ``#include <header.h>``, ``header.h`` should be in ``"${RECIPE_SYSROOT}/usr/include"``
> +      - For ``-lexample``, ``libexample.so`` should be in ``"${RECIPE_SYSROOT}/lib"``
> +        or other library sysroot directories.

In our manuals, we usually add two spaces after "-" to introduce 
enumerations (see other files or standards.md)

> +
> +      The default value is ``"${WORKDIR}/recipe-sysroot"``.
> +      Do not change the default value.


Do not modify it.

> +
> +   :term:`RECIPE_SYSROOT_NATIVE`
> +      This is the same as :term:`RECIPE_SYSROOT` but the populated files are from


s/This is the same as/This is similar to/ (sounding better)

> +      ``-native`` recipes. This makes a recipe built for the target machine
> +      can use ``native`` tools.


This allows a recipe built for the target machine to use ``native`` tools?

> +
> +      This variable is related to :term:`STAGING_DIR_NATIVE`.
> +
> +      The default value is ``"${WORKDIR}/recipe-sysroot-native"``.
> +      Do not change the default value.


Do not modify it.
Thanks,
Michael.
diff mbox series

Patch

diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
index a6e550aa5..246584fc5 100644
--- a/documentation/ref-manual/variables.rst
+++ b/documentation/ref-manual/variables.rst
@@ -6945,6 +6945,40 @@  system and gives an overview of their function and contents.
       in the ":ref:`ref-manual/devtool-reference:checking on the upgrade status of a recipe`"
       section.
 
+   :term:`RECIPE_SYSROOT`
+      This variable points to the directory that holds all files populated from
+      recipes specified in :term:`DEPENDS`. As the name indicates,
+      think of this variable as a custom root ``/`` for the recipe that will be
+      used by the compiler in order to find headers and other needs to complete
+      its job.
+
+      The value of this variable will be affected to :term:`TOOLCHAIN_OPTIONS`
+      as::
+         
+         TOOLCHAIN_OPTIONS = " --sysroot=${RECIPE_SYSROOT}"
+
+      This variable is related to :term:`STAGING_DIR_HOST` or :term:`STAGING_DIR_TARGET`
+      according to the type of the recipe and the build target.
+
+      To understand more this variable, consider the following examples:
+
+      - For ``#include <header.h>``, ``header.h`` should be in ``"${RECIPE_SYSROOT}/usr/include"``
+      - For ``-lexample``, ``libexample.so`` should be in ``"${RECIPE_SYSROOT}/lib"``
+        or other library sysroot directories.
+
+      The default value is ``"${WORKDIR}/recipe-sysroot"``.
+      Do not change the default value.
+
+   :term:`RECIPE_SYSROOT_NATIVE`
+      This is the same as :term:`RECIPE_SYSROOT` but the populated files are from
+      ``-native`` recipes. This makes a recipe built for the target machine
+      can use ``native`` tools.
+
+      This variable is related to :term:`STAGING_DIR_NATIVE`.
+
+      The default value is ``"${WORKDIR}/recipe-sysroot-native"``.
+      Do not change the default value.
+
    :term:`REPODIR`
       See :term:`bitbake:REPODIR` in the BitBake manual.
 
@@ -8216,7 +8250,8 @@  system and gives an overview of their function and contents.
       the component is built to run (the system that hosts the component).
       For most recipes, this sysroot is the one in which that recipe's
       :ref:`ref-tasks-populate_sysroot` task copies
-      files. Exceptions include ``-native`` recipes, where the
+      files, check :term:`RECIPE_SYSROOT`.
+      Exceptions include ``-native`` recipes, where the
       :ref:`ref-tasks-populate_sysroot` task instead uses
       :term:`STAGING_DIR_NATIVE`. Depending on
       the type of recipe and the build target, :term:`STAGING_DIR_HOST` can
@@ -8253,6 +8288,9 @@  system and gives an overview of their function and contents.
       Specifies the path to the sysroot directory used when building
       components that run on the build host itself.
 
+      The default value is ``"${RECIPE_SYSROOT_NATIVE}"``,
+      check :term:`RECIPE_SYSROOT_NATIVE`
+
    :term:`STAGING_DIR_TARGET`
       Specifies the path to the sysroot used for the system for which the
       component generates code. For components that do not generate code,