summaryrefslogtreecommitdiffstats
path: root/contrib/libf2c/libU77
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-09-19 05:59:11 +0000
committerobrien <obrien@FreeBSD.org>1999-09-19 05:59:11 +0000
commitc53c47e769827bb2d6d596865051a4af89d246fd (patch)
tree354ca5598013982362bb6e08cf4b5d6b79b0c370 /contrib/libf2c/libU77
parent98e51635e2084da6cfe0d3b1782cb95b80fd2caa (diff)
downloadFreeBSD-src-c53c47e769827bb2d6d596865051a4af89d246fd.zip
FreeBSD-src-c53c47e769827bb2d6d596865051a4af89d246fd.tar.gz
Virgin import of GCC 2.95.1's libf2c
Diffstat (limited to 'contrib/libf2c/libU77')
-rw-r--r--contrib/libf2c/libU77/Makefile.in3
-rw-r--r--contrib/libf2c/libU77/Version.c2
-rw-r--r--contrib/libf2c/libU77/acconfig.h4
-rw-r--r--contrib/libf2c/libU77/aclocal.m416
-rw-r--r--contrib/libf2c/libU77/config.hin3
-rwxr-xr-xcontrib/libf2c/libU77/configure284
-rw-r--r--contrib/libf2c/libU77/configure.in2
-rw-r--r--contrib/libf2c/libU77/date_.c7
-rw-r--r--contrib/libf2c/libU77/datetime_.c10
-rw-r--r--contrib/libf2c/libU77/dtime_.c75
-rw-r--r--contrib/libf2c/libU77/etime_.c74
-rw-r--r--contrib/libf2c/libU77/sys_clock_.c2
-rw-r--r--contrib/libf2c/libU77/u77-test.f316
-rw-r--r--contrib/libf2c/libU77/vxtidate_.c4
14 files changed, 636 insertions, 166 deletions
diff --git a/contrib/libf2c/libU77/Makefile.in b/contrib/libf2c/libU77/Makefile.in
index c90cb61..3468a82 100644
--- a/contrib/libf2c/libU77/Makefile.in
+++ b/contrib/libf2c/libU77/Makefile.in
@@ -164,6 +164,7 @@ rename_.o: rename_.c
fputc_.o: fputc_.c
fgetc_.o: fgetc_.c
sys_clock_.o: sys_clock_.c
+date_.o: date_.c
umask_.o: umask_.c
flush1_.o: flush1_.c
mclock_.o: mclock_.c
@@ -180,7 +181,7 @@ mostlyclean:
rm -f *.o a.out
clean: mostlyclean
- rm -f config.log
+ rm -f config.log ../s-libu77
distclean: clean
rm -f config.cache config.status Makefile config.h stamp.h \
diff --git a/contrib/libf2c/libU77/Version.c b/contrib/libf2c/libU77/Version.c
index 6fb0b42..de0964d 100644
--- a/contrib/libf2c/libU77/Version.c
+++ b/contrib/libf2c/libU77/Version.c
@@ -1,6 +1,6 @@
static char junk[] = "\n@(#) LIBU77 VERSION 19980709\n";
-char __G77_LIBU77_VERSION__[] = "0.5.24-19990305";
+char __G77_LIBU77_VERSION__[] = "0.5.25 19990816 (release)";
#include <stdio.h>
diff --git a/contrib/libf2c/libU77/acconfig.h b/contrib/libf2c/libU77/acconfig.h
index 12bba85..1400ba5 100644
--- a/contrib/libf2c/libU77/acconfig.h
+++ b/contrib/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/contrib/libf2c/libU77/aclocal.m4 b/contrib/libf2c/libU77/aclocal.m4
new file mode 100644
index 0000000..d230dad
--- /dev/null
+++ b/contrib/libf2c/libU77/aclocal.m4
@@ -0,0 +1,16 @@
+dnl See whether we have struct timezone
+dnl LIBU77_HAVE_STRUCT_TIMEZONE
+AC_DEFUN(LIBU77_HAVE_STRUCT_TIMEZONE,
+[AC_MSG_CHECKING([whether struct timezone exists])
+AC_CACHE_VAL(libu77_cv_have_struct_timezone,
+[AC_TRY_COMPILE([#include <sys/time.h>],
+[struct timezone tz;],
+libu77_ac_have_struct_timezone=yes, libu77_ac_have_struct_timezone=no)])
+if test $libu77_ac_have_struct_timezone = yes; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE_UNQUOTED(HAVE_STRUCT_TIMEZONE)
+else
+ AC_MSG_RESULT(no)
+fi
+])dnl
+
diff --git a/contrib/libf2c/libU77/config.hin b/contrib/libf2c/libU77/config.hin
index 8c3ba6b..27a89c05 100644
--- a/contrib/libf2c/libU77/config.hin
+++ b/contrib/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/contrib/libf2c/libU77/configure b/contrib/libf2c/libU77/configure
index 07424cb..fc8a490 100755
--- a/contrib/libf2c/libU77/configure
+++ b/contrib/libf2c/libU77/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1
+# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -333,7 +333,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12.1"
+ echo "configure generated by autoconf version 2.13"
exit 0 ;;
-with-* | --with-*)
@@ -503,9 +503,11 @@ ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
+ac_exeext=
+ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -526,15 +528,16 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:530: checking for $ac_word" >&5
+echo "configure:532: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
@@ -555,16 +558,17 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:559: checking for $ac_word" >&5
+echo "configure:562: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
- for ac_dir in $PATH; do
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -599,25 +603,61 @@ else
echo "$ac_t""no" 1>&6
fi
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:613: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:607: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:645: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
-cat > conftest.$ac_ext <<EOF
-#line 617 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 656 "configure"
#include "confdefs.h"
+
main(){return(0);}
EOF
-if { (eval echo configure:621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -631,18 +671,24 @@ else
ac_cv_prog_cc_works=no
fi
rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:641: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:687: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:646: checking whether we are using GNU C" >&5
+echo "configure:692: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -651,7 +697,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -662,11 +708,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test $ac_cv_prog_gcc = yes; then
GCC=yes
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:670: checking whether ${CC-cc} accepts -g" >&5
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:720: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -681,16 +731,20 @@ rm -f conftest*
fi
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
- CFLAGS="-O2"
+ CFLAGS="-g"
fi
else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
fi
if test "$CROSS";then
@@ -702,7 +756,7 @@ fi
test "$AR" || AR=ar
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:706: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:760: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -732,7 +786,7 @@ fi
# Extract the first word of "chmod", so it can be a program name with args.
set dummy chmod; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:736: checking for $ac_word" >&5
+echo "configure:790: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ac_cv_prog_chmod'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -744,8 +798,9 @@ else
ac_cv_path_ac_cv_prog_chmod="$ac_cv_prog_chmod" # Let the user override the test with a dos path.
;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_ac_cv_prog_chmod="$ac_dir/$ac_word"
@@ -775,7 +830,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:779: checking how to run the C preprocessor" >&5
+echo "configure:834: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -790,14 +845,14 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 794 "configure"
+#line 849 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
@@ -807,14 +862,31 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 811 "configure"
+#line 866 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:872: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 883 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
@@ -827,6 +899,8 @@ fi
rm -f conftest*
fi
rm -f conftest*
+fi
+rm -f conftest*
ac_cv_prog_CPP="$CPP"
fi
CPP="$ac_cv_prog_CPP"
@@ -836,12 +910,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:840: checking for ANSI C header files" >&5
+echo "configure:914: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 845 "configure"
+#line 919 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -849,8 +923,8 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:853: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
ac_cv_header_stdc=yes
@@ -866,7 +940,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 870 "configure"
+#line 944 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -884,7 +958,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 888 "configure"
+#line 962 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -905,7 +979,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 909 "configure"
+#line 983 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -916,7 +990,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -941,12 +1015,12 @@ fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:945: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1019: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 950 "configure"
+#line 1024 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -955,7 +1029,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -980,18 +1054,18 @@ for ac_hdr in limits.h unistd.h sys/time.h string.h stdlib.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:984: checking for $ac_hdr" >&5
+echo "configure:1058: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 989 "configure"
+#line 1063 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1068: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -1018,12 +1092,12 @@ done
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1022: checking for working const" >&5
+echo "configure:1096: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1027 "configure"
+#line 1101 "configure"
#include "confdefs.h"
int main() {
@@ -1072,7 +1146,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1093,12 +1167,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1097: checking for size_t" >&5
+echo "configure:1171: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1102 "configure"
+#line 1176 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1107,7 +1181,7 @@ else
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_size_t=yes
else
@@ -1126,12 +1200,12 @@ EOF
fi
echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:1130: checking for mode_t" >&5
+echo "configure:1204: checking for mode_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1135 "configure"
+#line 1209 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1140,7 +1214,7 @@ else
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_mode_t=yes
else
@@ -1160,12 +1234,12 @@ fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1164: checking for pid_t" >&5
+echo "configure:1238: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1169 "configure"
+#line 1243 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1174,7 +1248,7 @@ else
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_pid_t=yes
else
@@ -1193,12 +1267,12 @@ EOF
fi
echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:1197: checking for st_blksize in struct stat" >&5
+echo "configure:1271: checking for st_blksize in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1202 "configure"
+#line 1276 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -1206,7 +1280,7 @@ int main() {
struct stat s; s.st_blksize;
; return 0; }
EOF
-if { (eval echo configure:1210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1284: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blksize=yes
else
@@ -1227,12 +1301,12 @@ EOF
fi
echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:1231: checking for st_blocks in struct stat" >&5
+echo "configure:1305: checking for st_blocks in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1236 "configure"
+#line 1310 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -1240,7 +1314,7 @@ int main() {
struct stat s; s.st_blocks;
; return 0; }
EOF
-if { (eval echo configure:1244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blocks=yes
else
@@ -1259,16 +1333,16 @@ if test $ac_cv_struct_st_blocks = yes; then
EOF
else
- LIBOBJS="$LIBOBJS fileblocks.o"
+ LIBOBJS="$LIBOBJS fileblocks.${ac_objext}"
fi
echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:1267: checking for st_rdev in struct stat" >&5
+echo "configure:1341: checking for st_rdev in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1272 "configure"
+#line 1346 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -1276,7 +1350,7 @@ int main() {
struct stat s; s.st_rdev;
; return 0; }
EOF
-if { (eval echo configure:1280: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_rdev=yes
else
@@ -1297,12 +1371,12 @@ EOF
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1301: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:1375: 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 1306 "configure"
+#line 1380 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -1310,7 +1384,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:1314: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -1332,7 +1406,7 @@ fi
echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6
-echo "configure:1336: checking for gethostname in -lsocket" >&5
+echo "configure:1410: checking for gethostname in -lsocket" >&5
ac_lib_var=`echo socket'_'gethostname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1340,7 +1414,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1344 "configure"
+#line 1418 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1351,7 +1425,7 @@ int main() {
gethostname()
; return 0; }
EOF
-if { (eval echo configure:1355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1378,12 +1452,12 @@ for ac_func in symlink getcwd getwd lstat gethostname strerror clock \
gettimeofday
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1382: checking for $ac_func" >&5
+echo "configure:1456: 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 1387 "configure"
+#line 1461 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1406,7 +1480,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1484: \"$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
@@ -1436,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
+
@@ -1463,7 +1572,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@@ -1530,7 +1639,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -1553,6 +1662,7 @@ s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
diff --git a/contrib/libf2c/libU77/configure.in b/contrib/libf2c/libU77/configure.in
index 2e6e608..1262645 100644
--- a/contrib/libf2c/libU77/configure.in
+++ b/contrib/libf2c/libU77/configure.in
@@ -19,6 +19,7 @@
#to Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
#USA.
+AC_PREREQ(2.12.1)
AC_INIT(access_.c)
AC_CONFIG_HEADER(config.h:config.hin)
@@ -93,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/contrib/libf2c/libU77/date_.c b/contrib/libf2c/libU77/date_.c
index 8426edc..4f8254d 100644
--- a/contrib/libf2c/libU77/date_.c
+++ b/contrib/libf2c/libU77/date_.c
@@ -9,11 +9,12 @@
static integer c__5 = 5;
-/* Subroutine */ int G77_date_0 (char *buf, ftnlen buf_len)
+/* Subroutine */ int G77_date_y2kbug_0 (char *buf, ftnlen buf_len)
{
/* System generated locals */
address a__1[5];
- integer i__1, i__2[5];
+ longint i__1;
+ integer i__2[5];
char ch__1[24];
/* Builtin functions */
@@ -21,7 +22,7 @@ static integer c__5 = 5;
/* Local variables */
static char cbuf[24];
- extern integer G77_time_0 ();
+ extern longint G77_time_0 ();
extern /* Character */ VOID G77_ctime_0 ();
i__1 = G77_time_0 ();
diff --git a/contrib/libf2c/libU77/datetime_.c b/contrib/libf2c/libU77/datetime_.c
index 35f0d1c..faf773a 100644
--- a/contrib/libf2c/libU77/datetime_.c
+++ b/contrib/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
diff --git a/contrib/libf2c/libU77/dtime_.c b/contrib/libf2c/libU77/dtime_.c
index 8bcfde8..aa34bc0 100644
--- a/contrib/libf2c/libU77/dtime_.c
+++ b/contrib/libf2c/libU77/dtime_.c
@@ -33,6 +33,11 @@ Boston, MA 02111-1307, USA. */
# include <sys/time.h>
# include <sys/resource.h>
#endif
+#if defined (_WIN32)
+# include <windows.h>
+# undef min
+# undef max
+#endif
#include <errno.h> /* for ENOSYS */
#include "f2c.h"
@@ -50,7 +55,73 @@ double G77_dtime_0 (tarray)
double G77_dtime_0 (real tarray[2])
#endif
{
-#if defined (HAVE_GETRUSAGE) || defined (HAVE_TIMES)
+#if defined (_WIN32)
+ static int win32_platform = -1;
+
+ if (win32_platform == -1)
+ {
+ OSVERSIONINFO osv;
+ osv.dwOSVersionInfoSize = sizeof (osv);
+ GetVersionEx (&osv);
+ win32_platform = osv.dwPlatformId;
+ }
+
+ /* We need to use this hack on non-NT platforms, where the first call
+ returns 0.0 and subsequent ones return the correct value. */
+ if (win32_platform != VER_PLATFORM_WIN32_NT)
+ {
+ static unsigned long long clock_freq;
+ static unsigned long long old_count;
+ unsigned long long count;
+ double delta;
+ LARGE_INTEGER counter_val;
+
+ if (clock_freq == 0)
+ {
+ LARGE_INTEGER freq;
+ if (! QueryPerformanceFrequency (&freq))
+ {
+ errno = ENOSYS;
+ return 0.0;
+ }
+ else
+ {
+ clock_freq = ((unsigned long long) freq.HighPart << 32)
+ + ((unsigned) freq.LowPart);
+ }
+ }
+
+ if (! QueryPerformanceCounter (&counter_val))
+ return -1.0;
+
+ count = ((unsigned long long) counter_val.HighPart << 32)
+ + (unsigned) counter_val.LowPart;
+ delta = ((double) (count - old_count)) / clock_freq;
+ tarray[0] = (float) delta;
+ tarray[1] = 0.0;
+ old_count = count;
+ }
+ else
+ {
+ static unsigned long long old_utime, old_stime;
+ unsigned long long utime, stime;
+ FILETIME creation_time, exit_time, kernel_time, user_time;
+
+ GetProcessTimes (GetCurrentProcess (), &creation_time, &exit_time,
+ &kernel_time, &user_time);
+ utime = ((unsigned long long) user_time.dwHighDateTime << 32)
+ + (unsigned) user_time.dwLowDateTime;
+ stime = ((unsigned long long) kernel_time.dwHighDateTime << 32)
+ + (unsigned) kernel_time.dwLowDateTime;
+
+ tarray[0] = (utime - old_utime) / 1.0e7;
+ tarray[1] = (stime - old_stime) / 1.0e7;
+ old_utime = utime;
+ old_stime = stime;
+ }
+ return tarray[0] + tarray[1];
+
+#elif defined (HAVE_GETRUSAGE) || defined (HAVE_TIMES)
/* The getrusage version is only the default for convenience. */
#ifdef HAVE_GETRUSAGE
float utime, stime;
@@ -84,7 +155,7 @@ double G77_dtime_0 (real tarray[2])
# else
#error Dont know clock tick length
# endif
- if (times(&buffer) < 0) return -1.0;
+ if (times(&buffer) == (clock_t)-1) return -1.0;
utime = buffer.tms_utime; stime = buffer.tms_stime;
tarray[0] = ((float)(utime - old_utime)) / (float)clk_tck;
tarray[1] = ((float)(stime - old_stime)) / (float)clk_tck;
diff --git a/contrib/libf2c/libU77/etime_.c b/contrib/libf2c/libU77/etime_.c
index 269d964..eae559f 100644
--- a/contrib/libf2c/libU77/etime_.c
+++ b/contrib/libf2c/libU77/etime_.c
@@ -33,6 +33,11 @@ Boston, MA 02111-1307, USA. */
# include <sys/time.h>
# include <sys/resource.h>
#endif
+#if defined (_WIN32)
+# include <windows.h>
+# undef min
+# undef max
+#endif
#include <errno.h> /* for ENOSYS */
#include "f2c.h"
@@ -50,7 +55,72 @@ double G77_etime_0 (tarray)
double G77_etime_0 (real tarray[2])
#endif
{
-#if defined (HAVE_GETRUSAGE) || defined (HAVE_TIMES)
+#if defined (_WIN32)
+ static int win32_platform = -1;
+ double usertime, systime;
+
+ if (win32_platform == -1)
+ {
+ OSVERSIONINFO osv;
+ osv.dwOSVersionInfoSize = sizeof (osv);
+ GetVersionEx (&osv);
+ win32_platform = osv.dwPlatformId;
+ }
+
+ /* non-NT platforms don't have a clue as to how long a process has
+ been running, so simply return the uptime. Bad judgement call? */
+ if (win32_platform != VER_PLATFORM_WIN32_NT)
+ {
+ static unsigned long long clock_freq;
+ static unsigned long long old_count;
+ unsigned long long count;
+ LARGE_INTEGER counter_val;
+
+ if (clock_freq == 0)
+ {
+ LARGE_INTEGER freq;
+ if (! QueryPerformanceFrequency (&freq))
+ {
+ errno = ENOSYS;
+ return 0.0;
+ }
+ else
+ {
+ clock_freq = ((unsigned long long) freq.HighPart << 32)
+ + ((unsigned) freq.LowPart);
+ if (! QueryPerformanceCounter (&counter_val))
+ return -1.0;
+ old_count = ((unsigned long long) counter_val.HighPart << 32)
+ + (unsigned) counter_val.LowPart;
+ }
+ }
+
+ if (! QueryPerformanceCounter (&counter_val))
+ return -1.0;
+
+ count = ((unsigned long long) counter_val.HighPart << 32)
+ + (unsigned) counter_val.LowPart;
+ tarray[0] = usertime = (double) (count - old_count) / clock_freq;
+ tarray[1] = systime = 0.0;
+ }
+ else
+ {
+ FILETIME creation_time, exit_time, kernel_time, user_time;
+ unsigned long long utime, stime;
+
+ GetProcessTimes (GetCurrentProcess (), &creation_time, &exit_time,
+ &kernel_time, &user_time);
+ utime = ((unsigned long long) user_time.dwHighDateTime << 32)
+ + (unsigned) user_time.dwLowDateTime;
+ stime = ((unsigned long long) kernel_time.dwHighDateTime << 32)
+ + (unsigned) kernel_time.dwLowDateTime;
+
+ tarray[0] = usertime = utime / 1.0e7;
+ tarray[1] = systime = stime / 1.0e7;
+ }
+ return usertime + systime;
+
+#elif defined (HAVE_GETRUSAGE) || defined (HAVE_TIMES)
/* The getrusage version is only the default for convenience. */
#ifdef HAVE_GETRUSAGE
struct rusage rbuff;
@@ -78,7 +148,7 @@ double G77_etime_0 (real tarray[2])
# else
#error Dont know clock tick length
# endif
- if (times(&buffer) < 0) return -1.0;
+ if (times(&buffer) == (clock_t)-1) return -1.0;
tarray[0] = (float) buffer.tms_utime / (float)clk_tck;
tarray[1] = (float) buffer.tms_stime / (float)clk_tck;
#endif /* HAVE_GETRUSAGE */
diff --git a/contrib/libf2c/libU77/sys_clock_.c b/contrib/libf2c/libU77/sys_clock_.c
index 7b7a9d0..d0d2a77 100644
--- a/contrib/libf2c/libU77/sys_clock_.c
+++ b/contrib/libf2c/libU77/sys_clock_.c
@@ -57,7 +57,7 @@ int G77_system_clock_0 (integer *count, integer *count_rate, integer *count_max)
#elif defined CLK_TCK
*count_rate = CLK_TCK;
#elif defined HZ
- *count_rate = HZ;
+ *count_rate = HZ;
#else
#error Dont know clock tick length
#endif
diff --git a/contrib/libf2c/libU77/u77-test.f b/contrib/libf2c/libU77/u77-test.f
index 07963c9..65e972a 100644
--- a/contrib/libf2c/libU77/u77-test.f
+++ b/contrib/libf2c/libU77/u77-test.f
@@ -2,35 +2,102 @@
* hard to test things where you can't guarantee the result. Have a
* good squint at what it prints, though detected errors will cause
* starred messages.
+*
+* Currently not tested:
+* ALARM
+* CHDIR (func)
+* CHMOD (func)
+* FGET (func/subr)
+* FGETC (func)
+* FPUT (func/subr)
+* FPUTC (func)
+* FSTAT (subr)
+* GETCWD (subr)
+* HOSTNM (subr)
+* IRAND
+* KILL
+* LINK (func)
+* LSTAT (subr)
+* RENAME (func/subr)
+* SIGNAL (subr)
+* SRAND
+* STAT (subr)
+* SYMLNK (func/subr)
+* UMASK (func)
+* UNLINK (func)
+*
+* NOTE! This is the libU77 version, so it should be a bit more
+* "interactive" than the testsuite version, which is in
+* gcc/testsuite/g77.f-torture/execute/u77-test.f.
+* This version purposely exits with a "failure" status, to test
+* returning of non-zero status, and it doesn't call the ABORT
+* intrinsic (it substitutes an EXTERNAL stub, so the code can be
+* kept nearly the same in both copies). Also, it goes ahead and
+* tests the HOSTNM intrinsic. Please keep the other copy up-to-date when
+* you modify this one.
implicit none
+
+* external hostnm
+ intrinsic hostnm
+ integer hostnm
+
integer i, j, k, ltarray (9), idat (3), count, rate, count_max,
+ pid, mask
- real tarray1(2), tarray2(2), r1, r2, sum
- intrinsic getpid, getuid, getgid, ierrno, gerror,
- + fnum, isatty, getarg, access, unlink, fstat,
- + stat, lstat, getcwd, gmtime, hostnm, etime, chmod,
+ real tarray1(2), tarray2(2), r1, r2
+ double precision d1
+ integer(kind=2) bigi
+ logical issum
+ intrinsic getpid, getuid, getgid, ierrno, gerror, time8,
+ + fnum, isatty, getarg, access, unlink, fstat, iargc,
+ + stat, lstat, getcwd, gmtime, etime, chmod, itime, date,
+ chdir, fgetc, fputc, system_clock, second, idate, secnds,
- + time, ctime, fdate, ttynam, date_and_time
- external lenstr
+ + time, ctime, fdate, ttynam, date_and_time, mclock, mclock8,
+ + cpu_time, dtime, ftell, abort
+ external lenstr, ctrlc
integer lenstr
logical l
character gerr*80, c*1
character ctim*25, line*80, lognam*20, wd*100, line2*80, ddate*8,
- + ttime*10, zone*5
+ + ttime*10, zone*5, ctim2*25
integer fstatb (13), statb (13)
integer *2 i2zero
integer values(8)
+ integer(kind=7) sigret
- ctim = ctime(time())
- WRITE (6,'(A/)') '1 GNU libU77 test at: ' // ctim
+ i = time ()
+ ctim = ctime (i)
+ WRITE (6,'(A/)') '1 GNU libU77 test at: ' // ctim(:lenstr (ctim))
write (6,'(A,I3,'', '',I3)')
+ ' Logical units 5 and 6 correspond (FNUM) to'
+ // ' Unix i/o units ', fnum(5), fnum(6)
if (lnblnk('foo ').ne.3 .or. len_trim('foo ').ne.3) then
print *, 'LNBLNK or LEN_TRIM failed'
- call exit(1)
+ call abort
+ end if
+
+ bigi = time8 ()
+
+ call ctime (i, ctim2)
+ if (ctim .ne. ctim2) then
+ write (6, *) '*** CALL CTIME disagrees with CTIME(): ',
+ + ctim2(:lenstr (ctim2)), ' vs. ', ctim(:lenstr (ctim))
+ call doabort
end if
+
+ j = time ()
+ if (i .gt. bigi .or. bigi .gt. j) then
+ write (6, *) '*** TIME/TIME8/TIME sequence failures: ',
+ + i, bigi, j
+ call doabort
+ end if
+
+ print *, 'Command-line arguments: ', iargc ()
+ do i = 0, iargc ()
+ call getarg (i, line)
+ print *, 'Arg ', i, ' is: ', line(:lenstr (line))
+ end do
+
l= isatty(6)
line2 = ttynam(6)
if (l) then
@@ -39,6 +106,15 @@
line = 'and 6 isn''t a tty device (ISATTY)'
end if
write (6,'(1X,A)') line(:lenstr(line))
+ call ttynam (6, line)
+ if (line .ne. line2) then
+ print *, '*** CALL TTYNAM disagrees with TTYNAM: ',
+ + line(:lenstr (line))
+ call doabort
+ end if
+
+* regression test for compiler crash fixed by JCB 1998-08-04 com.c
+ sigret = signal(2, ctrlc)
pid = getpid()
WRITE (6,'(A,I10)') ' Process id (GETPID): ', pid
@@ -49,23 +125,34 @@
call flush(6)
CALL SYSTEM ('echo " " `id`')
call flush
+
lognam = 'blahblahblah'
call getlog (lognam)
- write (6,*) 'Login name (GETLOG): ', lognam
+ write (6,*) 'Login name (GETLOG): ', lognam(:lenstr (lognam))
+
+ wd = 'blahblahblah'
+ call getenv ('LOGNAME', wd)
+ write (6,*) 'Login name (GETENV of LOGNAME): ', wd(:lenstr (wd))
+
call umask(0, mask)
write(6,*) 'UMASK returns', mask
call umask(mask)
ctim = fdate()
- write (6,*) 'FDATE returns: ', ctim
+ write (6,*) 'FDATE returns: ', ctim(:lenstr (ctim))
+ call fdate (ctim)
+ write (6,*) 'CALL FDATE returns: ', ctim(:lenstr (ctim))
+
j=time()
call ltime (j, ltarray)
write (6,'(1x,a,9i4)') 'LTIME returns:', ltarray
call gmtime (j, ltarray)
write (6,'(1x,a,9i4)') 'GMTIME returns:', ltarray
+
call system_clock(count) ! omitting optional args
call system_clock(count, rate, count_max)
write(6,*) 'SYSTEM_CLOCK returns: ', count, rate, count_max
+
call date_and_time(ddate) ! omitting optional args
call date_and_time(ddate, ttime, zone, values)
write(6, *) 'DATE_AND_TIME returns: ', ddate, ' ', ttime, ' ',
@@ -76,21 +163,23 @@
c consistency-check etime vs. dtime for first call
r1 = etime (tarray1)
- if (r1.ne.tarray1(1)+tarray1(2))
- + write (6,*) '*** ETIME didn''t return sum of the array: ',
- + r1, ' /= ', tarray1(1), '+', tarray1(2)
r2 = dtime (tarray2)
- if (abs (r1-r2).gt.1.0) write (6,*)
- + 'Results of ETIME and DTIME differ by more than a second:',
- + r1, r2
- call sgladd (sum, tarray1(1), tarray1(2))
- if (r1 .ne. sum)
- + write (6,*) '*** ETIME didn''t return sum of the array: ',
- + r1, ' /= ', tarray1(1), '+', tarray1(2)
- call sgladd (sum, tarray2(1), tarray2(2))
- if (r2 .ne. sum)
- + write (6,*) '*** DTIME didn''t return sum of the array: ',
- + r2, ' /= ', tarray2(1), '+', tarray2(2)
+ if (abs (r1-r2).gt.1.0) then
+ write (6,*)
+ + 'Results of ETIME and DTIME differ by more than a second:',
+ + r1, r2
+ call doabort
+ end if
+ if (.not. issum (r1, tarray1(1), tarray1(2))) then
+ write (6,*) '*** ETIME didn''t return sum of the array: ',
+ + r1, ' /= ', tarray1(1), '+', tarray1(2)
+ call doabort
+ end if
+ if (.not. issum (r2, tarray2(1), tarray2(2))) then
+ write (6,*) '*** DTIME didn''t return sum of the array: ',
+ + r2, ' /= ', tarray2(1), '+', tarray2(2)
+ call doabort
+ end if
write (6, '(A,3F10.3)')
+ ' Elapsed total, user, system time (ETIME): ',
+ r1, tarray1
@@ -100,18 +189,20 @@ c now try to get times to change enough to see in etime/dtime
do i = 1,1000
do j = 1,1000
end do
- r2 = dtime (tarray2)
+ call dtime (tarray2, r2)
if (tarray2(1) .ne. 0. .or. tarray2(2) .ne. 0.) exit
end do
- r1 = etime (tarray1)
- call sgladd (sum, tarray1(1), tarray1(2))
- if (r1 .ne. sum)
- + write (6,*) '*** ETIME didn''t return sum of the array: ',
- + r1, ' /= ', tarray1(1), '+', tarray1(2)
- call sgladd (sum, tarray2(1), tarray2(2))
- if (r2 .ne. sum)
- + write (6,*) '*** DTIME didn''t return sum of the array: ',
- + r2, ' /= ', tarray2(1), '+', tarray2(2)
+ call etime (tarray1, r1)
+ if (.not. issum (r1, tarray1(1), tarray1(2))) then
+ write (6,*) '*** ETIME didn''t return sum of the array: ',
+ + r1, ' /= ', tarray1(1), '+', tarray1(2)
+ call doabort
+ end if
+ if (.not. issum (r2, tarray2(1), tarray2(2))) then
+ write (6,*) '*** DTIME didn''t return sum of the array: ',
+ + r2, ' /= ', tarray2(1), '+', tarray2(2)
+ call doabort
+ end if
write (6, '(A,3F10.3)')
+ ' Differences in total, user, system time (DTIME): ',
+ r2, tarray2
@@ -122,29 +213,56 @@ c now try to get times to change enough to see in etime/dtime
call idate (i,j,k)
call idate (idat)
- write (6,*) 'IDATE d,m,y: ',idat
- print *, '... and the VXT version: ', i,j,k
+ write (6,*) 'IDATE (date,month,year): ',idat
+ print *, '... and the VXT version (month,date,year): ', i,j,k
+ if (i/=idat(2) .or. j/=idat(1) .or. k/=mod(idat(3),100)) then
+ print *, '*** VXT and U77 versions don''t agree'
+ call doabort
+ end if
+
+ call date (ctim)
+ write (6,*) 'DATE (dd-mmm-yy): ', ctim(:lenstr (ctim))
+
+ call itime (idat)
+ write (6,*) 'ITIME (hour,minutes,seconds): ', idat
+
call time(line(:8))
print *, 'TIME: ', line(:8)
+
write (6,*) 'SECNDS(0.0) returns: ',secnds(0.0)
+
write (6,*) 'SECOND returns: ', second()
call dumdum(r1)
call second(r1)
write (6,*) 'CALL SECOND returns: ', r1
+
+* compiler crash fixed by 1998-10-01 com.c change
+ if (rand(0).lt.0.0 .or. rand(0).gt.1.0) then
+ write (6,*) '*** rand(0) error'
+ call doabort()
+ end if
+
i = getcwd(wd)
if (i.ne.0) then
call perror ('*** getcwd')
+ call doabort
else
write (6,*) 'Current directory is "'//wd(:lenstr(wd))//'"'
end if
call chdir ('.',i)
- if (i.ne.0) write (6,*) '***CHDIR to ".": ', i
+ if (i.ne.0) then
+ write (6,*) '***CHDIR to ".": ', i
+ call doabort
+ end if
+
i=hostnm(wd)
if(i.ne.0) then
call perror ('*** hostnm')
+ call doabort
else
write (6,*) 'Host name is ', wd(:lenstr(wd))
end if
+
i = access('/dev/null ', 'rw')
if (i.ne.0) write (6,*) '***Read/write ACCESS to /dev/null: ', i
write (6,*) 'Creating file "foo" for testing...'
@@ -160,42 +278,83 @@ C the better to test with, my dear! (-- burley)
call fseek(3,0,0,*10)
go to 20
10 write(6,*) '***FSEEK failed'
+ call doabort
20 call fgetc(3, c,i)
- if (i.ne.0) write(6,*) '***FGETC: ', i
- if (c.ne.'c') write(6,*) '***FGETC read the wrong thing: ',
- + ichar(c)
+ if (i.ne.0) then
+ write(6,*) '***FGETC: ', i
+ call doabort
+ end if
+ if (c.ne.'c') then
+ write(6,*) '***FGETC read the wrong thing: ', ichar(c)
+ call doabort
+ end if
i= ftell(3)
- if (i.ne.1) write(6,*) '***FTELL offset: ', i
+ if (i.ne.1) then
+ write(6,*) '***FTELL offset: ', i
+ call doabort
+ end if
+ call ftell(3, i)
+ if (i.ne.1) then
+ write(6,*) '***CALL FTELL offset: ', i
+ call doabort
+ end if
call chmod ('foo', 'a+w',i)
- if (i.ne.0) write (6,*) '***CHMOD of "foo": ', i
+ if (i.ne.0) then
+ write (6,*) '***CHMOD of "foo": ', i
+ call doabort
+ end if
i = fstat (3, fstatb)
- if (i.ne.0) write (6,*) '***FSTAT of "foo": ', i
+ if (i.ne.0) then
+ write (6,*) '***FSTAT of "foo": ', i
+ call doabort
+ end if
i = stat ('foo', statb)
- if (i.ne.0) write (6,*) '***STAT of "foo": ', i
+ if (i.ne.0) then
+ write (6,*) '***STAT of "foo": ', i
+ call doabort
+ end if
write (6,*) ' with stat array ', statb
- if (statb(5).ne.getuid () .or. statb(6).ne.getgid() .or. statb(4)
- + .ne. 1) write (6,*) '*** FSTAT uid, gid or nlink is wrong'
+ if (statb(6) .ne. getgid ()) then
+ write (6,*) 'Note: FSTAT gid wrong (happens on some systems).'
+ end if
+ if (statb(5) .ne. getuid () .or. statb(4) .ne. 1) then
+ write (6,*) '*** FSTAT uid or nlink is wrong'
+ call doabort
+ end if
do i=1,13
- if (fstatb (i) .ne. statb (i))
- + write (6,*) '*** FSTAT and STAT don''t agree on '// '
- + array element ', i, ' value ', fstatb (i), statb (i)
+ if (fstatb (i) .ne. statb (i)) then
+ write (6,*) '*** FSTAT and STAT don''t agree on '// '
+ + array element ', i, ' value ', fstatb (i), statb (i)
+ call doabort
+ end if
end do
i = lstat ('foo', fstatb)
do i=1,13
- if (fstatb (i) .ne. statb (i))
- + write (6,*) '*** LSTAT and STAT don''t agree on '// '
- + array element ', i, ' value ', fstatb (i), statb (i)
+ if (fstatb (i) .ne. statb (i)) then
+ write (6,*) '*** LSTAT and STAT don''t agree on '//
+ + 'array element ', i, ' value ', fstatb (i), statb (i)
+ call doabort
+ end if
end do
C in case it exists already:
call unlink ('bar',i)
call link ('foo ', 'bar ',i)
- if (i.ne.0)
- + write (6,*) '***LINK "foo" to "bar" failed: ', i
+ if (i.ne.0) then
+ write (6,*) '***LINK "foo" to "bar" failed: ', i
+ call doabort
+ end if
call unlink ('foo',i)
- if (i.ne.0) write (6,*) '***UNLINK "foo" failed: ', i
+ if (i.ne.0) then
+ write (6,*) '***UNLINK "foo" failed: ', i
+ call doabort
+ end if
call unlink ('foo',i)
- if (i.eq.0) write (6,*) '***UNLINK "foo" again: ', i
+ if (i.eq.0) then
+ write (6,*) '***UNLINK "foo" again: ', i
+ call doabort
+ end if
+
call gerror (gerr)
i = ierrno()
write (6,'(A,I3,A/1X,A)') ' The current error number is: ',
@@ -205,27 +364,52 @@ C in case it exists already:
call getarg (0, line)
call perror (line (:lenstr (line)))
call unlink ('bar')
+
+ print *, 'MCLOCK returns ', mclock ()
+ print *, 'MCLOCK8 returns ', mclock8 ()
+
+ call cpu_time (d1)
+ print *, 'CPU_TIME returns ', d1
+
WRITE (6,*) 'You should see exit status 1'
CALL EXIT(1)
99 END
+* Return length of STR not including trailing blanks, but always > 0.
integer function lenstr (str)
-C return length of STR not including trailing blanks, but always
-C return >0
- character *(*) str
+ character*(*) str
if (str.eq.' ') then
lenstr=1
else
lenstr = lnblnk (str)
end if
end
-* just make sure SECOND() doesn't "magically" work the second time.
+
+* Just make sure SECOND() doesn't "magically" work the second time.
subroutine dumdum(r)
r = 3.14159
end
-* do an add that is most likely to be done in single precision.
- subroutine sgladd(sum,left,right)
+
+* Test whether sum is approximately left+right.
+ logical function issum (sum, left, right)
implicit none
- real sum,left,right
- sum = left+right
+ real sum, left, right
+ real mysum, delta, width
+ mysum = left + right
+ delta = abs (mysum - sum)
+ width = abs (left) + abs (right)
+ issum = (delta .le. .0001 * width)
+ end
+
+* Signal handler
+ subroutine ctrlc
+ print *, 'Got ^C'
+ call doabort
+ end
+
+* A problem has been noticed, so maybe abort the test.
+ subroutine doabort
+* For this version, print out all problems noticed.
+* intrinsic abort
+* call abort
end
diff --git a/contrib/libf2c/libU77/vxtidate_.c b/contrib/libf2c/libU77/vxtidate_.c
index 03133ff..dc817a7 100644
--- a/contrib/libf2c/libU77/vxtidate_.c
+++ b/contrib/libf2c/libU77/vxtidate_.c
@@ -38,10 +38,10 @@ Boston, MA 02111-1307, USA. */
/* Subroutine */
#ifdef KR_headers
-int G77_vxtidate_0 (m, d, y)
+int G77_vxtidate_y2kbug_0 (m, d, y)
integer *y, *m, *d;
#else
-int G77_vxtidate_0 (integer *m, integer *d, integer *y)
+int G77_vxtidate_y2kbug_0 (integer *m, integer *d, integer *y)
#endif
{
struct tm *lt;
OpenPOWER on IntegriCloud