Skip to content

Commit 66a258b

Browse files
authored
Add env var SMING_TOOLCHAINS to allow easier change of toolchains installation folder (#2894)
1 parent 2c08c85 commit 66a258b

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

Tools/export.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,18 @@ fi
3838

3939
export PYTHON=${PYTHON:=$(which python3)}
4040

41+
# Toolchain paths
42+
export SMING_TOOLCHAINS=${SMING_TOOLCHAINS:=/opt}
43+
4144
# Esp8266
42-
export ESP_HOME=${ESP_HOME:=/opt/esp-quick-toolchain}
45+
export ESP_HOME=${ESP_HOME:=$SMING_TOOLCHAINS/esp-quick-toolchain}
4346

4447
# Esp32
45-
export IDF_PATH=${IDF_PATH:=/opt/esp-idf}
46-
export IDF_TOOLS_PATH=${IDF_TOOLS_PATH:=/opt/esp32}
48+
export IDF_PATH=${IDF_PATH:=$SMING_TOOLCHAINS/esp-idf}
49+
export IDF_TOOLS_PATH=${IDF_TOOLS_PATH:=$SMING_TOOLCHAINS/esp32}
4750

4851
# Rp2040
49-
export PICO_TOOLCHAIN_PATH=${PICO_TOOLCHAIN_PATH:=/opt/rp2040}
52+
export PICO_TOOLCHAIN_PATH=${PICO_TOOLCHAIN_PATH:=$SMING_TOOLCHAINS/rp2040}
5053

5154
# Provide non-apple CLANG (e.g. for rbpf library)
5255
if [ -n "$GITHUB_ACTIONS" ] && [ "$(uname)" = "Darwin" ]; then

docs/source/getting-started/config.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,21 @@ and integrated development environments (IDEs) work correctly.
1111

1212
You can find a list of these in :source:`Tools/export.sh`.
1313

14-
For Linux and WSL2, append values to your ``~/.bashrc`` file::
14+
For Linux and WSL2, append :envvar:`SMING_HOME` to your ``~/.bashrc`` file::
1515

1616
# All architectures
1717
export SMING_HOME=/opt/sming/Sming
18-
18+
19+
:envvar:`SMING_HOME` is the only mandatory environmental variable.
20+
21+
If you want to change the location where the toolchain will be downloaded and installed you can append the values below::
22+
23+
# Specifies a common toolchains directory
24+
export SMING_TOOLCHAINS=/opt
25+
26+
The :envvar:`SMING_TOOLCHAINS` is optional. As are the ones below. You can append them to your ``~/.bashrc`` file only
27+
if you need to change the location of the installed toolchains::
28+
1929
# Esp8266
2030
export ESP_HOME=/opt/esp-quick-toolchain
2131

0 commit comments

Comments
 (0)