diff --git a/libf2c/ChangeLog b/libf2c/ChangeLog index 6e4a1f2e2029cdde43894b9e10f961af0b8f1ce6..a899f27348d5b01e89afddea84d401ae336dbc3c 100644 --- a/libf2c/ChangeLog +++ b/libf2c/ChangeLog @@ -1,3 +1,12 @@ +Sun Apr 11 23:30:42 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * libU77/aclocal.m4: New file. + * libU77/configure.in (LIBU77_HAVE_STRUCT_TIMEZONE): Add test. + * libU77/acconfig.h (HAVE_STRUCT_TIMEZONE): Add macro. + * libU77/datetime_c.c (G77_date_and_time_0): Use. + * libU77/config.hin: Regenerate. + * libU77/configure: Likewise. + Wed Mar 31 13:50:24 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * configure.in (extra_includes): Don't attempt to calculate the diff --git a/libf2c/libU77/acconfig.h b/libf2c/libU77/acconfig.h index 12bba85b8691c458f7613d89788f883352703939..1400ba589b2349dbe82fb8420fbc901cae8c5372 100644 --- a/libf2c/libU77/acconfig.h +++ b/libf2c/libU77/acconfig.h @@ -1,2 +1,6 @@ /* Define as the path of the `chmod' program. */ #undef CHMOD_PATH + +/* Define if your sys/time.h defines struct timezone. */ +#undef HAVE_STRUCT_TIMEZONE + diff --git a/libf2c/libU77/config.hin b/libf2c/libU77/config.hin index 8c3ba6baf573e0aee4718c46f62846d62a8a426c..27a89c05bb9905d12d5a2e4c3a352a4a5fe036c2 100644 --- a/libf2c/libU77/config.hin +++ b/libf2c/libU77/config.hin @@ -33,6 +33,9 @@ /* Define as the path of the `chmod' program. */ #undef CHMOD_PATH +/* Define if your sys/time.h defines struct timezone. */ +#undef HAVE_STRUCT_TIMEZONE + /* Define if you have the alarm function. */ #undef HAVE_ALARM diff --git a/libf2c/libU77/configure b/libf2c/libU77/configure index 61b05fc53875da842d9f708dee5899d3f49b8ab5..fc8a4908c9f57fe6646e113ea25778d95e456a87 100755 --- a/libf2c/libU77/configure +++ b/libf2c/libU77/configure @@ -1510,6 +1510,41 @@ test $ac_cv_func_gethostname = yes && MAYBES="$MAYBES hostnm_.o" test $ac_cv_func_clock = yes && MAYBES="$MAYBES mclock_.o" +echo $ac_n "checking whether struct timezone exists""... $ac_c" 1>&6 +echo "configure:1515: checking whether struct timezone exists" >&5 +if eval "test \"`echo '$''{'libu77_cv_have_struct_timezone'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1520 "configure" +#include "confdefs.h" +#include <sys/time.h> +int main() { +struct timezone tz; +; return 0; } +EOF +if { (eval echo configure:1527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + libu77_ac_have_struct_timezone=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + libu77_ac_have_struct_timezone=no +fi +rm -f conftest* +fi + +if test $libu77_ac_have_struct_timezone = yes; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<EOF +#define HAVE_STRUCT_TIMEZONE 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + diff --git a/libf2c/libU77/configure.in b/libf2c/libU77/configure.in index 58b8de315862703427939c21c57ff469fde74030..1262645c932f8a3b905cdb38df49a7e00f5a7da8 100644 --- a/libf2c/libU77/configure.in +++ b/libf2c/libU77/configure.in @@ -94,6 +94,7 @@ test $ac_cv_func_gethostname = yes && MAYBES="$MAYBES hostnm_.o" test $ac_cv_func_clock = yes && MAYBES="$MAYBES mclock_.o" AC_SUBST(MAYBES) +LIBU77_HAVE_STRUCT_TIMEZONE AC_SUBST(CROSS) AC_SUBST(RANLIB) diff --git a/libf2c/libU77/datetime_.c b/libf2c/libU77/datetime_.c index 35f0d1cdf74a9388becc07604b517bdd75669b93..faf773a944c20b81fc0b3d96d41421844f7296fa 100644 --- a/libf2c/libU77/datetime_.c +++ b/libf2c/libU77/datetime_.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Fortran libU77 library. This library is free software; you can redistribute it and/or modify it @@ -62,8 +62,16 @@ int G77_date_and_time_0 (char *date, char *fftime, char *zone, #if HAVE_GETTIMEOFDAY { struct timeval tp; +#if HAVE_STRUCT_TIMEZONE struct timezone tzp; + /* This is still not strictly correct on some systems such as HPUX, + which does have struct timezone, but gettimeofday takes void* as + the 2nd arg. However, the effect of passing anything other than a null + pointer is unspecified on HPUX. */ if (! gettimeofday (&tp, &tzp)) +#else + if (! gettimeofday (&tp, (void *) 0)) +#endif vals[7] = tp.tv_usec/1000; } #endif