aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2011-08-10 15:28:29 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2011-08-10 15:28:29 +0000
commitd621d1c362b71ce8107e03c79330a2a68318482a (patch)
treec7f573decf8fc824f4e3cb2efea90f893ecbfce3
parent63f2fc0087256ba0f767ac3a5faa196abb1f8953 (diff)
Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5737 :
Python does have a way to check its version: -V (in all versions) and --version (in 2.5 and higher). Use the former, at least until we require a version greater than 2.5. This will make it easier in the future if we need to check the Python version before continuing (I could not find a minimum version that we need). svn path=/trunk/; revision=38447
-rwxr-xr-xautogen.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/autogen.sh b/autogen.sh
index e6884fba6e..5d45e447f6 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -17,9 +17,13 @@ AUTOHEADER=autoheader
AUTOMAKE=automake$AM_VERSION
AUTOCONF=autoconf
-# Check for python. There's no "--version" option!
-python -c "print 'Checking for python.'"
-if [ $? != 0 ] ; then
+# Check for python. Python did not support --version before version 2.5.
+# Until we require a version > 2.5, we should use -V.
+PYVER=`python -V 2>&1 | sed 's/Python *//'`
+case "$PYVER" in
+2*|3*)
+ ;;
+*)
cat >&2 <<_EOF_
You must have Python in order to compile $PROJECT.
@@ -27,7 +31,7 @@ if [ $? != 0 ] ; then
or get the source tarball at http://www.python.org/
_EOF_
DIE="exit 1"
-fi
+esac
ACVER=`$AUTOCONF --version | grep '^autoconf' | sed 's/.*) *//'`