diff mbox

[v2] kbuild: make KBUILD_SHELL overridable and document it

Message ID 1402396043-31532-1-git-send-email-yamada.m@jp.panasonic.com (mailing list archive)
State New, archived
Headers show

Commit Message

Masahiro Yamada June 10, 2014, 10:27 a.m. UTC
It seems reasonable enough to allow users to change KBUILD_SHELL from
environments. Also describe it in Documentation/kbuild/kbuild.txt.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Michal Marek <mmarek@suse.cz>
---

Changes in v2:
  - set KBUILD_SHELL by "?="

 Documentation/kbuild/kbuild.txt | 5 +++++
 Makefile                        | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

Michal Marek June 10, 2014, 11:26 a.m. UTC | #1
On 2014-06-10 12:27, Masahiro Yamada wrote:
> It seems reasonable enough to allow users to change KBUILD_SHELL from
> environments. Also describe it in Documentation/kbuild/kbuild.txt.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Michal Marek <mmarek@suse.cz>
> ---
> 
> Changes in v2:
>   - set KBUILD_SHELL by "?="

Um, that's not really what I meant. That the variable cannot be changed
from the environment is a good thing, in my opinion. One can override it
to test if the scripts are compatible with e.g. dash, but it's unlikely
to be used for some other reason by regular users or kernel developers.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt
index 6466704..425cd2e 100644
--- a/Documentation/kbuild/kbuild.txt
+++ b/Documentation/kbuild/kbuild.txt
@@ -233,3 +233,8 @@  KBUILD_VMLINUX_MAIN
 All object files for the main part of vmlinux.
 KBUILD_VMLINUX_INIT and KBUILD_VMLINUX_MAIN together specify
 all the object files used to link vmlinux.
+
+KBUILD_SHELL
+--------------------------------------------------
+Specify which shell to use to run shell scripts in Kbuild.
+Assigned by the top-level Makefile.
diff --git a/Makefile b/Makefile
index f691dc2..079f663 100644
--- a/Makefile
+++ b/Makefile
@@ -235,7 +235,7 @@  KCONFIG_CONFIG	?= .config
 export KCONFIG_CONFIG
 
 # SHELL used by kbuild
-KBUILD_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+KBUILD_SHELL ?= $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
 	  else if [ -x /bin/bash ]; then echo /bin/bash; \
 	  else echo sh; fi ; fi)