diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-08-03 16:11:27 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-08-03 16:11:27 (GMT) |
commit | bc1bed2c55981f1802f87f83054d375431a0088f (patch) | |
tree | 7f89238033aebca038770f6da775e13ec6902712 /configure.ac | |
parent | 66ce984dee99b7b58ec4632fecad3b2b758d08d5 (diff) | |
download | hdf5-bc1bed2c55981f1802f87f83054d375431a0088f.zip hdf5-bc1bed2c55981f1802f87f83054d375431a0088f.tar.gz hdf5-bc1bed2c55981f1802f87f83054d375431a0088f.tar.bz2 |
Squash merge of file locking fixes
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index f79e9e6..6e0b4c7 100644 --- a/configure.ac +++ b/configure.ac @@ -2316,6 +2316,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]) |