From 30d9a37339e44b3c683fbc7ef377be88c46b630b Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 22 Nov 2021 11:02:10 +0100 Subject: [PATCH] Define PYTHON in library/Makefile Copy the definition from tests/Makefile and programs/Makefile: default to `python3` on Unix-like platforms where `python3` exists and to `python` otherwise. This is necessary on Unix-like platforms where python3 doesn't exist and on Windows platforms where neither the shebang nor the extension works to run a Python script. Signed-off-by: Gilles Peskine --- library/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/Makefile b/library/Makefile index 6335dcc2bd..c4e722e35b 100644 --- a/library/Makefile +++ b/library/Makefile @@ -23,6 +23,11 @@ endif # CFLAGS += -D_BSD_EXTENSION PERL ?= perl +ifdef WINDOWS +PYTHON ?= python +else +PYTHON ?= $(shell if type python3 >/dev/null 2>/dev/null; then echo python3; else echo python; fi) +endif # if were running on Windows build for Windows ifdef WINDOWS