All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rt-tests: makefile: undefine PYLIB if empty
@ 2020-10-19 19:37 John Kacur
  0 siblings, 0 replies; only message in thread
From: John Kacur @ 2020-10-19 19:37 UTC (permalink / raw)
  To: RT; +Cc: Anders Roxell, Clark Williams, John Kacur

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]"

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Makefile b/Makefile
index 5f34075a4aa1..24895b7f9697 100644
--- a/Makefile
+++ b/Makefile
@@ -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 \
-- 
2.26.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-19 19:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19 19:37 [PATCH] rt-tests: makefile: undefine PYLIB if empty John Kacur

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.