[ovs-dev] [PATCH ovn v3 1/3] configure: Check for correct ddlog version.

Ben Pfaff blp at ovn.org
Mon May 24 17:33:17 UTC 2021


Signed-off-by: Ben Pfaff <blp at ovn.org>
Suggested-by: Mark Michelson <mmichels at redhat.com>
---
 acinclude.m4 | 20 +++++++++++++++++---
 configure.ac |  2 +-
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 1f8bf8224a9a..93177dfe71d4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -42,9 +42,14 @@ AC_DEFUN([OVS_ENABLE_WERROR],
    fi
    AC_SUBST([SPARSE_WERROR])])
 
-dnl OVS_CHECK_DDLOG
+dnl OVS_CHECK_DDLOG([VERSION])
 dnl
-dnl Configure ddlog source tree
+dnl Configure ddlog source tree, checking for the given DDlog VERSION.
+dnl VERSION should be a major and minor, e.g. 0.36, which will accept
+dnl 0.36.0, 0.36.1, and so on.  Omit VERSION to accept any version of
+dnl ddlog (which is probably only useful for developers who are trying
+dnl different versions, since OVN is currently bound to a particular
+dnl DDlog version).
 AC_DEFUN([OVS_CHECK_DDLOG], [
   AC_ARG_WITH([ddlog],
               [AC_HELP_STRING([--with-ddlog=.../differential-datalog/lib],
@@ -52,6 +57,7 @@ AC_DEFUN([OVS_CHECK_DDLOG], [
               [DDLOGLIBDIR=$withval], [DDLOGLIBDIR=no])
 
   AC_MSG_CHECKING([for DDlog library directory])
+  AC_MSG_RESULT([$DDLOGLIBDIR])
   if test "$DDLOGLIBDIR" != no; then
     if test ! -d "$DDLOGLIBDIR"; then
       AC_MSG_ERROR([ddlog library dir "$DDLOGLIBDIR" doesn't exist])
@@ -65,6 +71,15 @@ AC_DEFUN([OVS_CHECK_DDLOG], [
         AC_MSG_ERROR([ddlog is required to build with DDlog])
     fi
 
+    AC_MSG_CHECKING([$DDLOG version])
+    $DDLOG --version >&AS_MESSAGE_LOG_FD 2>&1
+    ddlog_version=$($DDLOG --version | sed -n 's/^DDlog v\([[0-9]][[^ ]]*\).*/\1/p')
+    AC_MSG_RESULT([$ddlog_version])
+    m4_if([$1], [], [], [
+        AS_CASE([$ddlog_version],
+            [$1 | $1.*], [],
+            [*], [AC_MSG_ERROR([DDlog version $1.x is required, but $ddlog_version is installed])])])
+
     AC_ARG_VAR([CARGO])
     AC_CHECK_PROGS([CARGO], [cargo], [none])
     if test X"$CARGO" = X"none"; then
@@ -80,7 +95,6 @@ AC_DEFUN([OVS_CHECK_DDLOG], [
     AC_SUBST([DDLOGLIBDIR])
     AC_DEFINE([DDLOG], [1], [Build OVN daemons with ddlog.])
   fi
-  AC_MSG_RESULT([$DDLOGLIBDIR])
 
   AM_CONDITIONAL([DDLOG], [test "$DDLOGLIBDIR" != no])
 ])
diff --git a/configure.ac b/configure.ac
index ec5ee31df0da..1c57c4d10482 100644
--- a/configure.ac
+++ b/configure.ac
@@ -169,7 +169,7 @@ OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER])
 OVS_ENABLE_WERROR
 OVS_ENABLE_SPARSE
 
-OVS_CHECK_DDLOG
+OVS_CHECK_DDLOG([0.38])
 OVS_CHECK_PRAGMA_MESSAGE
 OVN_CHECK_OVS
 OVS_CTAGS_IDENTIFIERS
-- 
2.31.1



More information about the dev mailing list