[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging-4.13] xen/build: Automatically locate a suitable python interpreter



commit b0f0bbca95bd532212fb1956f3e23d1ab13a53cf
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Sat Dec 7 15:50:22 2019 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Tue Dec 10 17:23:47 2019 +0000

    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@xxxxxxxxx>
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: George Dunlap <george.dunlap@xxxxxxxxxx>
    Release-acked-by: Juergen Gross <jgross@xxxxxxxx>
---
 xen/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/Makefile b/xen/Makefile
index 805543790b..f67343a973 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -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)/..
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.