From bf16eb2c49bf516db37551d995f62ad8678c6616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Ram=C3=ADrez?= Date: Tue, 4 Jun 2024 15:04:45 +0200 Subject: [PATCH] [AutotoolsToolchain] Added [CC|CXX]_FOR_BUILD (#3750) * Added new env variables info * wip * Update reference/tools/gnu/autotoolstoolchain.rst --------- Co-authored-by: Carlos Zoido --- reference/tools/gnu/autotoolstoolchain.rst | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/reference/tools/gnu/autotoolstoolchain.rst b/reference/tools/gnu/autotoolstoolchain.rst index c77e95f39d6d..4d344084b28e 100644 --- a/reference/tools/gnu/autotoolstoolchain.rst +++ b/reference/tools/gnu/autotoolstoolchain.rst @@ -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 `__, +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`. + This generator will also generate a file called ``conanbuild.conf`` containing two keys: - **configure_args**: Arguments to call the ``configure`` script. @@ -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``. @@ -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.