[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 19/19] configure: automatically pick python3 is avail
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL 19/19] configure: automatically pick python3 is available |
Date: |
Thu, 2 May 2019 21:41:30 -0300 |
From: Daniel P. Berrangé <address@hidden>
Unless overridden via an env var or configure arg, QEMU will only look
for the 'python' binary in $PATH. This is unhelpful on distros which
are only shipping Python 3.x (eg Fedora) in their default install as,
if they comply with PEP 394, the bare 'python' binary won't exist.
This changes configure so that by default it will search for all three
common python binaries, preferring to find Python 3.x versions.
Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
configure | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 60719ddcc5..f88011b94d 100755
--- a/configure
+++ b/configure
@@ -899,7 +899,18 @@ fi
: ${make=${MAKE-make}}
: ${install=${INSTALL-install}}
-: ${python=${PYTHON-python}}
+# We prefer python 3.x. A bare 'python' is traditionally
+# python 2.x, but some distros have it as python 3.x, so
+# we check that before python2
+python=
+for binary in "${PYTHON-python3}" python python2
+do
+ if has "$binary"
+ then
+ python="$binary"
+ break
+ fi
+done
: ${smbd=${SMBD-/usr/sbin/smbd}}
# Default objcc to clang if available, otherwise use CC
@@ -1818,8 +1829,9 @@ EOF
exit 0
fi
-if ! has $python; then
- error_exit "Python not found. Use --python=/path/to/python"
+if test -z "$python"
+then
+ error_exit "Python not found. Use --python=/path/to/python"
fi
# Note that if the Python conditional here evaluates True we will exit
--
2.18.0.rc1.1.g3f1ff2140
- Re: [Qemu-devel] [PULL 10/19] tests/boot_linux_console: increase timeout, (continued)
[Qemu-devel] [PULL 11/19] tests/boot_linux_console: refactor the console watcher into utility method, Eduardo Habkost, 2019/05/02
[Qemu-devel] [PULL 12/19] scripts/qemu.py: support adding a console with the default serial device, Eduardo Habkost, 2019/05/02
[Qemu-devel] [PULL 13/19] tests/boot_linux_console: add a test for mips + malta, Eduardo Habkost, 2019/05/02
[Qemu-devel] [PULL 15/19] tests/boot_linux_console: add a test for aarch64 + virt, Eduardo Habkost, 2019/05/02
[Qemu-devel] [PULL 14/19] tests/boot_linux_console: add a test for mips64el + malta, Eduardo Habkost, 2019/05/02
[Qemu-devel] [PULL 18/19] tests/boot_linux_console: add a test for alpha + clipper, Eduardo Habkost, 2019/05/02
[Qemu-devel] [PULL 16/19] tests/boot_linux_console: add a test for arm + virt, Eduardo Habkost, 2019/05/02
[Qemu-devel] [PULL 17/19] tests/boot_linux_console: add a test for s390x + s390-ccw-virtio, Eduardo Habkost, 2019/05/02
[Qemu-devel] [PULL 19/19] configure: automatically pick python3 is available,
Eduardo Habkost <=
Re: [Qemu-devel] [PULL 19/19] configure: automatically pick python3 is available, Eduardo Habkost, 2019/05/03
Re: [Qemu-devel] [PULL 19/19] configure: automatically pick python3 is available, Eduardo Habkost, 2019/05/03
Re: [Qemu-devel] [PULL 19/19] configure: automatically pick python3 is available, Thomas Huth, 2019/05/04
Re: [Qemu-devel] [PULL 00/19] Python queue, 2019-05-02, Peter Maydell, 2019/05/03