Unverified Commit 002621a4 authored by Jean Delvare's avatar Jean Delvare Committed by Nathan Chancellor
Browse files

kbuild: Let kernel-doc.py use PYTHON3 override



It is possible to force a specific version of python to be used when
building the kernel by passing PYTHON3= on the make command line.
However kernel-doc.py is currently called with python3 hard-coded and
thus ignores this setting.

Use $(PYTHON3) to run $(KERNELDOC) so that the desired version of
python is used.

Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
Reviewed-by: default avatarNicolas Schier <nsc@kernel.org>
Reviewed-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://patch.msgid.link/20251107192933.2bfe9e57@endymion


Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
parent 9818af18
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -245,7 +245,7 @@ always-$(CONFIG_DRM_HEADER_TEST) += \
quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
      cmd_hdrtest = \
		$(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
		 PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
		 PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
		touch $@

$(obj)/%.hdrtest: $(src)/%.h FORCE
+1 −1
Original line number Diff line number Diff line
@@ -413,7 +413,7 @@ obj-$(CONFIG_DRM_I915_GVT_KVMGT) += kvmgt.o
#
# Enable locally for CONFIG_DRM_I915_WERROR=y. See also scripts/Makefile.build
ifdef CONFIG_DRM_I915_WERROR
    cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none -Werror $<
    cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none -Werror $<
endif

# header test
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ always-$(CONFIG_DRM_HEADER_TEST) += \
quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
      cmd_hdrtest = \
		$(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
		PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
		PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
		touch $@

$(obj)/%.hdrtest: $(src)/%.h FORCE
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ else ifeq ($(KBUILD_CHECKSRC),2)
endif

ifneq ($(KBUILD_EXTRA_WARN),)
  cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(KDOCFLAGS) \
  cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(KDOCFLAGS) \
        $(if $(findstring 2, $(KBUILD_EXTRA_WARN)), -Wall) \
        $<
endif