From 38ca341aeb4f6f06d4456a15af9507c125b8da0e Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Tue, 22 Jan 2019 15:07:48 -0500 Subject: [PATCH] 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 --- qemu/configure | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qemu/configure b/qemu/configure index d4d12f53..a798b241 100755 --- a/qemu/configure +++ b/qemu/configure @@ -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." 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. # If it is supplied, compiled files are not written. # Use it for Python versions which support it. @@ -1387,7 +1390,7 @@ echo "CFLAGS $CFLAGS" echo "QEMU_CFLAGS $QEMU_CFLAGS" echo "LDFLAGS $LDFLAGS" echo "make $make" -echo "python $python" +echo "python $python ($python_version)" echo "host CPU $cpu" echo "host big endian $bigendian" echo "target list $target_list" @@ -1552,6 +1555,7 @@ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg $QEMU_INCLUDES" echo "MAKE=$make" >> $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_I386=$cc_i386" >> $config_host_mak echo "HOST_CC=$host_cc" >> $config_host_mak