public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: allow to override Python command name
@ 2014-07-18  4:40 Masahiro Yamada
  2014-07-18  8:24 ` Michal Marek
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2014-07-18  4:40 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Masahiro Yamada, linux-ia64, Michal Marek, Tony Luck, Fenghua Yu,
	linux-kernel

The specification of Python 3 is largely different from that of
Python 2.

For example, arch/ia64/scripts/unwcheck.py seems to be written
in Python 2, not compatible with Python 3.

It is not a good idea to invoke python scripts with the hard-coded
command name 'python'. The command 'python' could possibly be
Python 3 on some systems.
For that case, it is reasonable to allow to override the command name
by giving 'PYTHON=python2' from the command line.

The 'python' in arch/ia64/Makefile should be replaced with '$(PYTHON)'.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: linux-ia64@vger.kernel.org
---

 Makefile           | 3 ++-
 arch/ia64/Makefile | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index f3c543d..7f5f301 100644
--- a/Makefile
+++ b/Makefile
@@ -372,6 +372,7 @@ GENKSYMS	= scripts/genksyms/genksyms
 INSTALLKERNEL  := installkernel
 DEPMOD		= /sbin/depmod
 PERL		= perl
+PYTHON		= python
 CHECK		= sparse
 
 CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
@@ -422,7 +423,7 @@ KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(S
 export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
 export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
 export CPP AR NM STRIP OBJCOPY OBJDUMP
-export MAKE AWK GENKSYMS INSTALLKERNEL PERL UTS_MACHINE
+export MAKE AWK GENKSYMS INSTALLKERNEL PERL PYTHON UTS_MACHINE
 export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
 
 export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
index f37238f..5441b14 100644
--- a/arch/ia64/Makefile
+++ b/arch/ia64/Makefile
@@ -76,7 +76,7 @@ vmlinux.gz: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) $@
 
 unwcheck: vmlinux
-	-$(Q)READELF=$(READELF) python $(srctree)/arch/ia64/scripts/unwcheck.py $<
+	-$(Q)READELF=$(READELF) $(PYTHON) $(srctree)/arch/ia64/scripts/unwcheck.py $<
 
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kbuild: allow to override Python command name
  2014-07-18  4:40 [PATCH] kbuild: allow to override Python command name Masahiro Yamada
@ 2014-07-18  8:24 ` Michal Marek
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Marek @ 2014-07-18  8:24 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild
  Cc: linux-ia64, Tony Luck, Fenghua Yu, linux-kernel

Dne 18.7.2014 06:40, Masahiro Yamada napsal(a):
> The specification of Python 3 is largely different from that of
> Python 2.
> 
> For example, arch/ia64/scripts/unwcheck.py seems to be written
> in Python 2, not compatible with Python 3.
> 
> It is not a good idea to invoke python scripts with the hard-coded
> command name 'python'. The command 'python' could possibly be
> Python 3 on some systems.
> For that case, it is reasonable to allow to override the command name
> by giving 'PYTHON=python2' from the command line.
> 
> The 'python' in arch/ia64/Makefile should be replaced with '$(PYTHON)'.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: linux-ia64@vger.kernel.org

Thanks, applied to kbuild.git#kbuild.

Michal


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-18  8:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-18  4:40 [PATCH] kbuild: allow to override Python command name Masahiro Yamada
2014-07-18  8:24 ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox