mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
xen/build: Automatically locate a suitable python interpreter
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>
This commit is contained in:
1 parent
9fc7c88e62
commit
c8a8645f1e
1 file changed
+5
@@ -13,6 +13,11 @@ export XEN_BUILD_TIME ?= $(shell LC_ALL=C date +%T)
|
||||
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)/..
|
||||
|
||||
|
||||