From d621d1c362b71ce8107e03c79330a2a68318482a Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Wed, 10 Aug 2011 15:28:29 +0000 Subject: 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 --- autogen.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'autogen.sh') 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/.*) *//'` -- cgit v1.2.1