1 |
AC_PREREQ(2.59) |
2 |
AC_INIT |
3 |
AC_CONFIG_SRCDIR([libeio/eio.h]) |
4 |
AC_CONFIG_HEADERS([libeio/config.h]) |
5 |
|
6 |
AC_PROG_CC |
7 |
|
8 |
m4_include([libeio/libeio.m4]) |
9 |
|
10 |
dnl at least uclibc defines _POSIX_ADVISORY_INFO without *any* of the required |
11 |
dnl functionality actually being present. ugh. |
12 |
AC_CACHE_CHECK(for posix_madvise, ac_cv_posix_madvise, [AC_LINK_IFELSE([ |
13 |
#include <sys/mman.h> |
14 |
int main (void) |
15 |
{ |
16 |
int res = posix_madvise ((void *)0, (size_t)0, POSIX_MADV_NORMAL); |
17 |
int a = POSIX_MADV_SEQUENTIAL; |
18 |
int b = POSIX_MADV_RANDOM; |
19 |
int c = POSIX_MADV_WILLNEED; |
20 |
int d = POSIX_MADV_DONTNEED; |
21 |
return 0; |
22 |
} |
23 |
],ac_cv_posix_madvise=yes,ac_cv_posix_madvise=no)]) |
24 |
test $ac_cv_posix_madvise = yes && AC_DEFINE(HAVE_POSIX_MADVISE, 1, posix_madvise(2) is available) |
25 |
|
26 |
AC_CACHE_CHECK(for posix_fadvise, ac_cv_posix_fadvise, [AC_LINK_IFELSE([ |
27 |
#define _XOPEN_SOURCE 600 |
28 |
#include <fcntl.h> |
29 |
int main (void) |
30 |
{ |
31 |
int res = posix_fadvise ((int)0, (off_t)0, (off_t)0, POSIX_FADV_NORMAL); |
32 |
int a = POSIX_FADV_SEQUENTIAL; |
33 |
int b = POSIX_FADV_NOREUSE; |
34 |
int c = POSIX_FADV_RANDOM; |
35 |
int d = POSIX_FADV_WILLNEED; |
36 |
int e = POSIX_FADV_DONTNEED; |
37 |
return 0; |
38 |
} |
39 |
],ac_cv_posix_fadvise=yes,ac_cv_posix_fadvise=no)]) |
40 |
test $ac_cv_posix_fadvise = yes && AC_DEFINE(HAVE_POSIX_FADVISE, 1, posix_fadvise(2) is available) |
41 |
|
42 |
AC_OUTPUT |