summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-08-14 19:35:07 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-08-14 19:35:07 (GMT)
commit039213d919c0bcb8f01805f34b9ff6889b06158f (patch)
treeb5c2158184ccb0c9556a4d1f89931d210d9576ca /configure.ac
parentb8b219d19d158d272cd6b1037bbc8d6e3d64fc73 (diff)
downloadhdf5-039213d919c0bcb8f01805f34b9ff6889b06158f.zip
hdf5-039213d919c0bcb8f01805f34b9ff6889b06158f.tar.gz
hdf5-039213d919c0bcb8f01805f34b9ff6889b06158f.tar.bz2
Brings file locking changes from develop
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac50
1 files changed, 50 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index db0d1f0..5e5db4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2315,6 +2315,56 @@ case "X-$OPTIMIZATION" in
esac
## ----------------------------------------------------------------------
+## Check if file locking should be used
+##
+AC_MSG_CHECKING([enable file locking])
+AC_ARG_ENABLE([file-locking],
+ [AS_HELP_STRING([--enable-file-locking=(yes|no|best-effort)],
+ [Sets the default for whether or not to use file
+ locking when opening files. Can be overridden
+ with the HDF5_USE_FILE_LOCKING environment variable
+ and the H5Pset_file_locking() API call.
+ best-effort attempts to use file locking but does
+ not fail when file locks have been disabled on
+ the file system (useful with Lustre).
+ [default=best-effort]
+ ])],
+ [DESIRED_FILE_LOCKING=$enableval])
+
+## Set defaults
+if test "X-$DESIRED_FILE_LOCKING" = X- ; then
+ DESIRED_FILE_LOCKING=best-effort
+fi
+
+## Allow this variable to be substituted in
+## other files (src/libhdf5.settings.in, etc.)
+AC_SUBST([DESIRED_FILE_LOCKING])
+AC_SUBST([USE_FILE_LOCKING])
+AC_SUBST([IGNORE_DISABLED_FILE_LOCKS])
+
+case "X-$DESIRED_FILE_LOCKING" in
+ X-best-effort)
+ AC_MSG_RESULT([best-effort])
+ AC_DEFINE([USE_FILE_LOCKING], [1],
+ [Define if the library will use file locking])
+ AC_DEFINE([IGNORE_DISABLED_FILE_LOCKS], [1],
+ [Define if the library will ignore file locks when disabled])
+ ;;
+ X-yes)
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([USE_FILE_LOCKING], [1],
+ [Define if the library will use file locking])
+ ;;
+ X-no)
+ AC_MSG_RESULT([no])
+ ;;
+ *)
+ AC_MSG_ERROR([Unrecognized value: $USE_FILE_LOCKING])
+ ;;
+esac
+
+
+## ----------------------------------------------------------------------
## Enable/disable internal package-level debugging output
##
AC_MSG_CHECKING([for internal debug output])