Skip to content

Commit 011bf12

Browse files
masahir0ymichal42
authored andcommitted
kbuild: allow to override Python command name
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 <[email protected]> Cc: [email protected] Signed-off-by: Michal Marek <[email protected]>
1 parent 1791ff7 commit 011bf12

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ GENKSYMS = scripts/genksyms/genksyms
366366
INSTALLKERNEL := installkernel
367367
DEPMOD = /sbin/depmod
368368
PERL = perl
369+
PYTHON = python
369370
CHECK = sparse
370371

371372
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
@@ -416,7 +417,7 @@ KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(S
416417
export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
417418
export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
418419
export CPP AR NM STRIP OBJCOPY OBJDUMP
419-
export MAKE AWK GENKSYMS INSTALLKERNEL PERL UTS_MACHINE
420+
export MAKE AWK GENKSYMS INSTALLKERNEL PERL PYTHON UTS_MACHINE
420421
export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
421422

422423
export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS

arch/ia64/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ vmlinux.gz: vmlinux
7676
$(Q)$(MAKE) $(build)=$(boot) $@
7777

7878
unwcheck: vmlinux
79-
-$(Q)READELF=$(READELF) python $(srctree)/arch/ia64/scripts/unwcheck.py $<
79+
-$(Q)READELF=$(READELF) $(PYTHON) $(srctree)/arch/ia64/scripts/unwcheck.py $<
8080

8181
archclean:
8282
$(Q)$(MAKE) $(clean)=$(boot)

0 commit comments

Comments
 (0)