From: Francesco Chemolli Date: Thu, 29 Jul 2010 15:41:43 +0000 (+0200) Subject: Shuffled malloc detection mechnaisms into os-deps.m4 X-Git-Tag: take1~402^2~2^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef7ece5880c9530e9b2d5801ed5c5332b154f197;p=thirdparty%2Fsquid.git Shuffled malloc detection mechnaisms into os-deps.m4 --- diff --git a/acinclude/os-deps.m4 b/acinclude/os-deps.m4 index 33c7c4c4ab..7e88aba71a 100644 --- a/acinclude/os-deps.m4 +++ b/acinclude/os-deps.m4 @@ -136,8 +136,10 @@ int main(int argc, char **argv) ]) dnl SQUID_CHECK_EPOLL + dnl check that we have functional libcap2 headers dnl sets squid_cv_sys_capability_works to "yes" or "no" + AC_DEFUN([SQUID_CHECK_FUNCTIONAL_LIBCAP2],[ AC_CACHE_CHECK([for operational libcap2 headers], squid_cv_sys_capability_works, @@ -157,6 +159,7 @@ AC_DEFUN([SQUID_CHECK_FUNCTIONAL_LIBCAP2],[ dnl Ripped from Samba. Thanks! dnl check that we have Unix sockets. Sets squid_cv_unixsocket to either yes or no depending on the check + AC_DEFUN([SQUID_CHECK_UNIX_SOCKET],[ AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ @@ -169,3 +172,25 @@ AC_DEFUN([SQUID_CHECK_UNIX_SOCKET],[ sunaddr.sun_family = AF_UNIX; ]])],[squid_cv_unixsocket=yes],[squid_cv_unixsocket=no])]) ]) + + +dnl checks that the system provides struct mallinfo and mallinfo.mxfast. +dnl AC_DEFINEs HAVE_STRUCT_MALLINFO and HAVE_STRUCT_MALLINFO_MXFAST if so + +AC_DEFUN([SQUID_HAVE_STRUCT_MALLINFO],[ +AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[ +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_MALLOC_H +#include +#endif]) +AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[ +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_MALLOC_H +#include +#endif]) +]) + diff --git a/configure.in b/configure.in index 7234f95a3c..3075bb3528 100644 --- a/configure.in +++ b/configure.in @@ -2273,21 +2273,7 @@ AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[ #endif ]) -AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[ -#if HAVE_SYS_TYPES_H -#include -#endif -#if HAVE_MALLOC_H -#include -#endif]) - -AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[ -#if HAVE_SYS_TYPES_H -#include -#endif -#if HAVE_MALLOC_H -#include -#endif]) +SQUID_HAVE_STRUCT_MALLINFO dnl Override rusage() detect on MinGW because is emulated in source code case "$host_os" in @@ -2456,7 +2442,7 @@ SQUID_DEFINE_BOOL(HAVE_UNIXSOCKET,$squid_cv_unixsocket,[System supports unix soc AC_CHECK_LIB(gnumalloc, malloc) if test "x$ac_cv_lib_gnumalloc_malloc" = "xyes"; then - AC_MSG_NOTICE([Disabling extended malloc functions when using gnumalloc]) + AC_MSG_NOTICE([Disabling extended malloc functions when using bundled gnumalloc]) ac_cv_func_mallinfo=no ac_cv_func_mallocblksize=no ac_cv_func_mallopt=no