[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH for 1.7 v2] configure: Use -B switch only for Pyth
From: |
Stefan Weil |
Subject: |
[Qemu-trivial] [PATCH for 1.7 v2] configure: Use -B switch only for Python versions which support it |
Date: |
Sat, 16 Nov 2013 14:21:42 +0100 |
Commit 1d984a67a95d88f3e708b077dab8adeb47c38c93 added the -B switch
unconditionally. This breaks Python versions before 2.6 which don't
support that switch.
Now configure adds -B only if it is accepted by the Python interpreter.
This modification introduces a small incompatibility because -B might now
also be added when configure was called with --python=PYTHON_INTERPRETER.
Signed-off-by: Stefan Weil <address@hidden>
---
v2: Fix assignment (python= instead of $python=)
configure | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 9a02610..508f6a5 100755
--- a/configure
+++ b/configure
@@ -593,7 +593,7 @@ fi
: ${make=${MAKE-make}}
: ${install=${INSTALL-install}}
-: ${python=${PYTHON-python -B}}
+: ${python=${PYTHON-python}}
: ${smbd=${SMBD-/usr/sbin/smbd}}
# Default objcc to clang if available, otherwise use CC
@@ -1420,6 +1420,13 @@ if ! $python -c 'import sys; sys.exit(sys.version_info <
(2,4) or sys.version_in
"Use --python=/path/to/python to specify a supported Python."
fi
+# 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.
+if $python -B -c 'import sys; sys.exit(0)' 2>/dev/null; then
+ python="$python -B"
+fi
+
if test -z "${target_list+xxx}" ; then
target_list="$default_target_list"
else
--
1.7.10.4
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-trivial] [PATCH for 1.7 v2] configure: Use -B switch only for Python versions which support it,
Stefan Weil <=