]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: work around lack of MacOS fdatasync
authorEric Blake <eblake@redhat.com>
Fri, 16 Sep 2011 15:12:07 +0000 (09:12 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 16 Sep 2011 23:42:28 +0000 (17:42 -0600)
Mingw lacks fsync, but gnulib provides that.  Meanwhile, gnulib does
not (yet) provide fdatasync, so this is a quick hack to fake that
function on MacOS X; we can revert this configure change once gnulib
gives us a real module.

We have been implicitly relying on gnulib's largefile module being
pulled in by other modules, but it's better to make that explicit.

* bootstrap.conf (gnulib_modules): Add fsync.  Make largefile use
explicit.
* configure.ac (AC_CHECK_FUNCS_ONCE): Check for fdatasync, and
fake it with fsync when not present.

bootstrap.conf
configure.ac

index 94af05134c7133f496ca79776732d40d13e59d12..d029253d3a81dc779b0a02f959c1dc8beba9498c 100644 (file)
@@ -42,6 +42,7 @@ fcntl
 fcntl-h
 ffs
 fnmatch
+fsync
 func
 getaddrinfo
 getcwd-lgpl
@@ -57,6 +58,7 @@ ignore-value
 inet_pton
 intprops
 ioctl
+largefile
 listen
 maintainer-makefile
 manywarnings
index 0c6d5248443c5db00798a9303938d68e32b2cf3b..ad9d7541c69e1997b9f69d8353e993ae023c05a1 100644 (file)
@@ -135,9 +135,12 @@ AC_CHECK_SIZEOF([long])
 
 dnl Availability of various common functions (non-fatal if missing),
 dnl and various less common threadsafe functions
-AC_CHECK_FUNCS_ONCE([cfmakeraw geteuid getgid getgrnam_r getmntent_r \
+AC_CHECK_FUNCS_ONCE([cfmakeraw fdatasync geteuid getgid getgrnam_r getmntent_r \
   getpwuid_r getuid initgroups kill mmap posix_fallocate posix_memalign \
   regexec sched_getaffinity])
+if test $ac_cv_func_fdatasync = no; then
+  AC_DEFINE([fdatasync], [fsync], [Define to fsync if you lack fdatasync])
+fi
 
 dnl Availability of pthread functions (if missing, win32 threading is
 dnl assumed).  Because of $LIB_PTHREAD, we cannot use AC_CHECK_FUNCS_ONCE.