about summary refs log tree commit diff homepage
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
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>
-rw-r--r--Makefile.common4
-rw-r--r--Makefile.config.in3
-rw-r--r--autoconf/configure.ac91
-rwxr-xr-xconfigure76
4 files changed, 88 insertions, 86 deletions
diff --git a/Makefile.common b/Makefile.common
index e6de9f1e..92f5118b 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -38,8 +38,8 @@ endif
 # This is filename that KLEE will look for when trying to load klee-uclibc
 KLEE_UCLIBC_BCA_NAME="klee-uclibc.bca"
 
-LD.Flags += -L$(STP_ROOT)/lib
-CXX.Flags += -I$(STP_ROOT)/include
+LD.Flags += $(STP_LDFLAGS)
+CXX.Flags += $(STP_CFLAGS)
 CXX.Flags += -DKLEE_DIR=\"$(PROJ_OBJ_ROOT)\" -DKLEE_INSTALL_BIN_DIR=\"$(PROJ_bindir)\"
 CXX.Flags += -DKLEE_INSTALL_LIB_DIR=\"$(PROJ_libdir)\"
 
diff --git a/Makefile.config.in b/Makefile.config.in
index c8e2b57f..b2474849 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -29,7 +29,8 @@ PROJ_INSTALL_ROOT := @prefix@
 
 KLEE_USE_CXX11 := @KLEE_USE_CXX11@
 
-STP_ROOT := @STP_ROOT@
+STP_CFLAGS := @STP_CFLAGS@
+STP_LDFLAGS := @STP_LDFLAGS@
 
 STP_NEEDS_BOOST := @STP_NEEDS_BOOST@
 
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
diff --git a/configure b/configure
index 6db9baf0..ae7ae0b0 100755
--- a/configure
+++ b/configure
@@ -626,7 +626,8 @@ ac_subst_vars='LTLIBOBJS
 LIBOBJS
 METASMT_ROOT
 ENABLE_METASMT
-STP_ROOT
+STP_LDFLAGS
+STP_CFLAGS
 STP_NEEDS_BOOST
 UPSTREAM_STP_LINK_FLAGS
 CXXCPP
@@ -5055,47 +5056,47 @@ fi
 # Check whether --with-stp was given.
 if test "${with_stp+set}" = set; then :
   withval=$with_stp;
-else
-  as_fn_error $? "The --with-stp=<path> argument is mandatory where <path> is the path \
-to the root of your STP install" "$LINENO" 5
-fi
+      #Check for empty argument
+      if test "X$withval" = X ; then
+	      as_fn_error $? "<path> cannot be empty in --with-stp=<path>" "$LINENO" 5
+      fi
+      stp_root=`(cd $withval && pwd) 2> /dev/null`
 
+      #Check for bad path
+      if test "X$stp_root" = X ; then
+	    as_fn_error $? "Cannot access path $with_stp passed to --with-stp" "$LINENO" 5
+      fi
 
-#Check for empty argument
-if test "X$with_stp" = X ; then
-	as_fn_error $? "<path> cannot be empty in --with-stp=<path>" "$LINENO" 5
-else
-  stp_root=`(cd $with_stp && pwd) 2> /dev/null`
+      STP_CFLAGS="-I$stp_root/include"
+      STP_LDFLAGS="-L$stp_root/lib"
 
-  #Check for bad path
-  if test "X$stp_root" = X ; then
-  	as_fn_error $? "Cannot access path $with_stp passed to --with-stp" "$LINENO" 5
-  fi
+fi
 
-  old_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS -I$stp_root/include"
-  ac_fn_cxx_check_header_mongrel "$LINENO" "stp/c_interface.h" "ac_cv_header_stp_c_interface_h" "$ac_includes_default"
+
+old_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $STP_CFLAGS"
+ac_fn_cxx_check_header_mongrel "$LINENO" "stp/c_interface.h" "ac_cv_header_stp_c_interface_h" "$ac_includes_default"
 if test "x$ac_cv_header_stp_c_interface_h" = xyes; then :
 
 else
 
-         as_fn_error $? "Unable to use stp/c_interface.h header" "$LINENO" 5
+       as_fn_error $? "Unable to use stp/c_interface.h header" "$LINENO" 5
 
 fi
 
 
-  CPPFLAGS="$old_CPPFLAGS"
+CPPFLAGS="$old_CPPFLAGS"
 
-  STP_NEEDS_BOOST=0
+STP_NEEDS_BOOST=0
 
-  # Try old STP
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for vc_setInterfaceFlags in -lstp" >&5
+# Try old STP
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for vc_setInterfaceFlags in -lstp" >&5
 $as_echo_n "checking for vc_setInterfaceFlags in -lstp... " >&6; }
 if ${ac_cv_lib_stp_vc_setInterfaceFlags+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lstp -L$stp_root/lib $LIBS"
+LIBS="-lstp "$STP_LDFLAGS" $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -5134,24 +5135,24 @@ _ACEOF
 
 else
 
-         STP_NEEDS_BOOST=1 ; { $as_echo "$as_me:${as_lineno-$LINENO}: result: Could not link with libstp. Checking if newer STP is being used" >&5
+       STP_NEEDS_BOOST=1 ; { $as_echo "$as_me:${as_lineno-$LINENO}: result: Could not link with libstp. Checking if newer STP is being used" >&5
 $as_echo "Could not link with libstp. Checking if newer STP is being used" >&6; }
 
 fi
 
 
-    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
+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
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for vc_setInterfaceFlags in -lstp" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for vc_setInterfaceFlags in -lstp" >&5
 $as_echo_n "checking for vc_setInterfaceFlags in -lstp... " >&6; }
 if ${ac_cv_lib_stp_vc_setInterfaceFlags+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lstp -L$stp_root/lib $UPSTREAM_STP_LINK_FLAGS  $LIBS"
+LIBS="-lstp "$STP_LDFLAGS" $UPSTREAM_STP_LINK_FLAGS  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -5190,23 +5191,22 @@ _ACEOF
 
 else
 
-                 as_fn_error $? "Unable to link with libstp. Check config.log to see what went wrong" "$LINENO" 5
+	       as_fn_error $? "Unable to link with libstp. Check config.log to see what went wrong" "$LINENO" 5
 
 fi
 
 
-    UPSTREAM_STP_LINK_FLAGS=$UPSTREAM_STP_LINK_FLAGS
+  UPSTREAM_STP_LINK_FLAGS=$UPSTREAM_STP_LINK_FLAGS
 
-    STP_NEEDS_BOOST=$STP_NEEDS_BOOST
+  STP_NEEDS_BOOST=$STP_NEEDS_BOOST
 
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using old STP" >&5
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using old STP" >&5
 $as_echo "Using old STP" >&6; }
-  fi
+fi
+
 
-  STP_ROOT=$stp_root
 
-fi