From f415d6f839f35d595b77483e0788e76c652b7520 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Tue, 24 Aug 2021 06:31:15 -0700 Subject: Normalizes 1.0 build files w/ 1.12 and develop (#957) --- config/cmake/H5pubconf.h.in | 57 +++++++++++++ config/cmake_ext_mod/ConfigureChecks.cmake | 68 +++++++++++---- config/cmake_ext_mod/HDFTests.c | 33 ++++++++ configure.ac | 128 ++++++++++++++++++++++------- 4 files changed, 241 insertions(+), 45 deletions(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index a8c9596..2b98327 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -202,9 +202,15 @@ optimization operation */ #cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_INTTYPES_H @H5_HAVE_INTTYPES_H@ + /* Define to 1 if you have the `ioctl' function. */ #cmakedefine H5_HAVE_IOCTL @H5_HAVE_IOCTL@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_IO_H @H5_HAVE_IO_H@ + /* Define to 1 if you have the `crypto' library (-lcrypto). */ #cmakedefine H5_HAVE_LIBCRYPTO @H5_HAVE_LIBCRYPTO@ @@ -241,6 +247,21 @@ /* Define to 1 if you have the `z' library (-lz). */ #cmakedefine H5_HAVE_LIBZ @H5_HAVE_LIBZ@ +/* Define to 1 if you have the `llround' function. */ +#cmakedefine H5_HAVE_LLROUND @H5_HAVE_LLROUND@ + +/* Define to 1 if you have the `llroundf' function. */ +#cmakedefine H5_HAVE_LLROUNDF @H5_HAVE_LLROUNDF@ + +/* Define to 1 if you have the `longjmp' function. */ +#cmakedefine H5_HAVE_LONGJMP @H5_HAVE_LONGJMP@ + +/* Define to 1 if you have the `lround' function. */ +#cmakedefine H5_HAVE_LROUND @H5_HAVE_LROUND@ + +/* Define to 1 if you have the `lroundf' function. */ +#cmakedefine H5_HAVE_LROUNDF @H5_HAVE_LROUNDF@ + /* Define to 1 if you have the `lseek64' function. */ #cmakedefine H5_HAVE_LSEEK64 @H5_HAVE_LSEEK64@ @@ -305,12 +326,27 @@ compiled */ #cmakedefine H5_HAVE_ROS3_VFD @H5_HAVE_ROS3_VFD@ +/* Define to 1 if you have the `round' function. */ +#cmakedefine H5_HAVE_ROUND @H5_HAVE_ROUND@ + +/* Define to 1 if you have the `roundf' function. */ +#cmakedefine H5_HAVE_ROUNDF @H5_HAVE_ROUNDF@ + +/* Define to 1 if you have the `setjmp' function. */ +#cmakedefine H5_HAVE_SETJMP @H5_HAVE_SETJMP@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SETJMP_H @H5_HAVE_SETJMP_H@ + /* Define to 1 if you have the `setsysinfo' function. */ #cmakedefine H5_HAVE_SETSYSINFO @H5_HAVE_SETSYSINFO@ /* Define to 1 if you have the `siglongjmp' function. */ #cmakedefine H5_HAVE_SIGLONGJMP @H5_HAVE_SIGLONGJMP@ +/* Define to 1 if you have the `signal' function. */ +#cmakedefine H5_HAVE_SIGNAL @H5_HAVE_SIGNAL@ + /* Define to 1 if you have the `sigprocmask' function. */ #cmakedefine H5_HAVE_SIGPROCMASK @H5_HAVE_SIGPROCMASK@ @@ -329,6 +365,18 @@ /* Define if struct stat has the st_blocks field */ #cmakedefine H5_HAVE_STAT_ST_BLOCKS @H5_HAVE_STAT_ST_BLOCKS@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STDBOOL_H @H5_HAVE_STDBOOL_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STDDEF_H @H5_HAVE_STDDEF_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STDINT_H @H5_HAVE_STDINT_H@ + +/* Define to 1 if you have the header file for Cplusplus. */ +#cmakedefine H5_HAVE_STDINT_H_CXX @H5_HAVE_STDINT_H_CXX@ + /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_STDLIB_H @H5_HAVE_STDLIB_H@ @@ -356,6 +404,9 @@ /* Define to 1 if you have the `symlink' function. */ #cmakedefine H5_HAVE_SYMLINK @H5_HAVE_SYMLINK@ +/* Define to 1 if you have the `system' function. */ +#cmakedefine H5_HAVE_SYSTEM @H5_HAVE_SYSTEM@ + /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_SYS_FILE_H @H5_HAVE_SYS_FILE_H@ @@ -421,6 +472,9 @@ /* Define if your system has window style path name. */ #cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_WINSOCK2_H @H5_HAVE_WINSOCK2_H@ + /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_ZLIB_H @H5_HAVE_ZLIB_H@ @@ -663,6 +717,9 @@ /* The size of `__int64', as computed by sizeof. */ #define H5_SIZEOF___INT64 @H5_SIZEOF___INT64@ +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine H5_STDC_HEADERS @H5_STDC_HEADERS@ + /* Define if strict file format checks are enabled */ #cmakedefine H5_STRICT_FORMAT_CHECKS @H5_STRICT_FORMAT_CHECKS@ diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 8244a8d..45b62ea 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 () @@ -71,6 +72,8 @@ if (WINDOWS) set (${HDF_PREFIX}_HAVE_WIN32_API 1) set (${HDF_PREFIX}_HAVE_LIBM 1) set (${HDF_PREFIX}_HAVE_STRDUP 1) + set (${HDF_PREFIX}_HAVE_SYSTEM 1) + set (${HDF_PREFIX}_HAVE_LONGJMP 1) if (NOT MINGW) set (${HDF_PREFIX}_HAVE_GETHOSTNAME 1) set (${HDF_PREFIX}_HAVE_FUNCTION 1) @@ -115,8 +118,26 @@ CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" ${HDF_PREFIX}_HAVE_SYS_TIME_H) CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" ${HDF_PREFIX}_HAVE_SYS_TYPES_H) 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) CHECK_INCLUDE_FILE_CONCAT ("pwd.h" ${HDF_PREFIX}_HAVE_PWD_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) @@ -126,9 +147,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 @@ -215,6 +239,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 #----------------------------------------------------------------------------- @@ -366,15 +395,13 @@ HDF_CHECK_TYPE_SIZE (uint_least64_t ${HDF_PREFIX}_SIZEOF_UINT_LEAST64_T) HDF_CHECK_TYPE_SIZE (int_fast64_t ${HDF_PREFIX}_SIZEOF_INT_FAST64_T) HDF_CHECK_TYPE_SIZE (uint_fast64_t ${HDF_PREFIX}_SIZEOF_UINT_FAST64_T) -if (NOT APPLE) - HDF_CHECK_TYPE_SIZE (size_t ${HDF_PREFIX}_SIZEOF_SIZE_T) - HDF_CHECK_TYPE_SIZE (ssize_t ${HDF_PREFIX}_SIZEOF_SSIZE_T) - if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T) - set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0) - endif () - if (MINGW OR NOT WINDOWS) - HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T) - endif () +HDF_CHECK_TYPE_SIZE (size_t ${HDF_PREFIX}_SIZEOF_SIZE_T) +HDF_CHECK_TYPE_SIZE (ssize_t ${HDF_PREFIX}_SIZEOF_SSIZE_T) +if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T) + set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0) +endif () +if (MINGW OR NOT WINDOWS) + HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T) endif () HDF_CHECK_TYPE_SIZE (off_t ${HDF_PREFIX}_SIZEOF_OFF_T) @@ -388,9 +415,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) #----------------------------------------------------------------------------- @@ -482,6 +513,9 @@ CHECK_FUNCTION_EXISTS (round ${HDF_PREFIX}_HAVE_ROUND) CHECK_FUNCTION_EXISTS (roundf ${HDF_PREFIX}_HAVE_ROUNDF) CHECK_FUNCTION_EXISTS (setsysinfo ${HDF_PREFIX}_HAVE_SETSYSINFO) +CHECK_FUNCTION_EXISTS (signal ${HDF_PREFIX}_HAVE_SIGNAL) +CHECK_FUNCTION_EXISTS (longjmp ${HDF_PREFIX}_HAVE_LONGJMP) +CHECK_FUNCTION_EXISTS (setjmp ${HDF_PREFIX}_HAVE_SETJMP) CHECK_FUNCTION_EXISTS (siglongjmp ${HDF_PREFIX}_HAVE_SIGLONGJMP) CHECK_FUNCTION_EXISTS (sigsetjmp ${HDF_PREFIX}_HAVE_SIGSETJMP) CHECK_FUNCTION_EXISTS (sigprocmask ${HDF_PREFIX}_HAVE_SIGPROCMASK) @@ -492,6 +526,7 @@ CHECK_FUNCTION_EXISTS (strdup ${HDF_PREFIX}_HAVE_STRDUP) CHECK_FUNCTION_EXISTS (strtoll ${HDF_PREFIX}_HAVE_STRTOLL) CHECK_FUNCTION_EXISTS (strtoull ${HDF_PREFIX}_HAVE_STRTOULL) CHECK_FUNCTION_EXISTS (symlink ${HDF_PREFIX}_HAVE_SYMLINK) +CHECK_FUNCTION_EXISTS (system ${HDF_PREFIX}_HAVE_SYSTEM) CHECK_FUNCTION_EXISTS (tmpfile ${HDF_PREFIX}_HAVE_TMPFILE) CHECK_FUNCTION_EXISTS (asprintf ${HDF_PREFIX}_HAVE_ASPRINTF) @@ -509,9 +544,11 @@ endif () # sigsetjmp is special; may actually be a macro #----------------------------------------------------------------------------- if (NOT ${HDF_PREFIX}_HAVE_SIGSETJMP) - CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" ${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) - if (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) - set (${HDF_PREFIX}_HAVE_SIGSETJMP 1) + if (${HDF_PREFIX}_HAVE_SETJMP_H) + CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" ${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) + if (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) + set (${HDF_PREFIX}_HAVE_SIGSETJMP 1) + endif () endif () endif () @@ -522,6 +559,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 b8a6af1..2d7e1b4 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -64,6 +64,39 @@ main () #endif +#ifdef VSNPRINTF_WORKS +#include +#include +#include + +int test_vsnprintf(const char *fmt,...) +{ + va_list ap; + char *s = malloc(16); + int ret; + + va_start(ap, fmt); + ret=vsnprintf(s,16,"%s",ap); + va_end(ap); + + return(ret!=42 ? 1 : 0); +} + +int main(void) +{ + return(test_vsnprintf("%s","A string that is longer than 16 characters")); +} +#endif + +#ifdef STDC_HEADERS +#include +#include +#include +#include +int main() { return 0; } +#endif /* STDC_HEADERS */ + + #ifdef HAVE_ATTRIBUTE #if 0 diff --git a/configure.ac b/configure.ac index 44186cc..fb81c2d 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,6 @@ ## ---------------------------------------------------------------------- ## Initialize configure. ## -AC_REVISION($Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest $) AC_PREREQ([2.69]) ## AC_INIT takes the name of the package, the version number, and an @@ -37,17 +36,45 @@ AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign subdir-objects]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # use silent rules where available - automake 1.11 -## AM_MAINTAINER_MODE turns off "rebuild rules" that contain dependencies -## for Makefiles, configure, src/H5config.h, etc. If AM_MAINTAINER_MODE -## is enabled, these files will be rebuilt if out of date. This is a -## problem because if users try to build on a machine with -## the wrong versions of autoconf and automake, these files will be -## rebuilt with the wrong versions and bad things can happen. -## Also, CVS doesn't preserve dependencies between timestamps, so -## Makefiles will often think rebuilding needs to occur when it doesn't. +## AM_MAINTAINER_MODE determines the behavior of "rebuild rules" that contain +## dependencies for Makefile.in files, configure, src/H5config.h, etc. If +## AM_MAINTAINER_MODE is enabled, these files will be rebuilt if out of date. +## When disabled, the autotools build files can get out of sync and the build +## system will not complain or try to regenerate downstream files. ## -## By default, it is enabled. Users can configure with -## --disable-maintainer-mode to prevent running the autotools. +## The AM_MAINTAINER_MODE macro also determines whether the +## --(enable|disable)-maintainer-mode configure option is available. When the +## macro is present, with or without a parameter, the option will be added +## to the generated configure script. +## +## In summary: +## +## AM_MAINTAINER_MODE([enable]) +## - Build dependencies ON by default +## - Configure option exists +## +## AM_MAINTAINER_MODE([disable]) +## - Build dependencies OFF by default +## - Configure option exists +## +## AM_MAINTAINER_MODE +## - Build dependencies OFF by default +## - Configure option exists +## +## No AM_MAINTAINER_MODE macro +## - Build dependencies ON by default +## - No configure option to control build dependencies +## +## The biggest concern for us is that version control systems like git +## usually don't preserve dependencies between timestamps, so the build +## system will often think that upstream build files like Makefile.am are +## dirty and that rebuilding needs to occur when it doesn't. This is a problem +## in release branches where we provide the autotools-generated files. Users +## who don't have autoconf, automake, etc. will then have difficulty building +## release branches checked out from git. +## +## By default, maintainer mode is enabled in development branches and disabled +## in release branches. AM_MAINTAINER_MODE([enable]) ## ---------------------------------------------------------------------- @@ -68,12 +95,12 @@ AC_CONFIG_COMMANDS([pubconf], [ sed 's/#define /#define H5_/' pubconf if test ! -f src/H5pubconf.h; then - /bin/mv -f pubconf src/H5pubconf.h + mv -f pubconf src/H5pubconf.h elif (diff pubconf src/H5pubconf.h >/dev/null); then rm -f pubconf echo "src/H5pubconf.h is unchanged" else - /bin/mv -f pubconf src/H5pubconf.h + mv -f pubconf src/H5pubconf.h fi echo "Post process src/libhdf5.settings" sed '/^#/d' < src/libhdf5.settings > libhdf5.settings.TMP @@ -1220,11 +1247,10 @@ AC_HEADER_STDC AC_HEADER_TIME ## Unix -AC_CHECK_HEADERS([sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h]) -AC_CHECK_HEADERS([sys/socket.h sys/types.h sys/file.h]) -AC_CHECK_HEADERS([features.h]) -AC_CHECK_HEADERS([dirent.h pwd.h]) -AC_CHECK_HEADERS([netdb.h netinet/in.h arpa/inet.h]) +AC_CHECK_HEADERS([dirent.h features.h pwd.h setjmp.h stdbool.h stddef.h unistd.h]) +AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/resource.h]) +AC_CHECK_HEADERS([sys/stat.h sys/time.h sys/types.h]) +AC_CHECK_HEADERS([stdint.h], [C9x=yes]) ## Darwin AC_SUBST([H5_IS_DARWIN]) @@ -1239,18 +1265,21 @@ esac ## Windows case "`uname`" in CYGWIN*) - AC_CHECK_HEADERS([sys/timeb.h]) + AC_CHECK_HEADERS([io.h sys/timeb.h]) UNAME_CYGWIN="yes" ;; MINGW*) - AC_CHECK_HEADERS([winsock2.h sys/timeb.h]) + AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h]) AC_HAVE_LIBRARY([ws2_32]) ;; *) - AC_CHECK_HEADERS([winsock2.h sys/timeb.h]) + AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h]) ;; esac +# Mirror VFD networking +AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h sys/socket.h]) + ## ---------------------------------------------------------------------- ## Some platforms require that all symbols are resolved when a library ## is linked. We can use the -no-undefined flag to tell libtool that @@ -1338,6 +1367,17 @@ CFLAGS="$H5_CFLAGS $AM_CFLAGS $CFLAGS" ## Checkpoint the cache AC_CACHE_SAVE +## Posix.1g types (C9x) +cat >>confdefs.h <<\EOF +#include +EOF + +if test "X$C9x" = "Xyes"; then + cat >>confdefs.h <<\EOF +#include +EOF +fi + AC_CHECK_SIZEOF( [int8_t]) AC_CHECK_SIZEOF( [uint8_t]) AC_CHECK_SIZEOF( [int_least8_t]) @@ -1366,13 +1406,34 @@ AC_CHECK_SIZEOF([uint_least64_t]) AC_CHECK_SIZEOF( [int_fast64_t]) AC_CHECK_SIZEOF( [uint_fast64_t]) - -AC_CHECK_SIZEOF([bool], [], [#include ]) -AC_CHECK_SIZEOF([off_t]) -AC_CHECK_SIZEOF([ptrdiff_t]) AC_CHECK_SIZEOF([size_t]) AC_CHECK_SIZEOF([ssize_t]) -AC_CHECK_SIZEOF([time_t], [], [#include ]) +AC_CHECK_SIZEOF([ptrdiff_t]) + +cat >>confdefs.h <<\EOF +#include /*for off_t definition*/ +EOF +AC_CHECK_SIZEOF([off_t]) + +if test "X$C9x" = "Xyes"; then + cat >>confdefs.h <<\EOF +#ifdef HAVE_STDBOOL_H +#include /* for bool definition */ +#else +#define bool _Bool +#endif +EOF +AC_CHECK_SIZEOF([bool]) +fi + +AC_CHECK_SIZEOF(time_t, [], [ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_TIME_H +#include +#endif +]) ## Checkpoint the cache AC_CACHE_SAVE @@ -1723,8 +1784,13 @@ AM_CONDITIONAL([BUILD_SHARED_SZIP_CONDITIONAL], [test "X$USE_FILTER_SZIP" = "Xye AC_CACHE_SAVE ## ---------------------------------------------------------------------- -## Enable thread-safe version of library. It requires Pthreads support -## on POSIX systems. +## Enable thread-safe version of library (requires Pthreads on POSIX +## systems). We usually pick up the system Pthreads library, so --with-pthread +## is only necessary if you are using a custom Pthreads library or if +## your OS hides its implementation in an unusual location. +## +## On Windows, we use Win32 threads and no special configuration should be +## required to use them. ## AC_SUBST([THREADSAFE]) @@ -1877,8 +1943,10 @@ if test "X$THREADSAFE" = "Xyes"; then AC_CACHE_VAL([hdf5_cv_system_scope_threads], [AC_RUN_IFELSE( [AC_LANG_PROGRAM([ + #if STDC_HEADERS #include #include + #endif ],[ pthread_attr_t attribute; int ret; @@ -2003,13 +2071,13 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ## NOTE: clock_gettime may require linking to the rt or posix4 library ## so we'll search for it before calling AC_CHECK_FUNCS. AC_SEARCH_LIBS([clock_gettime], [rt posix4]) -AC_CHECK_FUNCS([alarm clock_gettime difftime fcntl flock fork frexpf]) +AC_CHECK_FUNCS([alarm asprintf clock_gettime difftime fcntl flock fork frexpf]) AC_CHECK_FUNCS([frexpl gethostname getrusage gettimeofday]) AC_CHECK_FUNCS([lstat rand_r random setsysinfo]) AC_CHECK_FUNCS([signal longjmp setjmp siglongjmp sigsetjmp sigprocmask]) AC_CHECK_FUNCS([snprintf srandom strdup symlink system]) AC_CHECK_FUNCS([strtoll strtoull]) -AC_CHECK_FUNCS([tmpfile asprintf vasprintf vsnprintf waitpid]) +AC_CHECK_FUNCS([tmpfile vasprintf vsnprintf waitpid]) AC_CHECK_FUNCS([roundf lroundf llroundf round lround llround]) ## ---------------------------------------------------------------------- -- cgit v0.12