summaryrefslogtreecommitdiff
path: root/databases/rrdtool/patches/patch-ab
diff options
context:
space:
mode:
Diffstat (limited to 'databases/rrdtool/patches/patch-ab')
-rw-r--r--databases/rrdtool/patches/patch-ab38
1 files changed, 38 insertions, 0 deletions
diff --git a/databases/rrdtool/patches/patch-ab b/databases/rrdtool/patches/patch-ab
new file mode 100644
index 00000000000..5dd69e098b5
--- /dev/null
+++ b/databases/rrdtool/patches/patch-ab
@@ -0,0 +1,38 @@
+$NetBSD: patch-ab,v 1.7 2007/11/21 07:50:14 martti Exp $
+
+--- configure.ac (revision 1235)
++++ configure.ac (working copy)
+@@ -49,6 +49,13 @@
+ /* realloc does not support NULL as argument */
+ #undef NO_NULL_REALLOC
+
++/* lets enable madvise defines in netbsd */
++#if defined(__NetBSD__)
++# if !defined(_NETBSD_SOURCE)
++# define _NETBSD_SOURCE
++# endif
++#endif
++
+ ])
+
+ AH_BOTTOM([
+@@ -58,6 +65,19 @@
+ #include <fcntl.h>
+ #endif
+
++#if !defined HAVE_MADVISE && defined HAVE_POSIX_MADVISE
++/* use posix_madvise family */
++# define madvise posix_madvise
++# define MADV_NORMAL POSIX_MADV_NORMAL
++# define MADV_RANDOM POSIX_MADV_RANDOM
++# define MADV_SEQUENTIAL POSIX_MADV_SEQUENTIAL
++# define MADV_WILLNEED POSIX_MADV_WILLNEED
++# define MADV_DONTNEED POSIX_MADV_DONTNEED
++#endif
++#if defined HAVE_MADVISE || defined HAVE_POSIX_MADVISE
++# define USE_MADVISE 1
++#endif
++
+ /* define strrchr, strchr and memcpy, memmove in terms of bsd funcs
+ make sure you are NOT using bcopy, index or rindex in the code */
+