aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Herbert Valerio Riedel <hvr@gnu.org>2015-12-16 17:28:40 +0100
committerGravatar Herbert Valerio Riedel <hvr@gnu.org>2015-12-16 17:33:53 +0100
commit5d5b74716b696b0f22c37a88ccc5c114b13f0398 (patch)
tree68b62c9e5b32fe3ae6077b096a72ea5c40815c87 /configure.ac
parent59edb0a0a0d91ecfe938029b3b00a0c99dcb8481 (diff)
Improve detection of `fdatasync(2)`
This attempts a simpler and hopefully more robust test for `fdatasync(2)` See 94d8824bae10c9d91f56c1aee9c45a90136a1770 / #42 for the previous attempt. This hopefully addresses #52 in a better way than #53
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac23
1 files changed, 6 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index c363e10..24ea3a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,23 +71,12 @@ AC_CHECK_FUNCS([mkstemps mkdtemp])
# Functions for file synchronization and allocation control
AC_CHECK_FUNCS([fsync])
-# A more comprehensive check that fdatasync exits
-# Necessary for platforms that have fdatasync in headers but have no
-# implementation
-dnl Originally provided by user copiousfreetime for the beanstalkd project
-dnl {{{ make sure that fdatasync exits
-AC_CACHE_CHECK([for fdatasync],[ac_cv_func_fdatasync],[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <unistd.h>
-]],[[
-fdatasync(4);
-]])],
-[ac_cv_func_fdatasync=yes],
-[ac_cv_func_fdatasync=no])
-])
-AS_IF([test "x${ac_cv_func_fdatasync}" = "xyes"],
- [AC_DEFINE([HAVE_FDATASYNC],[1],[If the system defines fdatasync])])
-dnl }}}
+# On OSX linking against 'fdatasync' succeeds, but that doesn't pick
+# the expected the POSIX 'fdatasync' function. So make sure that we
+# also have a function declaration in scope, in addition to being able
+# to link against 'fdatasync'.
+AC_CHECK_DECLS([fdatasync],[AC_CHECK_FUNCS([fdatasync])])
+
AC_CHECK_FUNCS([posix_fadvise posix_fallocate])