]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kbuild: Let kernel-doc.py use PYTHON3 override
authorJean Delvare <jdelvare@suse.de>
Fri, 7 Nov 2025 18:29:33 +0000 (19:29 +0100)
committerNathan Chancellor <nathan@kernel.org>
Sun, 9 Nov 2025 02:42:22 +0000 (19:42 -0700)
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: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://patch.msgid.link/20251107192933.2bfe9e57@endymion
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
drivers/gpu/drm/Makefile
drivers/gpu/drm/i915/Makefile
include/drm/Makefile
scripts/Makefile.build

index 4b2f7d794275271e7f400dd9300402d9394f20ae..da2565e6de71d8a6332469bc1296f966dfe55ae5 100644 (file)
@@ -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
index e58c0c158b3ab2e362e68b0b41f649a4087d2f54..b91575380708651994a0918c33dec0694f1c202c 100644 (file)
@@ -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
index 1df6962556efc2c088bf5980ddb0822145b86067..48fae3f167c7e67a0675e9fd08175fff9ff82540 100644 (file)
@@ -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
index d0ee33a487be95f8ba9a5c964ebecfbebc6c4bf8..52c08c4eb0b9af0af0e9d9853997357be7997f3a 100644 (file)
@@ -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