Skip to content

Commit bf16eb2

Browse files
[AutotoolsToolchain] Added [CC|CXX]_FOR_BUILD (#3750)
* Added new env variables info * wip * Update reference/tools/gnu/autotoolstoolchain.rst --------- Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
1 parent 81c1fe0 commit bf16eb2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

reference/tools/gnu/autotoolstoolchain.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ corresponding build flags like ``-stdlib=libstdc++``, ``-std=gnu14``, architectu
5353
etc. It will also append the folder where the Conan generators are located to the
5454
``PKG_CONFIG_PATH`` environment variable.
5555

56+
Since `Conan 2.4.0 <https://github.com/conan-io/conan/releases/tag/2.4.0>`__,
57+
in a cross-building context, the environment variables ``CC_FOR_BUILD`` and ``CXX_FOR_BUILD`` are also set if the
58+
build profile defines the ``c`` and ``cpp`` values in the configuration variable ``tools.build:compiler_executables``.
59+
See more info in the :ref:`conf section<conan_tools_gnu_autotoolstoolchain_conf>`.
60+
5661
This generator will also generate a file called ``conanbuild.conf`` containing two keys:
5762

5863
- **configure_args**: Arguments to call the ``configure`` script.
@@ -241,12 +246,11 @@ Reference
241246
:members:
242247

243248

249+
.. _conan_tools_gnu_autotoolstoolchain_conf:
244250

245251
conf
246252
^^^^
247253

248-
.. _conan_tools_gnu_autotoolstoolchain_conf:
249-
250254
- ``tools.build:cxxflags`` list of extra C++ flags that will be used by ``CXXFLAGS``.
251255
- ``tools.build:cflags`` list of extra of pure C flags that will be used by ``CFLAGS``.
252256
- ``tools.build:sharedlinkflags`` list of extra linker flags that will be used by ``LDFLAGS``.
@@ -259,8 +263,9 @@ conf
259263
compiler as key and the compiler executable path as value. Those keys will be mapped as
260264
follows:
261265

262-
* ``c``: will set ``CC`` in *conanautotoolstoolchain.sh|bat* script.
263-
* ``cpp``: will set ``CXX`` in *conanautotoolstoolchain.sh|bat* script.
266+
* ``c``: will set ``CC`` (and ``CC_FOR_BUILD`` if cross-building) in *conanautotoolstoolchain.sh|bat* script.
267+
* ``cpp``: will set ``CXX`` (and ``CXX_FOR_BUILD`` if cross-building) in *conanautotoolstoolchain.sh|bat* script.
268+
* ``rc``: will set ``RC`` in *conanautotoolstoolchain.sh|bat* script.
264269
* ``cuda``: will set ``NVCC`` in *conanautotoolstoolchain.sh|bat* script.
265270
* ``fortran``: will set ``FC`` in *conanautotoolstoolchain.sh|bat* script.
266271

0 commit comments

Comments
 (0)