summaryrefslogtreecommitdiffstats
path: root/config/cmake_ext_mod
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2021-08-17 19:55:18 (GMT)
committerGitHub <noreply@github.com>2021-08-17 19:55:18 (GMT)
commitc0ef1fd6de3ff20cc8fc49c05ca71254c784bea6 (patch)
treefb2bdf05e276e3614b3b5c343447cd82f4e6718b /config/cmake_ext_mod
parent2bca2ca6f1ef1b60bb8541413c5f2e68ff5549d3 (diff)
downloadhdf5-c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6.zip
hdf5-c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6.tar.gz
hdf5-c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6.tar.bz2
Reverts PR 906 and 907 due to binary compatibility issues (#918)
Diffstat (limited to 'config/cmake_ext_mod')
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake35
-rw-r--r--config/cmake_ext_mod/HDFTests.c8
-rw-r--r--config/cmake_ext_mod/HDFUseCXX.cmake11
3 files changed, 51 insertions, 3 deletions
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 9e704fb..004aded 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -53,6 +53,7 @@ if (MINGW)
set (${HDF_PREFIX}_HAVE_MINGW 1)
set (WINDOWS 1) # MinGW tries to imitate Windows
set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
+ set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1)
set (__USE_MINGW_ANSI_STDIO 1)
endif ()
@@ -119,8 +120,23 @@ CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H)
CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H)
CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H)
CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H)
+CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H)
CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H)
+# Windows
+CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H)
+if (NOT CYGWIN)
+ CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H)
+endif ()
+
+if (CMAKE_SYSTEM_NAME MATCHES "OSF")
+ CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H)
+ CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" ${HDF_PREFIX}_HAVE_SYS_PROC_H)
+else ()
+ set (${HDF_PREFIX}_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE)
+ set (${HDF_PREFIX}_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE)
+endif ()
+
CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H)
CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H)
CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H)
@@ -130,9 +146,12 @@ CHECK_INCLUDE_FILE_CONCAT ("strings.h" ${HDF_PREFIX}_HAVE_STRINGS_H)
CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" ${HDF_PREFIX}_HAVE_STDLIB_H)
CHECK_INCLUDE_FILE_CONCAT ("memory.h" ${HDF_PREFIX}_HAVE_MEMORY_H)
CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" ${HDF_PREFIX}_HAVE_DLFCN_H)
+CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" ${HDF_PREFIX}_HAVE_INTTYPES_H)
CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" ${HDF_PREFIX}_HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILE_CONCAT ("netdb.h" ${HDF_PREFIX}_HAVE_NETDB_H)
CHECK_INCLUDE_FILE_CONCAT ("arpa/inet.h" ${HDF_PREFIX}_HAVE_ARPA_INET_H)
+# _Bool type support
+CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H)
## Check for non-standard extenstion quadmath.h
@@ -219,6 +238,11 @@ macro (HDF_FUNCTION_TEST OTHER_TEST)
endmacro ()
#-----------------------------------------------------------------------------
+# Check for these functions before the time headers are checked
+#-----------------------------------------------------------------------------
+HDF_FUNCTION_TEST (STDC_HEADERS)
+
+#-----------------------------------------------------------------------------
# Check for large file support
#-----------------------------------------------------------------------------
@@ -392,9 +416,13 @@ HDF_CHECK_TYPE_SIZE (time_t ${HDF_PREFIX}_SIZEOF_TIME_T)
# Extra C99 types
#-----------------------------------------------------------------------------
-# Size of bool
-set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h)
-HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL)
+# _Bool type support
+if (HAVE_STDBOOL_H)
+ set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h)
+ HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL)
+else ()
+ HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL)
+endif ()
if (MINGW OR NOT WINDOWS)
#-----------------------------------------------------------------------------
@@ -532,6 +560,7 @@ if (MINGW OR NOT WINDOWS)
foreach (other_test
HAVE_ATTRIBUTE
HAVE_C99_FUNC
+# STDC_HEADERS
HAVE_FUNCTION
HAVE_C99_DESIGNATED_INITIALIZER
SYSTEM_SCOPE_THREADS
diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c
index 0c3b7b7..2d7e1b4 100644
--- a/config/cmake_ext_mod/HDFTests.c
+++ b/config/cmake_ext_mod/HDFTests.c
@@ -88,6 +88,14 @@ int main(void)
}
#endif
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+int main() { return 0; }
+#endif /* STDC_HEADERS */
+
#ifdef HAVE_ATTRIBUTE
diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake
index 423f74a..580c409 100644
--- a/config/cmake_ext_mod/HDFUseCXX.cmake
+++ b/config/cmake_ext_mod/HDFUseCXX.cmake
@@ -32,6 +32,17 @@ endif ()
include (CheckIncludeFileCXX)
include (TestForSTDNamespace)
+# IF the c compiler found stdint, check the C++ as well. On some systems this
+# file will be found by C but not C++, only do this test IF the C++ compiler
+# has been initialized (e.g. the project also includes some c++)
+if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED)
+ CHECK_INCLUDE_FILE_CXX ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H_CXX)
+ if (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX)
+ set (${HDF_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H")
+ set (USE_INCLUDES ${USE_INCLUDES} "stdint.h")
+ endif ()
+endif ()
+
# For other CXX specific tests, use this MACRO.
macro (HDF_CXX_FUNCTION_TEST OTHER_TEST)
if (NOT DEFINED ${OTHER_TEST})