Add enable-mirror-vfd flag to configure options.

This commit is contained in:
Jacob Smith 2020-04-08 16:51:38 -05:00
parent 075e74e9b2
commit 664fc6af47
2 changed files with 37 additions and 17 deletions

View File

@ -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()
#-----------------------------------------------------------------------------

View File

@ -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.