about summary refs log tree commit diff homepage
path: root/autoconf
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2016-02-11 06:43:09 +0000
committerDan Liew <daniel.liew@imperial.ac.uk>2016-02-14 23:55:24 +0000
commit5960bc6387df8ec89e3e98ae3867b0a3c025033b (patch)
treece3a0a149251941b6c557eff1182c9738a81293b /autoconf
parent1f13e9dbf9db2095b6612a47717c2b86e4aaba72 (diff)
downloadklee-5960bc6387df8ec89e3e98ae3867b0a3c025033b.tar.gz
Handle Z3 API change between 4.4.1 and the current master branch
for the ``Z3_get_error_msg()`` function.
Diffstat (limited to 'autoconf')
-rw-r--r--autoconf/configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 94928fcc..617469e6 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -651,6 +651,22 @@ if test "X$ENABLE_Z3" != X0 ; then
            AC_MSG_ERROR([Unable to link against z3])
     ], "$Z3_LDFLAGS")
 
+    # Test which function signature of ``Z3_get_error_msg()`` we need to use.
+    # There's an API break between Z3 4.4.1 and the master branch
+    AC_MSG_CHECKING([if Z3_get_error_msg() requires Z3_context])
+    AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM([[#include "z3.h"]],
+                       [[Z3_context c = Z3_mk_context(0); Z3_get_error_msg(c, Z3_OK);]])],
+      [Z3_HAS_ERROR_MSG_CONTEXT=1],
+      [Z3_HAS_ERROR_MSG_CONTEXT=0])
+
+    if test "X$Z3_HAS_ERROR_MSG_CONTEXT" == X1; then
+      AC_DEFINE(HAVE_Z3_GET_ERROR_MSG_NEEDS_CONTEXT, [1], [Z3 needs a Z3_context passed to Z3_get_error_msg()])
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+
     Z3_LDFLAGS="${Z3_LDFLAGS} -lz3"
     AC_MSG_NOTICE([Using Z3 solver backend])
     CPPFLAGS="$old_CPPFLAGS"