summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2019-01-31 01:32:40 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2019-01-31 01:32:40 (GMT)
commitf833001e3948c1088e09697c1b1820313e0d65e4 (patch)
tree097b9e60152f2ee2cb8bad1541174995768ba99b /configure.ac
parent9149d5a5352de4e0b9a2e57c91525a6cad767760 (diff)
downloadhdf5-f833001e3948c1088e09697c1b1820313e0d65e4.zip
hdf5-f833001e3948c1088e09697c1b1820313e0d65e4.tar.gz
hdf5-f833001e3948c1088e09697c1b1820313e0d65e4.tar.bz2
Updated sec2, log, and core VFDs to use pread/pwrite when
available (can be controlled via a configure/CMake option)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac46
1 files changed, 44 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 25c4b78..30fe725 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1130,11 +1130,12 @@ case "$host_cpu-$host_vendor-$host_os" in
## functionality so clock_gettime and CLOCK_MONOTONIC are defined
## correctly. This was later updated to 200112L so that
## posix_memalign() is visible for the direct VFD code on Linux
- ## systems.
+ ## systems. Even later, this was changed to 200809L to support
+ ## pread/pwrite in VFDs.
##
## POSIX feature information can be found in the gcc manual at:
## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html
- H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS"
+ H5_CPPFLAGS="-D_POSIX_C_SOURCE=200809L $H5_CPPFLAGS"
## Need to add this so that O_DIRECT is visible for the direct
## VFD on Linux systems.
@@ -3266,6 +3267,47 @@ esac
## ----------------------------------------------------------------------
+## Enable use of pread/pwrite instead of read/write in certain VFDs.
+##
+AC_SUBST([PREADWRITE])
+
+## Check these first to avoid interspersed output in the AC_ARG_ENABLE line
+## below. (Probably overkill to check for both, but we'll be extra careful)
+PREADWRITE_HAVE_BOTH=yes
+AC_CHECK_FUNC([pread], [], [PREADWRITE_HAVE_BOTH=no])
+AC_CHECK_FUNC([pwrite], [], [PREADWRITE_HAVE_BOTH=no])
+
+AC_MSG_CHECKING([whether to use pread/pwrite instead of read/write in certain VFDs])
+AC_ARG_ENABLE([preadwrite],
+ [AS_HELP_STRING([--enable-preadwrite],
+ [Enable using pread/pwrite instead of read/write in sec2/log/core VFDs.
+ [default=yes if pread/pwrite are present]])],
+ [PREADWRITE=$enableval])
+
+## Set the default level.
+if test "X-$PREADWRITE" = X- ; then
+ PREADWRITE=yes
+fi
+
+case "X-$PREADWRITE" in
+ X-yes)
+ if test "X-$PREADWRITE_HAVE_BOTH" = "X-yes"; then
+ AC_DEFINE([HAVE_PREADWRITE], [1], [Define if both pread and pwrite exist.])
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ X-no)
+ AC_MSG_RESULT([no])
+ ;;
+ *)
+ AC_MSG_ERROR([Unrecognized value: $PREADWRITE])
+ ;;
+esac
+
+
+## ----------------------------------------------------------------------
## Enable embedded library information
##
AC_MSG_CHECKING([whether to have library information embedded in the executables])