diff --git a/scripts/build/toolchain/termux_setup_toolchain_gnu.sh b/scripts/build/toolchain/termux_setup_toolchain_gnu.sh index a217ddffa9..e3e6fffadc 100644 --- a/scripts/build/toolchain/termux_setup_toolchain_gnu.sh +++ b/scripts/build/toolchain/termux_setup_toolchain_gnu.sh @@ -47,9 +47,12 @@ termux_setup_toolchain_gnu() { export PKG_CONFIG_LIBDIR="$TERMUX_PKG_CONFIG_LIBDIR" if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then - if ! $(echo "$PATH" | grep -q "^$TERMUX_STANDALONE_TOOLCHAIN/bin:$TERMUX_PREFIX/bin"); then - export PATH="$TERMUX_STANDALONE_TOOLCHAIN/bin:$TERMUX_PREFIX/bin:$PATH" + if ! $(echo "$PATH" | grep -q "^$TERMUX_STANDALONE_TOOLCHAIN/bin"); then + export PATH="$TERMUX_STANDALONE_TOOLCHAIN/bin:$PATH" fi + if ! $(echo "$PATH" | grep -q "$TERMUX_PREFIX/bin"); then + export PATH="$PATH:$TERMUX_PREFIX/bin" + fi fi export CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"