diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2015-02-23 06:56:16 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2015-02-23 06:56:16 (GMT) |
commit | 7e220930da7e77df1531329d8897befa0dc6399f (patch) | |
tree | 12f84783be1e29da4ede9caf29a1c29b1c8f7e50 /configure.ac | |
parent | 7c134068147c8313fb4303b4d6608a665880e22e (diff) | |
download | hdf5-7e220930da7e77df1531329d8897befa0dc6399f.zip hdf5-7e220930da7e77df1531329d8897befa0dc6399f.tar.gz hdf5-7e220930da7e77df1531329d8897befa0dc6399f.tar.bz2 |
[svn-r26276] Merged r26075-80, 86 from features/autotools_rework branch.
Cleans up time functions in the autotools input files. Removed deprecated
gettimeofday() time zone code and configure processing. Also removed
some unused time function configure checks and defines.
Fixes: HDFFV-9083 and HDFFV-9085
Tested on: 32-bit linux, serial and parallel (jam)
OS X (kite)
Solaris (emu)
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 73 |
1 files changed, 6 insertions, 67 deletions
diff --git a/configure.ac b/configure.ac index 3b8b2eb..f53c8a6 100644 --- a/configure.ac +++ b/configure.ac @@ -997,16 +997,6 @@ dnl AC_CHECK_LIB([coug], [main]) ## ...for ASCI/Red AC_HEADER_STDC AC_HEADER_TIME -## ---------------------------------------------------------------------- -## Check for these two functions before the time headers are checked -## for, otherwise they are not detected correctly on Solaris (the -## configure test will fail due to multiply-defined symbols). -## -AC_CHECK_FUNCS([difftime]) -AC_CHECK_FUNCS([gettimeofday], [have_gettime="yes"], [have_gettime="no"]) -AC_SEARCH_LIBS([clock_gettime], [rt posix4]) -AC_CHECK_FUNCS([clock_gettime],[have_clock_gettime="yes"],[have_clock_gettime="no"]) - ## 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]) @@ -1741,16 +1731,6 @@ AC_TRY_COMPILE([ AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) -## check if `struct tm' has a `__tm_gmtoff' member. -AC_MSG_CHECKING([for __tm_gmtoff in struct tm]) -AC_TRY_COMPILE([ - #include <sys/time.h> - #include <time.h>], [struct tm tm; tm.__tm_gmtoff=0;], - [AC_DEFINE([HAVE___TM_GMTOFF], [1], - [Define if `__tm_gmtoff' is a member of `struct tm']) - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - ## Check whether the global variable `timezone' is defined. AC_MSG_CHECKING([for global timezone variable]) @@ -1769,50 +1749,6 @@ case "`uname`" in ;; esac -## Check whether `struct timezone' is defined. -AC_STRUCT_TIMEZONE -AC_MSG_CHECKING([for struct timezone]) -AC_TRY_COMPILE([ - #include <sys/types.h> - #include <sys/time.h> - #include <time.h>], [struct timezone tz; tz.tz_minuteswest=0;], - [AC_DEFINE([HAVE_STRUCT_TIMEZONE], [1], - [Define if `struct timezone' is defined]) - have_struct_tz="yes" - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - -## If gettimeofday() is going to be used, make sure it uses the timezone struct - -if test "$have_gettime" = "yes" -a "$have_struct_tz" = "yes"; then - AC_MSG_CHECKING(whether gettimeofday() gives timezone) - AC_CACHE_VAL([hdf5_cv_gettimeofday_tz], - [AC_TRY_RUN([ - #include <time.h> - #include <sys/time.h> - int main(void) - { - struct timeval tv; - struct timezone tz; - tz.tz_minuteswest = 7777; /* Initialize to an unreasonable number */ - tz.tz_dsttime = 7; - gettimeofday(&tv, &tz); - /* Check whether the function returned any value at all */ - if(tz.tz_minuteswest == 7777 && tz.tz_dsttime == 7) - exit(1); - else exit (0); - }], - [hdf5_cv_gettimeofday_tz=yes], - [hdf5_cv_gettimeofday_tz=no])]) - - if test ${hdf5_cv_gettimeofday_tz} = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE([GETTIMEOFDAY_GIVES_TZ], [1], - [Define if gettimeofday() populates the tz pointer passed in]) - else - AC_MSG_RESULT([no]) - fi -fi ## ---------------------------------------------------------------------- ## Does the struct stat have the st_blocks field? This field is not Posix. @@ -1870,9 +1806,12 @@ AC_TRY_COMPILE([#include <sys/ioctl.h>],[int w=TIOCGETD;], ## ---------------------------------------------------------------------- ## Check for functions. ## -AC_CHECK_FUNCS([alarm BSDgettimeofday fork frexpf frexpl]) -AC_CHECK_FUNCS([gethostname getpwuid getrusage lstat]) -AC_CHECK_FUNCS([rand_r random setsysinfo]) +## 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 fork frexpf frexpl]) +AC_CHECK_FUNCS([gethostname getpwuid 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([tmpfile asprintf vasprintf waitpid]) |