]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Use bash for default GNU Make shell application
authorPeter Tyser <ptyser@xes-inc.com>
Wed, 12 Nov 2008 18:33:20 +0000 (12:33 -0600)
committerWolfgang Denk <wd@denx.de>
Mon, 8 Dec 2008 22:11:15 +0000 (23:11 +0100)
Some Make script commands rely on bash-specific features like brace
expansion, 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>
Makefile

index 11fc3b76a467204ab1800d46f240425cf1addd01..913fd16e1167995f0915d48cd5ebe591d45f9d75 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,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=