Commit 2bcf042c by Mumit Khan Committed by Jeff Law

aclocal.m4: New file.

        * 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.

From-SVN: r26353
parent 36eb4217
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> Wed Mar 31 13:50:24 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.in (extra_includes): Don't attempt to calculate the * configure.in (extra_includes): Don't attempt to calculate the
......
/* Define as the path of the `chmod' program. */ /* Define as the path of the `chmod' program. */
#undef CHMOD_PATH #undef CHMOD_PATH
/* Define if your sys/time.h defines struct timezone. */
#undef HAVE_STRUCT_TIMEZONE
...@@ -33,6 +33,9 @@ ...@@ -33,6 +33,9 @@
/* Define as the path of the `chmod' program. */ /* Define as the path of the `chmod' program. */
#undef CHMOD_PATH #undef CHMOD_PATH
/* Define if your sys/time.h defines struct timezone. */
#undef HAVE_STRUCT_TIMEZONE
/* Define if you have the alarm function. */ /* Define if you have the alarm function. */
#undef HAVE_ALARM #undef HAVE_ALARM
......
...@@ -1510,6 +1510,41 @@ test $ac_cv_func_gethostname = yes && MAYBES="$MAYBES hostnm_.o" ...@@ -1510,6 +1510,41 @@ test $ac_cv_func_gethostname = yes && MAYBES="$MAYBES hostnm_.o"
test $ac_cv_func_clock = yes && MAYBES="$MAYBES mclock_.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
......
...@@ -94,6 +94,7 @@ test $ac_cv_func_gethostname = yes && MAYBES="$MAYBES hostnm_.o" ...@@ -94,6 +94,7 @@ test $ac_cv_func_gethostname = yes && MAYBES="$MAYBES hostnm_.o"
test $ac_cv_func_clock = yes && MAYBES="$MAYBES mclock_.o" test $ac_cv_func_clock = yes && MAYBES="$MAYBES mclock_.o"
AC_SUBST(MAYBES) AC_SUBST(MAYBES)
LIBU77_HAVE_STRUCT_TIMEZONE
AC_SUBST(CROSS) AC_SUBST(CROSS)
AC_SUBST(RANLIB) AC_SUBST(RANLIB)
......
/* 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 file is part of GNU Fortran libU77 library.
This library is free software; you can redistribute it and/or modify it 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, ...@@ -62,8 +62,16 @@ int G77_date_and_time_0 (char *date, char *fftime, char *zone,
#if HAVE_GETTIMEOFDAY #if HAVE_GETTIMEOFDAY
{ {
struct timeval tp; struct timeval tp;
#if HAVE_STRUCT_TIMEZONE
struct timezone tzp; 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)) if (! gettimeofday (&tp, &tzp))
#else
if (! gettimeofday (&tp, (void *) 0))
#endif
vals[7] = tp.tv_usec/1000; vals[7] = tp.tv_usec/1000;
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment