about summary refs log tree commit diff homepage
path: root/autoconf
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2014-09-13 11:29:19 -0700
committerDaniel Dunbar <daniel@zuster.org>2014-09-13 11:29:32 -0700
commit2ce22af434e383cf0c2c65e4da829de630b6cd9d (patch)
treec49e4a0461ffa7c95adfa0fefd15bbc10b654c1f /autoconf
parent91eab8b92526a8215ebc9ed50da5b1d405533ac7 (diff)
downloadklee-2ce22af434e383cf0c2c65e4da829de630b6cd9d.tar.gz
Add KLEE specific DEBUG macros.
 - This allows us to build in +Asserts mode even when LLVM isn't (by disabling
   the checks in that mode).

 - Eventually it would be nice to just move off of LLVM's DEBUG infrastructure
   entirely and just have our own copy, but this works for now.

 - Fixes #150.
Diffstat (limited to 'autoconf')
-rw-r--r--autoconf/configure.ac11
1 files changed, 11 insertions, 0 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index edeacc8c..18822396 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -179,6 +179,17 @@ fi
 AC_MSG_RESULT([$llvm_build_mode])
 AC_SUBST(LLVM_BUILD_MODE,$llvm_build_mode)
 
+dnl Check if we are building against a +Asserts LLVM, and enable the DEBUG_*
+dnl macros if so (they use symbols only available in +Asserts builds).
+AC_MSG_CHECKING([llvm has asserts enabled])
+if test `expr "$llvm_build_mode" : ".*Asserts.*"` -ne 0; then
+   llvm_has_asserts_enabled=1
+   AC_DEFINE_UNQUOTED(ENABLE_KLEE_DEBUG, 1, [Enable KLEE DEBUG checks])
+else
+   llvm_has_asserts_enabled=0
+fi
+AC_MSG_RESULT([$llvm_has_asserts_enabled])
+
 dnl **************************************************************************
 dnl Detect a LLVM Bitcode compiler for building KLEE runtime library