diff --git a/clamav-config.h.in b/clamav-config.h.in index e548c2b40..781a2950c 100644 --- a/clamav-config.h.in +++ b/clamav-config.h.in @@ -293,6 +293,9 @@ /* Define if libtool can extract symbol lists from object files. */ #undef HAVE_PRELOADED_SYMBOLS +/* Define to 1 if you have the header file */ +#undef HAVE_PTHREAD_H + /* Define to 1 if you have the `pthread_yield' function. */ #undef HAVE_PTHREAD_YIELD diff --git a/configure b/configure index 373eb600e..b5d0c6631 100755 --- a/configure +++ b/configure @@ -14446,6 +14446,14 @@ $as_echo "#define HAVE_FCNTL_H 1" >>confdefs.h fi +ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes; then : + +$as_echo "#define HAVE_PTHREAD_H 1" >>confdefs.h + +fi + + # Check whether --enable-experimental was given. if test "${enable_experimental+set}" = set; then : diff --git a/configure.ac b/configure.ac index f92ef6e0b..49e2b9246 100644 --- a/configure.ac +++ b/configure.ac @@ -419,6 +419,7 @@ AC_COMPILE_CHECK_SIZEOF([void *]) AC_CHECK_FUNCS([sysctlbyname]) AC_CHECK_FUNCS([getifaddrs]) AC_CHECK_HEADER([fcntl.h], AC_DEFINE([HAVE_FCNTL_H],1,[Define to 1 if you have the header file])) +AC_CHECK_HEADER([pthread.h], AC_DEFINE([HAVE_PTHREAD_H],1,[Define to 1 if you have the header file])) AC_ARG_ENABLE([experimental], [ --enable-experimental enable experimental code], diff --git a/libclamav/others.h b/libclamav/others.h index 3fbdce197..358d40b90 100644 --- a/libclamav/others.h +++ b/libclamav/others.h @@ -31,6 +31,10 @@ #include #endif +#if HAVE_PTHREAD_H +#include +#endif + #include #include #include "cltypes.h"