Needing to pass PYTHON=python3 into hypervisor builds is irritating and
unnecessary. Locate a suitable interpreter automatically, defaulting to Py3
if it is available.
Reported-by: Steven Haigh <netwiz@crc.id.au>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
export XEN_BUILD_HOST ?= $(shell hostname)
export XEN_CONFIG_EXPERT ?= n
+# 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)
+export PYTHON ?= $(PYTHON_INTERPRETER)
+
export BASEDIR := $(CURDIR)
export XEN_ROOT := $(BASEDIR)/..