Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
INSTALL_PROGRAM := $(INSTALL) -p
# Best effort attempt to find a python interpreter, defaulting to Python 3 if
-# available. Fall back to just `python` if `which` is nowhere to be found.
-PYTHON_INTERPRETER := $(word 1,$(shell which python3 python python2 2>/dev/null) python)
+# available. Fall back to just `python`.
+PYTHON_INTERPRETER := $(word 1,$(shell command -v python3 || command -v python || command -v python2) python)
PYTHON ?= $(PYTHON_INTERPRETER)
export CC LD CPP INSTALL INSTALL_DATA INSTALL_DIR INSTALL_PROGRAM OBJCOPY PYTHON