configure: keep track of Python version

Some functionality is dependent on the Python version
detected/configured on configure. While it's possible to run the
Python version later and check for the version, doing it once is
preferable. Also, it's a relevant information to keep in build logs,
as the overall behavior of the build can be affected by it.

Backports commit 755ee70ff758584b8b6190b2cab4b480402af201 from qemu
This commit is contained in:
Cleber Rosa 2019-01-22 15:07:48 -05:00 committed by Lioncash
parent 24c56c65a3
commit 38ca341aeb
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7

6
qemu/configure vendored
View File

@ -583,6 +583,9 @@ if ! $python -c 'import sys; sys.exit(sys.version_info < (2,6))'; then
"Use --python=/path/to/python to specify a supported Python." "Use --python=/path/to/python to specify a supported Python."
fi fi
# Preserve python version since some functionality is dependent on it
python_version=$($python -V 2>&1 | sed -e 's/Python\ //')
# The -B switch was added in Python 2.6. # The -B switch was added in Python 2.6.
# If it is supplied, compiled files are not written. # If it is supplied, compiled files are not written.
# Use it for Python versions which support it. # Use it for Python versions which support it.
@ -1387,7 +1390,7 @@ echo "CFLAGS $CFLAGS"
echo "QEMU_CFLAGS $QEMU_CFLAGS" echo "QEMU_CFLAGS $QEMU_CFLAGS"
echo "LDFLAGS $LDFLAGS" echo "LDFLAGS $LDFLAGS"
echo "make $make" echo "make $make"
echo "python $python" echo "python $python ($python_version)"
echo "host CPU $cpu" echo "host CPU $cpu"
echo "host big endian $bigendian" echo "host big endian $bigendian"
echo "target list $target_list" echo "target list $target_list"
@ -1552,6 +1555,7 @@ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg $QEMU_INCLUDES"
echo "MAKE=$make" >> $config_host_mak echo "MAKE=$make" >> $config_host_mak
echo "PYTHON=$python" >> $config_host_mak echo "PYTHON=$python" >> $config_host_mak
echo "PYTHON_VERSION=$python_version" >> $config_host_mak
echo "CC=$cc" >> $config_host_mak echo "CC=$cc" >> $config_host_mak
echo "CC_I386=$cc_i386" >> $config_host_mak echo "CC_I386=$cc_i386" >> $config_host_mak
echo "HOST_CC=$host_cc" >> $config_host_mak echo "HOST_CC=$host_cc" >> $config_host_mak