summaryrefslogtreecommitdiff
path: root/klee/autoconf
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-05-18 21:48:50 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-05-18 21:48:50 +0000
commit463bacb88c6bdcac17617ecddacffb3fe3a86972 (patch)
tree193106f1a4279f375284c5319817e1280336a880 /klee/autoconf
parentb2873c4788494ea6cd886ba721322db253a5cdbb (diff)
Use local Makefile.rules
This patch changes the build system to use its own copy of Makefile.rules (taken from a recent svn snapshot). Also added a --with-llvm-build-mode flag and changed the default runtime library configuration to Release+Asserts. Makefile.rules was modified to support --with-llvm-build-mode and older versions of LLVM (tested 2.7 and 2.8).
Diffstat (limited to 'klee/autoconf')
-rw-r--r--klee/autoconf/configure.ac50
1 files changed, 40 insertions, 10 deletions
diff --git a/klee/autoconf/configure.ac b/klee/autoconf/configure.ac
index 4b2fc9489aa..57f16a2a816 100644
--- a/klee/autoconf/configure.ac
+++ b/klee/autoconf/configure.ac
@@ -139,6 +139,40 @@ AC_SUBST(LLVM_VERSION_MINOR,$llvm_version_minor)
AC_DEFINE_UNQUOTED(LLVM_IS_RELEASE, $llvm_is_release, [LLVM version is release (instead of development)])
AC_SUBST(LLVM_IS_RELEASE,$llvm_is_release)
+dnl LLVM <= 2.6 requires RTTI.
+if test $llvm_version_major -eq 2 -a $llvm_version_minor -le 6 ; then
+ requires_rtti=1
+else
+ requires_rtti=0
+fi
+AC_SUBST(REQUIRES_RTTI,$requires_rtti)
+
+AC_ARG_WITH(llvm-build-mode,
+ AS_HELP_STRING([--with-llvm-build-mode],
+ [LLVM build mode (e.g. Debug or Release, default autodetect)]),,[with_llvm_build_mode=check])
+
+AC_MSG_CHECKING([llvm build mode])
+
+if test X${with_llvm_build_mode} = Xcheck ; then
+ llvm_configs="`echo $llvm_obj/*/bin/llvm-config`"
+ dnl This will be true if the user has exactly 1 build mode built
+ if test -x "$llvm_configs" ; then
+ llvm_build_mode="`$llvm_configs --build-mode`"
+ else
+ AC_MSG_ERROR([Could not autodetect build mode])
+ fi
+else
+ llvm_configs="`echo $llvm_obj/*/bin/llvm-config`"
+ if test -x "$llvm_obj/$with_llvm_build_mode/bin/llvm-config" ; then
+ llvm_build_mode=$with_llvm_build_mode
+ else
+ AC_MSG_ERROR([Invalid build mode: $llvm_build_mode])
+ fi
+fi
+
+AC_MSG_RESULT([$llvm_build_mode])
+AC_SUBST(LLVM_BUILD_MODE,$llvm_build_mode)
+
dnl **************************************************************************
dnl User option to enable uClibc support.
@@ -217,33 +251,29 @@ dnl User option to select runtime version
AC_ARG_WITH(runtime,
AS_HELP_STRING([--with-runtime],
- [Select build configuration for runtime libraries (default [Release])]),,
+ [Select build configuration for runtime libraries (default [Release+Asserts])]),,
withval=default)
if test X"${withval}" = Xdefault; then
- with_runtime=Release
-fi
-
-dnl Before LLVM 2.8, the "optimized with asserts enabled" build was just
-dnl 'Release'; now it's 'Release+Asserts'. See the LLVM 2.8 release notes.
-if !(test $llvm_version_major == 2 &&
- test $llvm_version_minor -lt 8) &&
- test "$with_runtime" == "Release"; then
- with_runtime=Release+Asserts
+ with_runtime=Release+Asserts
fi
AC_MSG_CHECKING([runtime configuration])
if test X${with_runtime} = XRelease; then
AC_MSG_RESULT([Release])
AC_SUBST(RUNTIME_ENABLE_OPTIMIZED,[[1]])
+ AC_SUBST(RUNTIME_DISABLE_ASSERTIONS,[[1]])
elif test X${with_runtime} = XRelease+Asserts; then
AC_MSG_RESULT([Release+Asserts])
AC_SUBST(RUNTIME_ENABLE_OPTIMIZED,[[1]])
+ AC_SUBST(RUNTIME_DISABLE_ASSERTIONS,[[0]])
elif test X${with_runtime} = XDebug; then
AC_MSG_RESULT([Debug])
AC_SUBST(RUNTIME_ENABLE_OPTIMIZED,[[0]])
+ AC_SUBST(RUNTIME_DISABLE_ASSERTIONS,[[1]])
elif test X${with_runtime} = XDebug+Asserts; then
AC_MSG_RESULT([Debug+Asserts])
AC_SUBST(RUNTIME_ENABLE_OPTIMIZED,[[0]])
+ AC_SUBST(RUNTIME_DISABLE_ASSERTIONS,[[0]])
else
AC_MSG_ERROR([invalid configuration: ${with_runtime}])
fi