update defines according to manual pageentry
[rrdtool.git] / configure.ac
index 8e64c11..3078710 100644 (file)
@@ -71,8 +71,9 @@ char *strchr (), *strrchr ();
 #endif
 
 /* enable posix_fadvise on linux */
-#ifdef HAVE_POSIX_FADVISE
-#define __USE_XOPEN2K 1
+#if defined(HAVE_POSIX_FADVISE) && defined(HAVE_FCNTL_H)
+#define _XOPEN_SOURCE 600
+#include <fcntl.h>
 #endif
 
 #ifdef NO_NULL_REALLOC
@@ -247,7 +248,7 @@ AC_C_BIGENDIAN
 dnl for each function found we get a definition in config.h 
 dnl of the form HAVE_FUNCTION
 
-AC_CHECK_FUNCS(tzset mbstowcs opendir readdir chdir chroot getuid setlocale strerror strerror_r snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday posix_fadvise)
+AC_CHECK_FUNCS(tzset mbstowcs opendir readdir chdir chroot getuid setlocale strerror strerror_r snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday posix_fadvise madvise)
 
 
 if test "x$enable_mmap" = xyes; then