about summary refs log tree commit diff homepage
path: root/autoconf/configure.ac
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2014-10-22 10:28:46 +0200
committerDan Liew <daniel.liew@imperial.ac.uk>2014-11-01 21:04:27 +0000
commit155eae5f80b83786daf693c92f787ccd2a51af10 (patch)
treebe3f683665113a1101e63a24c13f490768bb7cf4 /autoconf/configure.ac
parent5b3d62b48169dd8dcffe374a565891a99e434c79 (diff)
downloadklee-155eae5f80b83786daf693c92f787ccd2a51af10.tar.gz
configure: allow stp being installed in /
I have stp in standard paths: /usr/include and /usr/lib64. Allow that
by correct STP_CFLAGS + STP_LDFLAGS instead of STP_ROOT. Those are
empty when --with-stp is not passed.

configure is regenerated by autoconf too.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'autoconf/configure.ac')
-rw-r--r--autoconf/configure.ac91
1 files changed, 46 insertions, 45 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 97bd5eb6..a5f12c5f 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -552,55 +552,56 @@ dnl **************************************************************************
 
 AC_ARG_WITH(stp,
   AS_HELP_STRING([--with-stp],
-    [Location of STP installation directory]),,
-    [AC_MSG_ERROR([The --with-stp=<path> argument is mandatory where <path> is the path \
-to the root of your STP install])])
-
-#Check for empty argument
-if test "X$with_stp" = X ; then
-	AC_MSG_ERROR([<path> cannot be empty in --with-stp=<path>])
-else
-  stp_root=`(cd $with_stp && pwd) 2> /dev/null`
-
-  #Check for bad path
-  if test "X$stp_root" = X ; then
-  	AC_MSG_ERROR([Cannot access path $with_stp passed to --with-stp])
-  fi
-
-  old_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS -I$stp_root/include"
-  AC_CHECK_HEADER(stp/c_interface.h,, [
-         AC_MSG_ERROR([Unable to use stp/c_interface.h header])
-  ])
-  CPPFLAGS="$old_CPPFLAGS"
-
-  STP_NEEDS_BOOST=0
-
-  # Try old STP
-  AC_CHECK_LIB(stp, vc_setInterfaceFlags,, [
-         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 )
+    [Location of STP installation directory]),[
+      #Check for empty argument
+      if test "X$withval" = X ; then
+	      AC_MSG_ERROR([<path> cannot be empty in --with-stp=<path>])
+      fi
+      stp_root=`(cd $withval && pwd) 2> /dev/null`
 
-    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
+      #Check for bad path
+      if test "X$stp_root" = X ; then
+	    AC_MSG_ERROR([Cannot access path $with_stp passed to --with-stp])
+      fi
 
-  AC_SUBST(STP_ROOT,$stp_root)
+      STP_CFLAGS="-I$stp_root/include"
+      STP_LDFLAGS="-L$stp_root/lib"
+    ])
+
+old_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $STP_CFLAGS"
+AC_CHECK_HEADER(stp/c_interface.h,, [
+       AC_MSG_ERROR([Unable to use stp/c_interface.h header])
+])
+CPPFLAGS="$old_CPPFLAGS"
+
+STP_NEEDS_BOOST=0
+
+# Try old STP
+AC_CHECK_LIB(stp, vc_setInterfaceFlags,, [
+       STP_NEEDS_BOOST=1 ; AC_MSG_RESULT([Could not link with libstp. Checking if newer STP is being used])
+], "$STP_LDFLAGS")
+
+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])
+  ], "$STP_LDFLAGS" $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_CFLAGS)
+AC_SUBST(STP_LDFLAGS)
+
 dnl **************************************************************************
 dnl User option to enable metaSMT constraint solvers and to specify the 
 dnl the location of the metaSMT root directory