]> granicus.if.org Git - file/commitdiff
better daylight/tm_isdst etc. detection.
authorChristos Zoulas <christos@zoulas.com>
Tue, 7 Aug 2001 16:01:25 +0000 (16:01 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 7 Aug 2001 16:01:25 +0000 (16:01 +0000)
Makefile.in
acinclude.m4
aclocal.m4
config.h.in
configure
configure.in
src/acconfig.h
src/print.c

index 5fa1cd7345136b98c593a090c63e643dd5066793..183b6ae0b35b737aa3153430eeba65d35a83672d 100644 (file)
@@ -122,7 +122,7 @@ missing mkinstalldirs
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = tar
+TAR = gtar
 GZIP_ENV = --best
 SOURCES = $(file_SOURCES)
 OBJECTS = $(file_OBJECTS)
index 3da5afb77387e4d1aa3a0aad7263561525b4807d..95990e522dfd6eb46243c5cedcce6525d88b4cac 100644 (file)
@@ -21,6 +21,51 @@ dnl From: eggert@twinsun.com (Paul Eggert)
 dnl Subject: autoconf 2.13 AC_CHECK_TYPE doesn't allow shell vars
 dnl Newsgroups: gnu.utils.bug
 
+dnl from autoconf 2.13 acspecific.m4, with changes to check for daylight
+
+AC_DEFUN(AC_STRUCT_TIMEZONE_DAYLIGHT,
+[AC_REQUIRE([AC_STRUCT_TM])dnl
+AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;],
+  ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])
+if test "$ac_cv_struct_tm_zone" = yes; then
+  AC_DEFINE(HAVE_TM_ZONE)
+fi
+AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
+[AC_TRY_LINK(
+changequote(<<, >>)dnl
+<<#include <time.h>
+#ifndef tzname /* For SGI.  */
+extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
+#endif>>,
+changequote([, ])dnl
+[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
+  if test $ac_cv_var_tzname = yes; then
+    AC_DEFINE(HAVE_TZNAME)
+  fi
+
+AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_isdst;],
+  ac_cv_struct_tm_isdst=yes, ac_cv_struct_tm_isdst=no)])
+if test "$ac_cv_struct_tm_isdst" = yes; then
+  AC_DEFINE(HAVE_TM_ISDST)
+fi
+AC_CACHE_CHECK(for daylight, ac_cv_var_daylight,
+[AC_TRY_LINK(
+changequote(<<, >>)dnl
+<<#include <time.h>
+#ifndef daylight /* In case IRIX #defines this, too  */
+extern int daylight;
+#endif>>,
+changequote([, ])dnl
+[atoi(daylight);], ac_cv_var_daylight=yes, ac_cv_var_daylight=no)])
+  if test $ac_cv_var_daylight = yes; then
+    AC_DEFINE(HAVE_DAYLIGHT)
+  fi
+])
+
 dnl AC_CHECK_TYPE2(TYPE, DEFAULT)
 AC_DEFUN(AC_CHECK_TYPE2,
 [AC_REQUIRE([AC_HEADER_STDC])dnl
index 39c1ebc6925049e55094ec1924a0844bfee41d21..b8a49559e81bb9c3cb636062ea8ba230e2997c49 100644 (file)
@@ -33,6 +33,51 @@ dnl From: eggert@twinsun.com (Paul Eggert)
 dnl Subject: autoconf 2.13 AC_CHECK_TYPE doesn't allow shell vars
 dnl Newsgroups: gnu.utils.bug
 
+dnl from autoconf 2.13 acspecific.m4, with changes to check for daylight
+
+AC_DEFUN(AC_STRUCT_TIMEZONE_DAYLIGHT,
+[AC_REQUIRE([AC_STRUCT_TM])dnl
+AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;],
+  ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])
+if test "$ac_cv_struct_tm_zone" = yes; then
+  AC_DEFINE(HAVE_TM_ZONE)
+fi
+AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
+[AC_TRY_LINK(
+changequote(<<, >>)dnl
+<<#include <time.h>
+#ifndef tzname /* For SGI.  */
+extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
+#endif>>,
+changequote([, ])dnl
+[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
+  if test $ac_cv_var_tzname = yes; then
+    AC_DEFINE(HAVE_TZNAME)
+  fi
+
+AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_isdst;],
+  ac_cv_struct_tm_isdst=yes, ac_cv_struct_tm_isdst=no)])
+if test "$ac_cv_struct_tm_isdst" = yes; then
+  AC_DEFINE(HAVE_TM_ISDST)
+fi
+AC_CACHE_CHECK(for daylight, ac_cv_var_daylight,
+[AC_TRY_LINK(
+changequote(<<, >>)dnl
+<<#include <time.h>
+#ifndef daylight /* In case IRIX #defines this, too  */
+extern int daylight;
+#endif>>,
+changequote([, ])dnl
+[atoi(daylight);], ac_cv_var_daylight=yes, ac_cv_var_daylight=no)])
+  if test $ac_cv_var_daylight = yes; then
+    AC_DEFINE(HAVE_DAYLIGHT)
+  fi
+])
+
 dnl AC_CHECK_TYPE2(TYPE, DEFAULT)
 AC_DEFUN(AC_CHECK_TYPE2,
 [AC_REQUIRE([AC_HEADER_STDC])dnl
index 60dfc5647e9dee966b273650c0d10515c6e6a40d..a1b6f37455a95fa4d33f2356c3fb3373f03538eb 100644 (file)
@@ -9,6 +9,13 @@
 /* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
 #undef HAVE_SYS_WAIT_H
 
+/* Define if your struct tm has tm_zone.  */
+#undef HAVE_TM_ZONE
+
+/* Define if you don't have tm_zone but do have the external array
+   tzname.  */
+#undef HAVE_TZNAME
+
 /* Define if major, minor, and makedev are declared in <mkdev.h>.  */
 #undef MAJOR_IN_MKDEV
 
@@ -24,6 +31,9 @@
 /* Define if you have the ANSI C header files.  */
 #undef STDC_HEADERS
 
+/* Define if your <sys/time.h> declares struct tm.  */
+#undef TM_IN_SYS_TIME
+
 /* Define if builtin ELF support is enabled.  */
 #undef BUILTIN_ELF
 
 /* Define if the `long long' type works.  */
 #undef HAVE_LONG_LONG
 
+/* Define if we have "tm_isdst" in "struct tm".  */
+#undef HAVE_TM_ISDST
+
+/* Define if we have a global "int" variable "daylight".  */
+#undef HAVE_DAYLIGHT
+
 /* Define to `unsigned char' if standard headers don't define.  */
 #undef uint8_t
 
index 6488d5fa3891531524d08253683996f6df79a7db..3fcf27191b3cadce0bc86c190f8c3531fb7922cd 100755 (executable)
--- a/configure
+++ b/configure
@@ -1802,14 +1802,186 @@ EOF
 
 fi
 
+echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
+echo "configure:1807: checking whether struct tm is in sys/time.h or time.h" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1812 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <time.h>
+int main() {
+struct tm *tp; tp->tm_sec;
+; return 0; }
+EOF
+if { (eval echo configure:1820: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_struct_tm=time.h
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_struct_tm=sys/time.h
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_struct_tm" 1>&6
+if test $ac_cv_struct_tm = sys/time.h; then
+  cat >> confdefs.h <<\EOF
+#define TM_IN_SYS_TIME 1
+EOF
+
+fi
+
+echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
+echo "configure:1841: checking for tm_zone in struct tm" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1846 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_cv_struct_tm>
+int main() {
+struct tm tm; tm.tm_zone;
+; return 0; }
+EOF
+if { (eval echo configure:1854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_struct_tm_zone=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_struct_tm_zone=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
+if test "$ac_cv_struct_tm_zone" = yes; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_TM_ZONE 1
+EOF
+
+fi
+echo $ac_n "checking for tzname""... $ac_c" 1>&6
+echo "configure:1874: checking for tzname" >&5
+if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1879 "configure"
+#include "confdefs.h"
+#include <time.h>
+#ifndef tzname /* For SGI.  */
+extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
+#endif
+int main() {
+atoi(*tzname);
+; return 0; }
+EOF
+if { (eval echo configure:1889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_var_tzname=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_var_tzname=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_var_tzname" 1>&6
+  if test $ac_cv_var_tzname = yes; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_TZNAME 1
+EOF
+
+  fi
+
+echo $ac_n "checking for tm_isdst in struct tm""... $ac_c" 1>&6
+echo "configure:1910: checking for tm_isdst in struct tm" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_tm_isdst'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1915 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_cv_struct_tm>
+int main() {
+struct tm tm; tm.tm_isdst;
+; return 0; }
+EOF
+if { (eval echo configure:1923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_struct_tm_isdst=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_struct_tm_isdst=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_struct_tm_isdst" 1>&6
+if test "$ac_cv_struct_tm_isdst" = yes; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_TM_ISDST 1
+EOF
+
+fi
+echo $ac_n "checking for daylight""... $ac_c" 1>&6
+echo "configure:1943: checking for daylight" >&5
+if eval "test \"`echo '$''{'ac_cv_var_daylight'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1948 "configure"
+#include "confdefs.h"
+#include <time.h>
+#ifndef daylight /* In case IRIX #defines this, too  */
+extern int daylight;
+#endif
+int main() {
+atoi(daylight);
+; return 0; }
+EOF
+if { (eval echo configure:1958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_var_daylight=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_var_daylight=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_var_daylight" 1>&6
+  if test $ac_cv_var_daylight = yes; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_DAYLIGHT 1
+EOF
+
+  fi
+
 
 echo $ac_n "checking for uint8_t""... $ac_c" 1>&6
-echo "configure:1808: checking for uint8_t" >&5
+echo "configure:1980: checking for uint8_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uint8_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1813 "configure"
+#line 1985 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1837,12 +2009,12 @@ EOF
 fi
 
 echo $ac_n "checking for uint16_t""... $ac_c" 1>&6
-echo "configure:1841: checking for uint16_t" >&5
+echo "configure:2013: checking for uint16_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uint16_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1846 "configure"
+#line 2018 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1870,12 +2042,12 @@ EOF
 fi
 
 echo $ac_n "checking for uint32_t""... $ac_c" 1>&6
-echo "configure:1874: checking for uint32_t" >&5
+echo "configure:2046: checking for uint32_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uint32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1879 "configure"
+#line 2051 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1904,7 +2076,7 @@ fi
 
 
 echo $ac_n "checking for long long""... $ac_c" 1>&6
-echo "configure:1908: checking for long long" >&5
+echo "configure:2080: checking for long long" >&5
 if eval "test \"`echo '$''{'ac_cv_c_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1915,13 +2087,13 @@ if test "$cross_compiling" = yes; then
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1919 "configure"
+#line 2091 "configure"
 #include "confdefs.h"
 int main() {
 long long foo = 0;
 exit(sizeof(long long) < sizeof(long)); }
 EOF
-if { (eval echo configure:1925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_long_long=yes
 else
@@ -1950,12 +2122,12 @@ else
   long64='unsigned long';
 fi
 echo $ac_n "checking for uint64_t""... $ac_c" 1>&6
-echo "configure:1954: checking for uint64_t" >&5
+echo "configure:2126: checking for uint64_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uint64_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1959 "configure"
+#line 2131 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1986,7 +2158,7 @@ fi
 
 
 echo $ac_n "checking size of uint8_t""... $ac_c" 1>&6
-echo "configure:1990: checking size of uint8_t" >&5
+echo "configure:2162: checking size of uint8_t" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_uint8_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1994,7 +2166,7 @@ else
   ac_cv_sizeof_uint8_t=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1998 "configure"
+#line 2170 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef STDC_HEADERS
@@ -2010,7 +2182,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:2014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_uint8_t=`cat conftestval`
 else
@@ -2031,7 +2203,7 @@ EOF
 
 
 echo $ac_n "checking size of uint16_t""... $ac_c" 1>&6
-echo "configure:2035: checking size of uint16_t" >&5
+echo "configure:2207: checking size of uint16_t" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_uint16_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2039,7 +2211,7 @@ else
   ac_cv_sizeof_uint16_t=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2043 "configure"
+#line 2215 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef STDC_HEADERS
@@ -2055,7 +2227,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:2059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_uint16_t=`cat conftestval`
 else
@@ -2076,7 +2248,7 @@ EOF
 
 
 echo $ac_n "checking size of uint32_t""... $ac_c" 1>&6
-echo "configure:2080: checking size of uint32_t" >&5
+echo "configure:2252: checking size of uint32_t" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_uint32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2084,7 +2256,7 @@ else
   ac_cv_sizeof_uint32_t=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2088 "configure"
+#line 2260 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef STDC_HEADERS
@@ -2100,7 +2272,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:2104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_uint32_t=`cat conftestval`
 else
@@ -2121,7 +2293,7 @@ EOF
 
 
 echo $ac_n "checking size of uint64_t""... $ac_c" 1>&6
-echo "configure:2125: checking size of uint64_t" >&5
+echo "configure:2297: checking size of uint64_t" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_uint64_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2129,7 +2301,7 @@ else
   ac_cv_sizeof_uint64_t=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2133 "configure"
+#line 2305 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef STDC_HEADERS
@@ -2145,7 +2317,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:2149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_uint64_t=`cat conftestval`
 else
@@ -2169,12 +2341,12 @@ EOF
 for ac_func in mmap strerror strtoul
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2173: checking for $ac_func" >&5
+echo "configure:2345: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2178 "configure"
+#line 2350 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2197,7 +2369,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
index 4699f75e62dcb791c9d16e75db2e057283b6926c..d8bee8f5096b30f2bffec934bcab84f562366ea2 100644 (file)
@@ -66,6 +66,7 @@ AC_C_CONST
 AC_TYPE_OFF_T
 AC_TYPE_SIZE_T
 AC_STRUCT_ST_RDEV
+AC_STRUCT_TIMEZONE_DAYLIGHT
 
 dnl FIXME: only found in standard headers!
 AC_CHECK_TYPE(uint8_t, unsigned char)
index ef6e0cb6b0e1c63c4d3279f3d7e54b082f384277..b2d201dfda17e82fe6396167383b52e791feb3f0 100644 (file)
 /* Define if the `long long' type works.  */
 #undef HAVE_LONG_LONG
 
+/* Define if we have "tm_isdst" in "struct tm".  */
+#undef HAVE_TM_ISDST
+
+/* Define if we have a global "int" variable "daylight".  */
+#undef HAVE_DAYLIGHT
+
 /* Define to `unsigned char' if standard headers don't define.  */
 #undef uint8_t
 
index bf2c66799e56abf8f7aead2a1dff467ee02e0185..b6803994448e5a3a034e17d8738c02114a878f08 100644 (file)
@@ -41,7 +41,7 @@
 #include <time.h>
 
 #ifndef lint
-FILE_RCSID("@(#)$Id: print.c,v 1.33 2001/07/22 21:04:15 christos Exp $")
+FILE_RCSID("@(#)$Id: print.c,v 1.34 2001/08/07 16:01:26 christos Exp $")
 #endif  /* lint */
 
 #define SZOF(a)        (sizeof(a) / sizeof(a[0]))
@@ -234,10 +234,24 @@ fmttime(v, local)
 {
        char *pp, *rt;
        time_t t = (time_t)v;
+       struct tm *tm;
+
        if (local) {
                pp = ctime(&t);
        } else {
-               struct tm *tm;
+#ifndef HAVE_DAYLIGHT
+               static int daylight = 0;
+#ifdef HAVE_TM_ISDST
+               static time_t now = (time_t)0;
+
+               if (now == (time_t)0) {
+                       struct tm *tm1;
+                       (void)time(&now);
+                       tm1 = localtime(&now);
+                       daylight = tm1->tm_isdst;
+               }
+#endif /* HAVE_TM_ISDST */
+#endif /* HAVE_DAYLIGHT */
                if (daylight)
                        t += 3600;
                tm = gmtime(&t);