mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-31 17:10:47 +08:00
[svn-r9056]
Purpose: Bug fix Description: Fixed gettimeofday configure test to use cache values Platforms tested: copper, arabica, verbena, sleipnir Misc. update:
This commit is contained in:
parent
6ae26dba82
commit
a23f1c800d
41
configure
vendored
41
configure
vendored
@ -30305,7 +30305,10 @@ rm -f conftest.$ac_objext conftest.$ac_ext
|
||||
if test "$have_gettime" = "yes" -a "$have_struct_tz" = "yes"; then
|
||||
echo "$as_me:$LINENO: checking whether gettimeofday() gives timezone" >&5
|
||||
echo $ECHO_N "checking whether gettimeofday() gives timezone... $ECHO_C" >&6
|
||||
if test "$cross_compiling" = yes; then
|
||||
if test "${hdf5_cv_gettimeofday_tz+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
if test "$cross_compiling" = yes; then
|
||||
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5
|
||||
echo "$as_me: error: cannot run test program while cross compiling" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
@ -30314,20 +30317,20 @@ else
|
||||
#line $LINENO "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#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);
|
||||
}
|
||||
#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);
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
@ -30340,18 +30343,20 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
hdf5_use_tz="yes"
|
||||
hdf5_cv_gettimeofday_tz=yes
|
||||
else
|
||||
echo "$as_me: program exited with status $ac_status" >&5
|
||||
echo "$as_me: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
( exit $ac_status )
|
||||
hdf5_use_tz="no"
|
||||
hdf5_cv_gettimeofday_tz=no
|
||||
fi
|
||||
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$hdf5_use_tz" = "yes"; then
|
||||
|
||||
if test ${hdf5_cv_gettimeofday_tz} = "yes"; then
|
||||
echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6
|
||||
|
||||
|
33
configure.in
33
configure.in
@ -1635,23 +1635,24 @@ dnl 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_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_use_tz="yes"], [hdf5_use_tz="no"],)
|
||||
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_use_tz" = "yes"; then
|
||||
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])
|
||||
|
Loading…
x
Reference in New Issue
Block a user