summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2019-02-19 22:49:20 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2019-02-19 22:49:20 (GMT)
commit32ea4e72f1e85e0e7ff6457aae0bd210e56d1cad (patch)
treecfaf3296e7dddf11bba56dc00b78327c85eb63d0 /configure.ac
parent536a32c59be69f9ae75604a31d0ec34c57cf9f00 (diff)
parentb901552b1ca315db8b27ea090011f2f557491d46 (diff)
downloadhdf5-32ea4e72f1e85e0e7ff6457aae0bd210e56d1cad.zip
hdf5-32ea4e72f1e85e0e7ff6457aae0bd210e56d1cad.tar.gz
hdf5-32ea4e72f1e85e0e7ff6457aae0bd210e56d1cad.tar.bz2
Merge branch 'develop' into c_stdlib_posix_call_cleanup
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])