about summary refs log tree commit diff homepage
path: root/autoconf/configure.ac
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2014-01-25 09:43:07 +0000
committerDan Liew <daniel.liew@imperial.ac.uk>2014-01-25 09:43:07 +0000
commit843698676de2b31d422254ac35546393a0d2d469 (patch)
treefe6c9baade4e5a1ed5530517c0fb314a1df81f8e /autoconf/configure.ac
parente49c1e1958e863195b01d99c92194289b4034bbb (diff)
downloadklee-843698676de2b31d422254ac35546393a0d2d469.tar.gz
Upstream STP's libstp now depends on boost. This commit updates
the configure script to detect this by first trying to link without
boost and if that fails then trying to link libstp with boost.

This also updates the relevant Makefiles so that the klee and kleaver
executables link in STP's boost dependencies if necessary.
Diffstat (limited to 'autoconf/configure.ac')
-rw-r--r--autoconf/configure.ac22
1 files changed, 21 insertions, 1 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index af5affc0..7d4ff994 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -523,10 +523,30 @@ else
   ])
   CPPFLAGS="$old_CPPFLAGS"
 
+  STP_NEEDS_BOOST=0
+
+  # Try old STP
   AC_CHECK_LIB(stp, vc_setInterfaceFlags,, [
-         AC_MSG_ERROR([Unable to link with libstp])
+         STP_NEEDS_BOOST=1 ; AC_MSG_RESULT([Could not link with libstp. Checking if newer STP is being used])
   ], -L$stp_root/lib)
 
+  dnl Flags for upstream STP which has boost dependency
+  UPSTREAM_STP_LINK_FLAGS="-lboost_system -lboost_program_options"
+  if test "X$STP_NEEDS_BOOST" != X0 ; then
+    # Need to clear cached result
+    unset ac_cv_lib_stp_vc_setInterfaceFlags
+
+    AC_CHECK_LIB(stp,
+                 vc_setInterfaceFlags,, [
+                 AC_MSG_ERROR([Unable to link with libstp. Check config.log to see what went wrong])
+    ], -L$stp_root/lib $UPSTREAM_STP_LINK_FLAGS )
+
+    AC_SUBST(UPSTREAM_STP_LINK_FLAGS, $UPSTREAM_STP_LINK_FLAGS)
+    AC_SUBST(STP_NEEDS_BOOST, $STP_NEEDS_BOOST)
+  else
+    AC_MSG_RESULT([Using old STP])
+  fi
+
   AC_SUBST(STP_ROOT,$stp_root)
 fi