This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 81c5138d596c27aa9a376c80698cfd1bcaab422e
Author: Marco Casaroli <[email protected]>
AuthorDate: Fri Nov 13 14:09:31 2026 +0100

    tools/Config.mk: Look for bash once per build.
    
    Config.mk ran "command -v bash" in every make process that parses it,
    about 170 times in one qemu-armv8a:nsh build, always with the same result.
    Run it only when BASHCMD is not defined yet and export it, so sub-makes
    take it from the environment, as DEFINE_PREFIX and INCDIR_PREFIX already do.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 tools/Config.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/Config.mk b/tools/Config.mk
index 0770baf8199..5ca7ea636bd 100644
--- a/tools/Config.mk
+++ b/tools/Config.mk
@@ -41,7 +41,12 @@ endif
 ifeq ($(CONFIG_WINDOWS_NATIVE),y)
   export SHELL=cmd
 else
-  BASHCMD := $(shell command -v bash 2> /dev/null)
+  # Look for bash once; sub-makes get BASHCMD from the environment.
+
+  ifeq ($(origin BASHCMD),undefined)
+    BASHCMD := $(shell command -v bash 2> /dev/null)
+    export BASHCMD
+  endif
   ifneq ($(BASHCMD),)
     export SHELL=$(BASHCMD)
     ifeq ($(V),)

Reply via email to