From 61ba78b16b459b3f5ae4abd926e7aa3e28acff54 Mon Sep 17 00:00:00 2001 From: Slavey Karadzhov Date: Wed, 23 Oct 2024 17:36:45 +0200 Subject: [PATCH] Add env var SMING_TOOLCHAINS to allow easier change of toolchains install path. --- Tools/export.sh | 11 +++++++---- docs/source/getting-started/config.rst | 8 ++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Tools/export.sh b/Tools/export.sh index 602bc4423a..42f0fcf79b 100755 --- a/Tools/export.sh +++ b/Tools/export.sh @@ -32,15 +32,18 @@ fi # Common export PYTHON=${PYTHON:=$(which python3)} +# Toolchain paths +export SMING_TOOLCHAINS=${ESP_HOME:=/opt} + # Esp8266 -export ESP_HOME=${ESP_HOME:=/opt/esp-quick-toolchain} +export ESP_HOME=${ESP_HOME:=$SMING_TOOLCHAINS/esp-quick-toolchain} # Esp32 -export IDF_PATH=${IDF_PATH:=/opt/esp-idf} -export IDF_TOOLS_PATH=${IDF_TOOLS_PATH:=/opt/esp32} +export IDF_PATH=${IDF_PATH:=$SMING_TOOLCHAINS/esp-idf} +export IDF_TOOLS_PATH=${IDF_TOOLS_PATH:=$SMING_TOOLCHAINS/esp32} # Rp2040 -export PICO_TOOLCHAIN_PATH=${PICO_TOOLCHAIN_PATH:=/opt/rp2040} +export PICO_TOOLCHAIN_PATH=${PICO_TOOLCHAIN_PATH:=$SMING_TOOLCHAINS/rp2040} # Provide non-apple CLANG (e.g. for rbpf library) if [ -n "$GITHUB_ACTIONS" ] && [ "$(uname)" = "Darwin" ]; then diff --git a/docs/source/getting-started/config.rst b/docs/source/getting-started/config.rst index 28b4089475..6e31560a05 100644 --- a/docs/source/getting-started/config.rst +++ b/docs/source/getting-started/config.rst @@ -15,6 +15,14 @@ For Linux and WSL2, append values to your ``~/.bashrc`` file:: # All architectures export SMING_HOME=/opt/sming/Sming + + +If you want to change the location where the toolchain will be downloaded and installed you can append the values below:: + + # Specifies a common toolchains directory + export SMING_TOOLCHAINS=/opt + +If you don't specify :envvar:`SMING_TOOLCHAINS` then you should set the path for the toolchains that you have installed. As given below:: # Esp8266 export ESP_HOME=/opt/esp-quick-toolchain