Skip to contentSkip to conversation

rt-tests: makefile: undefine PYLIB if empty

PATCH New John Kacur 1 participant 1 message Oct 19, 2020 Kbuild

lore
Share & tools
lore

John Kacur

author
#0 lore raw

PATCH 1/1 rt-tests: makefile: undefine PYLIB if empty

The makefile will run a shell command to determine the location of the python libraries. If an error occurs, for example if the system doesn't have python installed on it, undefine PYLIB

This prevents undesired side effects such as installing man pages for utilities that will not be installed and does not interfere with other conditionals such as if test -n "${PYLIB]"

---
 Makefile | 5 +++++
 1 file changed, 5 insertions(+)
Makefile +5 -0
index 5f34075a4aa1..24895b7f9697 100644
@@ -35,6 +35,11 @@ LDFLAGS ?=
 
 PYLIB  ?= $(shell python3 -c 'import distutils.sysconfig;  print (distutils.sysconfig.get_python_lib())')
 
+# Check for errors, such as python3 not available
+ifeq (${PYLIB},)
+	undefine PYLIB
+endif
+
 MANPAGES = src/cyclictest/cyclictest.8 \
 	   src/pi_tests/pi_stress.8 \
 	   src/ptsematest/ptsematest.8 \
Signature · 1 line
2.26.2