1 |
AC_PREREQ(2.59) |
2 |
AC_INIT |
3 |
AC_CONFIG_HEADERS([config.h]) |
4 |
|
5 |
# Enable GNU extensions. |
6 |
# Define this here, not in acconfig's @TOP@ section, since definitions |
7 |
# in the latter don't make it into the configure-time tests. |
8 |
AC_DEFINE([_GNU_SOURCE], 1, [Enable GNU extenstions]) |
9 |
|
10 |
# do NOT define POSIX_SOURCE, since this clashes with many BSDs |
11 |
dnl AC_DEFINE([_POSIX_SOURCE], 1, [Enable POSIX 1003.1 extensions]) |
12 |
dnl AC_DEFINE([_XOPEN_SOURCE], 500, [Enable XOPEN extensions]) |
13 |
|
14 |
AC_PROG_CC |
15 |
|
16 |
AC_CACHE_CHECK(for readahead, ac_cv_readahead, [AC_LINK_IFELSE([ |
17 |
#include <fcntl.h> |
18 |
int main(void) |
19 |
{ |
20 |
int fd = 0; |
21 |
off64_t offset = 1; |
22 |
size_t count = 2; |
23 |
ssize_t res; |
24 |
res = readahead (fd, offset, count); |
25 |
return 0; |
26 |
} |
27 |
],ac_cv_readahead=yes,ac_cv_readahead=no)]) |
28 |
test $ac_cv_readahead = yes && AC_DEFINE(HAVE_READAHEAD, 1, readahead(2) is available (linux)) |
29 |
|
30 |
AC_CACHE_CHECK(for fdatasync, ac_cv_fdatasync, [AC_LINK_IFELSE([ |
31 |
#include <unistd.h> |
32 |
int main(void) |
33 |
{ |
34 |
int fd = 0; |
35 |
fdatasync (fd); |
36 |
return 0; |
37 |
} |
38 |
],ac_cv_fdatasync=yes,ac_cv_fdatasync=no)]) |
39 |
test $ac_cv_fdatasync = yes && AC_DEFINE(HAVE_FDATASYNC, 1, fdatasync(2) is available) |
40 |
|
41 |
AC_CACHE_CHECK(for pread and pwrite, ac_cv_preadwrite, [AC_LINK_IFELSE([ |
42 |
#include <unistd.h> |
43 |
int main(void) |
44 |
{ |
45 |
int fd = 0; |
46 |
size_t count = 1; |
47 |
char buf; |
48 |
off_t offset = 1; |
49 |
ssize_t res; |
50 |
res = pread (fd, &buf, count, offset); |
51 |
res = pwrite (fd, &buf, count, offset); |
52 |
return 0; |
53 |
} |
54 |
],ac_cv_preadwrite=yes,ac_cv_preadwrite=no)]) |
55 |
test $ac_cv_preadwrite = yes && AC_DEFINE(HAVE_PREADWRITE, 1, pread(2) and pwrite(2) are available) |
56 |
|
57 |
AC_OUTPUT |