Skip to content

Commit

Permalink
[AutotoolsToolchain] Added [CC|CXX]_FOR_BUILD (#3750)
Browse files Browse the repository at this point in the history
* Added new env variables info

* wip

* Update reference/tools/gnu/autotoolstoolchain.rst

---------

Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
  • Loading branch information
franramirez688 and czoido authored Jun 4, 2024
1 parent 81c1fe0 commit bf16eb2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions reference/tools/gnu/autotoolstoolchain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ corresponding build flags like ``-stdlib=libstdc++``, ``-std=gnu14``, architectu
etc. It will also append the folder where the Conan generators are located to the
``PKG_CONFIG_PATH`` environment variable.

Since `Conan 2.4.0 <https://github.com/conan-io/conan/releases/tag/2.4.0>`__,
in a cross-building context, the environment variables ``CC_FOR_BUILD`` and ``CXX_FOR_BUILD`` are also set if the
build profile defines the ``c`` and ``cpp`` values in the configuration variable ``tools.build:compiler_executables``.
See more info in the :ref:`conf section<conan_tools_gnu_autotoolstoolchain_conf>`.

This generator will also generate a file called ``conanbuild.conf`` containing two keys:

- **configure_args**: Arguments to call the ``configure`` script.
Expand Down Expand Up @@ -241,12 +246,11 @@ Reference
:members:


.. _conan_tools_gnu_autotoolstoolchain_conf:

conf
^^^^

.. _conan_tools_gnu_autotoolstoolchain_conf:

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

* ``c``: will set ``CC`` in *conanautotoolstoolchain.sh|bat* script.
* ``cpp``: will set ``CXX`` in *conanautotoolstoolchain.sh|bat* script.
* ``c``: will set ``CC`` (and ``CC_FOR_BUILD`` if cross-building) in *conanautotoolstoolchain.sh|bat* script.
* ``cpp``: will set ``CXX`` (and ``CXX_FOR_BUILD`` if cross-building) in *conanautotoolstoolchain.sh|bat* script.
* ``rc``: will set ``RC`` in *conanautotoolstoolchain.sh|bat* script.
* ``cuda``: will set ``NVCC`` in *conanautotoolstoolchain.sh|bat* script.
* ``fortran``: will set ``FC`` in *conanautotoolstoolchain.sh|bat* script.

Expand Down

0 comments on commit bf16eb2

Please sign in to comment.