[U-Boot] [PATCH] Use bash for default GNU Make shell application

Some Make script commands rely on bash-specific features so default to bash for the SHELL variable with a fallback to the standard sh shell
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- Commands such as these from the top-level Makefile failed on my Ubuntu 7.04 system which has the sh shell as a symlink to /bin/dash: @rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}
Eugene O'Brien caught the same issue in this thread: http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/48047/focus=48048
Makefile | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile index d8b1f58..cf82551 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,12 @@ HOSTARCH := $(shell uname -m | \ HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \ sed -e 's/(cygwin).*/cygwin/')
-export HOSTARCH HOSTOS +# Set shell to bash if possible, otherwise fall back to sh +SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ + else if [ -x /bin/bash ]; then echo /bin/bash; \ + else echo sh; fi; fi) + +export HOSTARCH HOSTOS SHELL
# Deal with colliding definitions from tcsh etc. VENDOR=

Dear Peter Tyser,
In message 1226514800-2146-1-git-send-email-ptyser@xes-inc.com you wrote:
Some Make script commands rely on bash-specific features so default to bash for the SHELL variable with a fallback to the standard sh shell
Signed-off-by: Peter Tyser ptyser@xes-inc.com
Commands such as these from the top-level Makefile failed on my Ubuntu 7.04 system which has the sh shell as a symlink to /bin/dash: @rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}
Eugene O'Brien caught the same issue in this thread: http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/48047/focus=48048
Makefile | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
participants (2)
-
Peter Tyser
-
Wolfgang Denk