aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-05-16 14:40:10 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-05-16 14:40:10 +0000
commit3f16d9fbc90f0e28ef6947d7492010094512a14e (patch)
tree7468bbcb51b9f6520dcffb7500756fb580fc7c19
parent3afc57bab8088c1cc4bf4754980159f94dc28f72 (diff)
attempt to detect a bad (as in HPUX 10.20 bad) gmtime_r function
-rw-r--r--configure.ac35
1 files changed, 35 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index ef77da664..81c77dd5f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1293,6 +1293,41 @@ if test "x$RECENTAIX" = "xyes"; then
AC_CHECK_FUNCS( gmtime_r )
fi
+if test x$cross_compiling != xyes; then
+ dnl if gmtime_r was found, verify that it actuall works, as (at least) HPUX
+ dnl 10.20 is known to have a buggy one. If it doesn't work, disable use of
+ dnl it.
+
+ AC_MSG_CHECKING([if gmtime_r works])
+ AC_RUN_IFELSE([[
+ #include <time.h>
+ int main(void)
+ {
+ time_t local = 1170352587;
+ struct tm *gmt;
+ struct tm keeper;
+ putenv("TZ=CST6CDT");
+ tzset();
+ gmt = gmtime_r(&local, &keeper);
+ if(gmt) {
+ return 0;
+ }
+ return 1; /* failure */
+ }
+ ]],
+ dnl success, do nothing
+ AC_MSG_RESULT(yes)
+ ,
+ dnl failure, now disable the function
+ AC_MSG_RESULT(no)
+ ac_cv_func_gmtime_r="no"
+ ,
+ dnl not invoked when crosscompiling)
+])
+
+
+fi
+
dnl **********************************************************************
dnl Back to "normal" configuring