about summary refs log tree commit diff homepage
path: root/configure
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
commit71d1412619448aa780f0864b976b06b15eb6a4e1 (patch)
tree911e9dfb7eaa38d68884649ff578e7df00ce0d3f /configure
parent4ea784dd4deaed11dffec28e7dab0f1eb3c4afc0 (diff)
downloadklee-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 'configure')
-rwxr-xr-xconfigure73
1 files changed, 64 insertions, 9 deletions
diff --git a/configure b/configure
index 353649f3..9d38f30b 100755
--- a/configure
+++ b/configure
@@ -654,10 +654,13 @@ target_os
 LLVM_VERSION_MAJOR
 LLVM_VERSION_MINOR
 LLVM_IS_RELEASE
+REQUIRES_RTTI
+LLVM_BUILD_MODE
 KLEE_UCLIBC
 ENABLE_UCLIBC
 ENABLE_POSIX_RUNTIME
 RUNTIME_ENABLE_OPTIMIZED
+RUNTIME_DISABLE_ASSERTIONS
 RUNTIME_CONFIGURATION
 CC
 CFLAGS
@@ -1274,9 +1277,11 @@ Optional Packages:
   --with-llvmsrc          Location of LLVM Source Code
   --with-llvmobj          Location of LLVM Object Code
   --with-llvm             Location of LLVM Source and Object code
+  --with-llvm-build-mode  LLVM build mode (e.g. Debug or Release, default
+                          autodetect)
   --with-uclibc           Enable use of the klee uclibc at the given path
   --with-runtime          Select build configuration for runtime libraries
-                          (default Release)
+                          (default Release+Asserts)
   --with-stp              Location of STP installation directory
 
 Some influential environment variables:
@@ -2069,6 +2074,51 @@ _ACEOF
 LLVM_IS_RELEASE=$llvm_is_release
 
 
+if test $llvm_version_major -eq 2 -a $llvm_version_minor -le 6 ; then
+  requires_rtti=1
+else
+  requires_rtti=0
+fi
+REQUIRES_RTTI=$requires_rtti
+
+
+
+# Check whether --with-llvm-build-mode was given.
+if test "${with_llvm_build_mode+set}" = set; then
+  withval=$with_llvm_build_mode;
+else
+  with_llvm_build_mode=check
+fi
+
+
+{ echo "$as_me:$LINENO: checking llvm build mode" >&5
+echo $ECHO_N "checking llvm build mode... $ECHO_C" >&6; }
+
+if test X${with_llvm_build_mode} = Xcheck ; then
+  llvm_configs="`echo $llvm_obj/*/bin/llvm-config`"
+    if test -x "$llvm_configs" ; then
+    llvm_build_mode="`$llvm_configs --build-mode`"
+  else
+    { { echo "$as_me:$LINENO: error: Could not autodetect build mode" >&5
+echo "$as_me: error: Could not autodetect build mode" >&2;}
+   { (exit 1); exit 1; }; }
+  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
+    { { echo "$as_me:$LINENO: error: Invalid build mode: $llvm_build_mode" >&5
+echo "$as_me: error: Invalid build mode: $llvm_build_mode" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+{ echo "$as_me:$LINENO: result: $llvm_build_mode" >&5
+echo "${ECHO_T}$llvm_build_mode" >&6; }
+LLVM_BUILD_MODE=$llvm_build_mode
+
+
 
 
 # Check whether --with-uclibc was given.
@@ -2169,13 +2219,7 @@ else
 fi
 
 if test X"${withval}" = Xdefault; then
-   with_runtime=Release
-fi
-
-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
 
 { echo "$as_me:$LINENO: checking runtime configuration" >&5
@@ -2185,21 +2229,29 @@ if test X${with_runtime} = XRelease; then
 echo "${ECHO_T}Release" >&6; }
     RUNTIME_ENABLE_OPTIMIZED=1
 
+    RUNTIME_DISABLE_ASSERTIONS=1
+
 elif test X${with_runtime} = XRelease+Asserts; then
     { echo "$as_me:$LINENO: result: Release+Asserts" >&5
 echo "${ECHO_T}Release+Asserts" >&6; }
     RUNTIME_ENABLE_OPTIMIZED=1
 
+    RUNTIME_DISABLE_ASSERTIONS=0
+
 elif test X${with_runtime} = XDebug; then
    { echo "$as_me:$LINENO: result: Debug" >&5
 echo "${ECHO_T}Debug" >&6; }
    RUNTIME_ENABLE_OPTIMIZED=0
 
+   RUNTIME_DISABLE_ASSERTIONS=1
+
 elif test X${with_runtime} = XDebug+Asserts; then
    { echo "$as_me:$LINENO: result: Debug+Asserts" >&5
 echo "${ECHO_T}Debug+Asserts" >&6; }
    RUNTIME_ENABLE_OPTIMIZED=0
 
+   RUNTIME_DISABLE_ASSERTIONS=0
+
 else
    { { echo "$as_me:$LINENO: error: invalid configuration: ${with_runtime}" >&5
 echo "$as_me: error: invalid configuration: ${with_runtime}" >&2;}
@@ -5961,10 +6013,13 @@ target_os!$target_os$ac_delim
 LLVM_VERSION_MAJOR!$LLVM_VERSION_MAJOR$ac_delim
 LLVM_VERSION_MINOR!$LLVM_VERSION_MINOR$ac_delim
 LLVM_IS_RELEASE!$LLVM_IS_RELEASE$ac_delim
+REQUIRES_RTTI!$REQUIRES_RTTI$ac_delim
+LLVM_BUILD_MODE!$LLVM_BUILD_MODE$ac_delim
 KLEE_UCLIBC!$KLEE_UCLIBC$ac_delim
 ENABLE_UCLIBC!$ENABLE_UCLIBC$ac_delim
 ENABLE_POSIX_RUNTIME!$ENABLE_POSIX_RUNTIME$ac_delim
 RUNTIME_ENABLE_OPTIMIZED!$RUNTIME_ENABLE_OPTIMIZED$ac_delim
+RUNTIME_DISABLE_ASSERTIONS!$RUNTIME_DISABLE_ASSERTIONS$ac_delim
 RUNTIME_CONFIGURATION!$RUNTIME_CONFIGURATION$ac_delim
 CC!$CC$ac_delim
 CFLAGS!$CFLAGS$ac_delim
@@ -5987,7 +6042,7 @@ LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 78; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 81; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5