summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-01-30 09:42:26 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-01-30 09:42:26 (GMT)
commit21a38c4e6793817a539931e27b97867d9bb50d1f (patch)
tree7ea94967d98b716ec82ad9479a22cc6d4765b605 /configure.ac
parentec45cabfc767b4ae29e654a207d64948aaf1b394 (diff)
downloadhdf5-21a38c4e6793817a539931e27b97867d9bb50d1f.zip
hdf5-21a38c4e6793817a539931e27b97867d9bb50d1f.tar.gz
hdf5-21a38c4e6793817a539931e27b97867d9bb50d1f.tar.bz2
[svn-r26084] Configure now just checks for O_DIRECT being defined instead of trying
to build and run a program using it, which is problematic (depends on file system, issues with cross-compiling). Part of HDFFV-9057 Tested on: jam (configure only)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac38
1 files changed, 14 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac
index 3a14090..1a8f204 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2531,32 +2531,22 @@ AC_ARG_ENABLE([direct-vfd],
flag. [default=no]])],
[DIRECT_VFD=$enableval], [DIRECT_VFD=no])
-if test "$DIRECT_VFD" = "yes"; then
- AC_CACHE_VAL([hdf5_cv_direct_io],
- [AC_TRY_RUN([
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- int main(void)
- {
- int fid;
- if((fid=open("tst_file", O_CREAT | O_TRUNC | O_DIRECT, 0755))<0)
- exit(1);
- close(fid);
- remove("tst_file");
- exit (0);
- }], [AC_TRY_LINK(, [posix_memalign()], [hdf5_cv_direct_io=yes], [hdf5_cv_direct_io=no])], [hdf5_cv_direct_io=no],)])
-
- if test ${hdf5_cv_direct_io} = "yes"; then
- AC_MSG_RESULT([yes])
- AC_DEFINE([HAVE_DIRECT], [1],
+if test "X$DIRECT_VFD" = "Xyes"; then
+ AC_CACHE_VAL([hdf5_cv_direct_io],
+ AC_CHECK_DECL([O_DIRECT], [hdf5_cv_direct_io=yes], [hdf5_cv_direct_io=no], [[#include <fcntl.h>]]))
+ AC_CACHE_VAL([hdf5_cv_posix_memalign],
+ AC_TRY_LINK(, [posix_memalign()], [hdf5_cv_posix_memalign=yes], [hdf5_cv_posix_memalign=no]))
+
+ if test ${hdf5_cv_direct_io} = "yes" && test ${hdf5_cv_posix_memalign} = "yes" ; then
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_DIRECT], [1],
[Define if the direct I/O virtual file driver (VFD) should be compiled])
- else
- AC_MSG_RESULT([no])
- DIRECT_VFD=no
- fi
+ else
+ AC_MSG_RESULT([no])
+ DIRECT_VFD=no
+ fi
else
- AC_MSG_RESULT([suppressed])
+ AC_MSG_RESULT([suppressed])
fi
AM_CONDITIONAL([DIRECT_VFD_CONDITIONAL], [test "X$DIRECT_VFD" = "Xyes"])