X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=m4%2Facinclude.m4;h=ee2fc1b97ca466123b3450081c07939996269c6a;hb=17d5fce6da802b46dc905fd48e05eb2423d078f0;hp=5ea34f0f54a3047beb0f8b89c1b8706747d985fc;hpb=377af7db1b7a7eef72d891328bb36a209ed23790;p=rrdtool.git diff --git a/m4/acinclude.m4 b/m4/acinclude.m4 index 5ea34f0..ee2fc1b 100644 --- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -289,7 +289,7 @@ if test "x$acx_pthread_ok" = xyes; then case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) x_rflag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) x_rflag="-D_REENTRANT";; - *-linux*) + *-linux* | *-k*bsd*-gnu*) if test x"$PTHREAD_CFLAGS" = "x-pthread"; then # For Linux/gcc "-pthread" implies "-lpthread". We need, however, to make this explicit # in PTHREAD_LIBS such that a shared library to be built properly depends on libpthread. @@ -363,13 +363,13 @@ AC_CACHE_VAL([rd_cv_ieee_$2], #endif /* solaris 10 it defines isnan such that only forte can compile it ... bad bad */ -#if (defined(HAVE_ISNAN) && defined(isnan) && defined(HAVE_FPCLASS)) +#if (defined(HAVE_ISNAN) && defined(isnan) && defined(HAVE_FPCLASS) && defined(FP_SNAN) && defined(FP_QNAN)) # undef isnan # define isnan(a) (fpclass(a) == FP_SNAN || fpclass(a) == FP_QNAN) #endif /* Digital UNIX */ -#if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H)) +#if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H) && defined(FP_NEG_INF) && defined( FP_POS_INF) ) # define HAVE_ISINF 1 # define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF) #endif @@ -390,6 +390,10 @@ AC_CACHE_VAL([rd_cv_ieee_$2], # define isinf(a) (fpclassify(a) == FP_INFINITE) #endif +#if HAVE_MATH_H +#include +#endif + #include int main(void){ double rrdnan,rrdinf,rrdc,rrdzero; @@ -520,6 +524,8 @@ AC_CACHE_VAL([rd_cv_ms_async], #include #include #include +#include +void timeout (int i) { exit (1); } int main(void){ int fd; struct stat stbuf; @@ -527,7 +533,6 @@ int main(void){ int res; char temp[] = "mmaptestXXXXXX"; struct utimbuf newtime; - time_t create_ts; fd = mkstemp(temp); if (fd == -1){ @@ -556,13 +561,17 @@ int main(void){ perror("close"); goto bad_exit; } + /* there were reports of sync hanging + so we better set an alarm */ + signal(SIGALRM,&timeout); + alarm(5); /* The ASYNC means that we schedule the msync and return immediately. Since we want to see if the modification time is updated upon msync(), we have to make sure that our asynchronous request completes before we stat below. In a real application, the request would be completed at a random time in the future but for this test we do not want to wait an arbitrary amount of - time, so force a commit now. */ + time, so force a commit now. */ sync(); stat(temp, &stbuf); if (create_ts > stbuf.st_mtime){