diff --git a/xen/Makefile b/xen/Makefile index dd0b004e1c..7ea13a6791 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -25,8 +25,8 @@ export XEN_BUILD_HOST := $(shell hostname) endif # 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) export PYTHON ?= $(PYTHON_INTERPRETER) export CHECKPOLICY ?= checkpolicy diff --git a/xen/build.mk b/xen/build.mk index 9ecb104f1e..b489f77b7c 100644 --- a/xen/build.mk +++ b/xen/build.mk @@ -1,6 +1,6 @@ quiet_cmd_banner = BANNER $@ define cmd_banner - if which figlet >/dev/null 2>&1 ; then \ + if command -v figlet >/dev/null 2>&1 ; then \ echo " Xen $(XEN_FULLVERSION)" | figlet -f $< > $@.tmp; \ else \ echo " Xen $(XEN_FULLVERSION)" > $@.tmp; \