Makefile: try harder to use correct Python interpreter
In a Python 3-only system, there might not be an executable in the PATH to satisfy "python". In configure we attempt to find the "right" python command for the system we happen to be running in. With this patch, we let configure save this command to a temporary file. Subsequently, when make is run, it will find the command in that file and use it (or fall back to "python" if the file doesn't exist for whatever reason). Change-Id: If65f2fc505a924b940b2054882504b8cbe1a53aa Signed-off-by: Nathan Cutler <ncutler@suse.com> Reviewed-on: https://review.gerrithub.io/397022 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
efb18b9b46
commit
dc82989dd2
1
.gitignore
vendored
1
.gitignore
vendored
@ -26,3 +26,4 @@ CONFIG.local
|
||||
.cproject
|
||||
.settings
|
||||
mk/cc.mk
|
||||
PYTHON_COMMAND
|
||||
|
4
Makefile
4
Makefile
@ -68,7 +68,9 @@ mk/cc.mk:
|
||||
rm -f $@.tmp
|
||||
|
||||
config.h: CONFIG CONFIG.local scripts/genconfig.py
|
||||
$(Q)python scripts/genconfig.py $(MAKEFLAGS) > $@.tmp; \
|
||||
$(Q)PYCMD=$$(cat PYTHON_COMMAND 2>/dev/null) ; \
|
||||
test -z "$$PYCMD" && PYCMD=python ; \
|
||||
$$PYCMD scripts/genconfig.py $(MAKEFLAGS) > $@.tmp; \
|
||||
cmp -s $@.tmp $@ || mv $@.tmp $@ ; \
|
||||
rm -f $@.tmp
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user