diff mbox

[ovs-dev] m4: Add hard requirements for python in "configure"

Message ID 9da9d7d95574cc8df8018e09951064a88b36f7f1.1490788178.git.tredaelli@redhat.com
State Superseded
Headers show

Commit Message

Timothy Redaelli March 29, 2017, 11:49 a.m. UTC
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>
---
 m4/openvswitch.m4 | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index 0b2cc27..d41bffb 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -341,11 +341,13 @@  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
+      if test $ovs_cv_python = no; then
+        AC_MSG_ERROR([cannot find python 2.7 or higher.])
+      else
+        if test -x "$ovs_cv_python" && ! "$ovs_cv_python" -c 'import six ; six.moves.range' >/dev/null 2>&1; then
+          ovs_cv_python=no
+          AC_MSG_ERROR([Missing Python six library or version too old.])
         fi
       fi])
    AC_SUBST([HAVE_PYTHON])