diff options
-rw-r--r-- | config/cmake/ConfigureChecks.cmake | 16 | ||||
-rw-r--r-- | configure.ac | 38 |
2 files changed, 37 insertions, 17 deletions
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 1c3d5f9..5a401f7 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -175,11 +175,17 @@ endif () # Check whether we can build the Mirror VFD # Header-check flags set in config/cmake_ext_mod/ConfigureChecks.cmake # ---------------------------------------------------------------------- -if ( ${HDF_PREFIX}_HAVE_NETINET_IN_H AND - ${HDF_PREFIX}_HAVE_NETDB_H AND - ${HDF_PREFIX}_HAVE_ARPA_INET_H AND - ${HDF_PREFIX}_HAVE_SYS_SOCKET_H) - set (${HDF_PREFIX}_HAVE_MIRROR_VFD 1) +option (HDF5_ENABLE_MIRROR_VFD "Build the Mirror Virtual File Driver" OFF) +if (H5FD_ENABLE_MIRROR_VFD) + if ( ${HDF_PREFIX}_HAVE_NETINET_IN_H AND + ${HDF_PREFIX}_HAVE_NETDB_H AND + ${HDF_PREFIX}_HAVE_ARPA_INET_H AND + ${HDF_PREFIX}_HAVE_SYS_SOCKET_H AND + ${HDF_PREFIX}_HAVE_FORK) + set (${HDF_PREFIX}_HAVE_MIRROR_VFD 1) + else() + message(STATUS "The socket-based Mirror VFD was requested but cannot be built. System prerequisites are not met.") + endif() endif() #----------------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index e6d7535..81e985e 100644 --- a/configure.ac +++ b/configure.ac @@ -2849,24 +2849,38 @@ AM_CONDITIONAL([DIRECT_VFD_CONDITIONAL], [test "X$DIRECT_VFD" = "Xyes"]) AC_SUBST([MIRROR_VFD]) ## Default is no Mirror VFD -MIRROR_VFD=yes +MIRROR_VFD=no -AC_CHECK_HEADERS([arpa/inet.h],, [unset MIRROR_VFD]) -AC_CHECK_HEADERS([netinet/in.h],, [unset MIRROR_VFD]) -AC_CHECK_HEADERS([netdb.h],, [unset MIRROR_VFD]) -AC_CHECK_HEADERS([sys/socket.h],, [unset MIRROR_VFD]) +AC_ARG_ENABLE([mirror-vfd], + [AS_HELP_STRING([--enable-mirror-vfd], + [Build the socket-based Mirror virtual file driver (VFD). + [default=no]])], + [MIRROR_VFD=$enableval], [MIRROR_VFD=no]) -AC_MSG_CHECKING([if the Mirror virtual file driver (VFD) can be built]) if test "X$MIRROR_VFD" = "Xyes"; then - AC_DEFINE([HAVE_MIRROR_VFD], [1], - [Define whether the Mirror virtual file driver (VFD) will be compiled]) - AC_MSG_RESULT([yes]) + + AC_CHECK_HEADERS([arpa/inet.h],, [unset MIRROR_VFD]) + AC_CHECK_HEADERS([netinet/in.h],, [unset MIRROR_VFD]) + AC_CHECK_HEADERS([netdb.h],, [unset MIRROR_VFD]) + AC_CHECK_HEADERS([sys/socket.h],, [unset MIRROR_VFD]) + AC_CHECK_FUNC([fork], [], [unset MIRROR_VFD]) + + AC_MSG_CHECKING([if the Mirror virtual file driver (VFD) can be built]) + if test "X$MIRROR_VFD" = "Xyes"; then + AC_DEFINE([HAVE_MIRROR_VFD], [1], + [Define whether the Mirror virtual file driver (VFD) will be compiled]) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + MIRROR_VFD=no + AC_MSG_ERROR([The Mirror VFD cannot be built. + Missing one or more of: arpa/inet.h, netinet/in.h, + netdb.h, sys/socket.h, fork().]) + fi else + AC_MSG_CHECKING([if the Mirror virtual file driver (VFD) is enabled]) AC_MSG_RESULT([no]) MIRROR_VFD=no - AC_MSG_ERROR([The Mirror VFD cannot be built. - Missing any of: arpa/inet.h, netinet/in.h, netdb.h, - sys/socket.h.]) fi ## Mirror VFD files built only if able. |