summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorTimothy Redaelli <tredaelli@redhat.com>2017-03-29 13:49:42 +0200
committerBen Pfaff <blp@ovn.org>2017-04-06 17:38:22 -0700
commit7777d53d2f4b84cc77868f2a55d66417fe6058d0 (patch)
tree8b6a198945f04b4ed3bd271c164ec599721d0b6a /m4
parentbfee85bca70489b35b837d22f260634e392977bb (diff)
downloadopenvswitch-7777d53d2f4b84cc77868f2a55d66417fe6058d0.tar.gz
m4: Add hard requirements for python in "configure"
Since Python 2.7 and python-six are needed to build Open vSwitch, ./configure should return an error if they are missing or if they are too old Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Tested-by: Timothy Redaelli <tredaelli@redhat.com> Tested-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-April/330565.html
Diffstat (limited to 'm4')
-rw-r--r--m4/openvswitch.m430
1 files changed, 17 insertions, 13 deletions
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index 0b2cc27e0..cbfd7554d 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -341,22 +341,26 @@ else:
fi
done
done
- if test $ovs_cv_python != no; then
- if test -x "$ovs_cv_python" && ! "$ovs_cv_python" -c 'import six' >/dev/null 2>&1; then
- ovs_cv_python=no
- AC_MSG_WARN([Missing Python six library.])
- fi
- fi
fi])
- AC_SUBST([HAVE_PYTHON])
+
+ # Set $PYTHON from cache variable.
+ if test $ovs_cv_python = no; then
+ AC_MSG_ERROR([cannot find python 2.7 or higher.])
+ fi
AM_MISSING_PROG([PYTHON], [python])
- if test $ovs_cv_python != no; then
- PYTHON=$ovs_cv_python
- HAVE_PYTHON=yes
- else
- HAVE_PYTHON=no
+ PYTHON=$ovs_cv_python
+
+ # HAVE_PYTHON is always true. (Python has not always been a build
+ # requirement, so this variable is now obsolete.)
+ AC_SUBST([HAVE_PYTHON])
+ HAVE_PYTHON=yes
+ AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON" = yes])
+
+ AC_MSG_CHECKING([whether $PYTHON has six library])
+ if ! $PYTHON -c 'import six ; six.moves.range' >AS_MESSAGE_LOG_FD 2>&1; then
+ AC_MSG_ERROR([Missing Python six library or version too old.])
fi
- AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON" = yes])])
+ AC_MSG_RESULT([yes])])
dnl Checks for Python 3.x, x >= 4.
AC_DEFUN([OVS_CHECK_PYTHON3],