diff options
author | Dan Liew <daniel.liew@imperial.ac.uk> | 2014-04-24 11:30:34 +0100 |
---|---|---|
committer | Martin Nowack <martin@se.inf.tu-dresden.de> | 2014-04-24 13:51:41 +0200 |
commit | d344b98751232ea79a22c6907175154f3fc9889d (patch) | |
tree | 6b8309dc56e22a81274154d132320559900d8376 | |
parent | 45ec4161781755dedc926341f98da2b8fa33695a (diff) | |
download | klee-d344b98751232ea79a22c6907175154f3fc9889d.tar.gz |
Have configure check for presense of mallinfo for the newly added
klee::util::GetTotalMemoryUsage()
-rw-r--r-- | autoconf/configure.ac | 8 | ||||
-rwxr-xr-x | configure | 62 | ||||
-rw-r--r-- | include/klee/Config/config.h.in | 3 |
3 files changed, 73 insertions, 0 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 7d4ff994..c1b1d2b8 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -496,6 +496,14 @@ AC_CHECK_HEADERS([selinux/selinux.h], AC_SUBST(HAVE_SELINUX, 0)) dnl ************************************************************************** +dnl Test for features +dnl ************************************************************************** +AC_SEARCH_LIBS(mallinfo,malloc, + AC_DEFINE([HAVE_MALLINFO],[1],[Define if mallinfo() is available on this platform.]), + AC_MSG_ERROR([mallinfo() must be supported by your malloc implementation]) + ) + +dnl ************************************************************************** dnl Find an install of STP dnl ************************************************************************** diff --git a/configure b/configure index 55497c3a..78e6ac69 100755 --- a/configure +++ b/configure @@ -4834,6 +4834,68 @@ fi done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mallinfo" >&5 +$as_echo_n "checking for library containing mallinfo... " >&6; } +if ${ac_cv_search_mallinfo+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mallinfo (); +int +main () +{ +return mallinfo (); + ; + return 0; +} +_ACEOF +for ac_lib in '' malloc; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_search_mallinfo=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_mallinfo+:} false; then : + break +fi +done +if ${ac_cv_search_mallinfo+:} false; then : + +else + ac_cv_search_mallinfo=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mallinfo" >&5 +$as_echo "$ac_cv_search_mallinfo" >&6; } +ac_res=$ac_cv_search_mallinfo +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +$as_echo "#define HAVE_MALLINFO 1" >>confdefs.h + +else + as_fn_error $? "mallinfo() must be supported by your malloc implementation" "$LINENO" 5 + +fi + + # Check whether --with-stp was given. diff --git a/include/klee/Config/config.h.in b/include/klee/Config/config.h.in index 3f6da802..5e49e35d 100644 --- a/include/klee/Config/config.h.in +++ b/include/klee/Config/config.h.in @@ -12,6 +12,9 @@ /* Define to 1 if you have the `stp' library (-lstp). */ #undef HAVE_LIBSTP +/* Define if mallinfo() is available on this platform. */ +#undef HAVE_MALLINFO + /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H |