AC_PREREQ(2.59) AC_INIT AC_CONFIG_HEADERS([config.h]) # Enable GNU extensions. # Define this here, not in acconfig's @TOP@ section, since definitions # in the latter don't make it into the configure-time tests. AC_DEFINE([_GNU_SOURCE], 1, [Enable GNU extenstions]) # do NOT define POSIX_SOURCE, since this clashes with many BSDs dnl AC_DEFINE([_POSIX_SOURCE], 1, [Enable POSIX 1003.1 extensions]) dnl AC_DEFINE([_XOPEN_SOURCE], 500, [Enable XOPEN extensions]) AC_PROG_CC AC_CACHE_CHECK(for readahead, ac_cv_readahead, [AC_LINK_IFELSE([ #include int main(void) { int fd = 0; off64_t offset = 1; size_t count = 2; ssize_t res; res = readahead (fd, offset, count); return 0; } ],ac_cv_readahead=yes,ac_cv_readahead=no)]) test $ac_cv_readahead = yes && AC_DEFINE(HAVE_READAHEAD, 1, readahead(2) is available (linux)) AC_CACHE_CHECK(for fdatasync, ac_cv_fdatasync, [AC_LINK_IFELSE([ #include int main(void) { int fd = 0; fdatasync (fd); return 0; } ],ac_cv_fdatasync=yes,ac_cv_fdatasync=no)]) test $ac_cv_fdatasync = yes && AC_DEFINE(HAVE_FDATASYNC, 1, fdatasync(2) is available) AC_CACHE_CHECK(for pread and pwrite, ac_cv_preadwrite, [AC_LINK_IFELSE([ #include int main(void) { int fd = 0; size_t count = 1; char buf; off_t offset = 1; ssize_t res; res = pread (fd, &buf, count, offset); res = pwrite (fd, &buf, count, offset); return 0; } ],ac_cv_preadwrite=yes,ac_cv_preadwrite=no)]) test $ac_cv_preadwrite = yes && AC_DEFINE(HAVE_PREADWRITE, 1, pread(2) and pwrite(2) are available) AC_OUTPUT