aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-05-03 15:26:09 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-05-03 15:26:09 +0100
commita6ae23831b05a11880b40f7d58e332c45a6b04f7 (patch)
tree0a0d5fcfce8f01f9891b700d70cf239b7aabc04c /configure
parent5b396a8c36f490cbc93fa1aa91cea4a03b94de54 (diff)
parentfaf441429adfe5767be52c5dcdb8bc03161d064f (diff)
Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request' into staging
Python queue, 2019-05-02 * configure: automatically pick python3 is available (Daniel P. Berrangé) * tests/acceptance (Cleber Rosa, Philippe Mathieu-Daudé): * Multi-architecture test support * Multiple arch-specific boot_linux_console test cases * Increase verbosity of avocado by default * docstring improvements # gpg: Signature made Fri 03 May 2019 01:40:06 BST # gpg: using RSA key 2807936F984DC5A6 # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/python-next-pull-request: configure: automatically pick python3 is available tests/boot_linux_console: add a test for alpha + clipper tests/boot_linux_console: add a test for s390x + s390-ccw-virtio tests/boot_linux_console: add a test for arm + virt tests/boot_linux_console: add a test for aarch64 + virt tests/boot_linux_console: add a test for mips64el + malta tests/boot_linux_console: add a test for mips + malta scripts/qemu.py: support adding a console with the default serial device tests/boot_linux_console: refactor the console watcher into utility method tests/boot_linux_console: increase timeout tests/boot_linux_console: add common kernel command line options tests/boot_linux_console: update the x86_64 kernel tests/boot_linux_console: rename the x86_64 after the arch and machine tests/acceptance: look for target architecture in test tags first tests/acceptance: use "arch:" tag to filter target specific tests tests/acceptance: introduce arch parameter and attribute tests/acceptance: fix doc reference to avocado_qemu directory tests/acceptance: improve docstring on pick_default_qemu_bin() tests/acceptance: show avocado test execution by default Signed-off-by: Peter Maydell <peter.maydell@linaro.org> # Conflicts: # configure
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 15 insertions, 3 deletions
diff --git a/configure b/configure
index c1e07a97c5..5b183c2e39 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
@@ -1823,8 +1834,9 @@ fi
# Remove old dependency files to make sure that they get properly regenerated
rm -f *-config-devices.mak.d
-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