include math.h when testing IEEE
[rrdtool.git] / m4 / acinclude.m4
index 5ea34f0..c1e5c4b 100644 (file)
@@ -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";;
         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.
             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.
@@ -390,6 +390,10 @@ AC_CACHE_VAL([rd_cv_ieee_$2],
 #  define isinf(a) (fpclassify(a) == FP_INFINITE)
 #endif
 
 #  define isinf(a) (fpclassify(a) == FP_INFINITE)
 #endif
 
+#if HAVE_MATH_H
+#include <math.h>
+#endif
+
 #include <stdio.h>
 int main(void){
     double rrdnan,rrdinf,rrdc,rrdzero;
 #include <stdio.h>
 int main(void){
     double rrdnan,rrdinf,rrdc,rrdzero;