diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-05-18 21:48:50 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-05-18 21:48:50 +0000 |
commit | 71d1412619448aa780f0864b976b06b15eb6a4e1 (patch) | |
tree | 911e9dfb7eaa38d68884649ff578e7df00ce0d3f /autoconf | |
parent | 4ea784dd4deaed11dffec28e7dab0f1eb3c4afc0 (diff) | |
download | klee-71d1412619448aa780f0864b976b06b15eb6a4e1.tar.gz |
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). git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@131584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf')
-rw-r--r-- | autoconf/configure.ac | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 4b2fc948..57f16a2a 100644 --- a/autoconf/configure.ac +++ b/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 |