diff options
author | obrien <obrien@FreeBSD.org> | 2000-06-04 08:30:31 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2000-06-04 08:30:31 +0000 |
commit | dbfeddd336557220b675ba403dcd056ac793c80f (patch) | |
tree | 6c8efa98b1dbe4422b55079f3eacc9fd3d9ebe86 /contrib/libf2c/libU77 | |
parent | b98ca06a57c4e10b0fef3580c32b03a8cefa4191 (diff) | |
download | FreeBSD-src-dbfeddd336557220b675ba403dcd056ac793c80f.zip FreeBSD-src-dbfeddd336557220b675ba403dcd056ac793c80f.tar.gz |
Import of a GCC 2.96 SNAPSHOT taken from the trunk of the GCC anoncvs
server on 3-June-2000.
Diffstat (limited to 'contrib/libf2c/libU77')
-rw-r--r-- | contrib/libf2c/libU77/Version.c | 2 | ||||
-rw-r--r-- | contrib/libf2c/libU77/acconfig.h | 5 | ||||
-rw-r--r-- | contrib/libf2c/libU77/aclocal.m4 | 80 | ||||
-rw-r--r-- | contrib/libf2c/libU77/config.hin | 7 | ||||
-rwxr-xr-x | contrib/libf2c/libU77/configure | 183 | ||||
-rw-r--r-- | contrib/libf2c/libU77/configure.in | 13 | ||||
-rw-r--r-- | contrib/libf2c/libU77/datetime_.c | 24 | ||||
-rw-r--r-- | contrib/libf2c/libU77/ttynam_.c | 2 | ||||
-rw-r--r-- | contrib/libf2c/libU77/u77-test.f | 4 |
9 files changed, 263 insertions, 57 deletions
diff --git a/contrib/libf2c/libU77/Version.c b/contrib/libf2c/libU77/Version.c index 0d72381..fb31ed4 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.25 19991024 (release)"; +char __G77_LIBU77_VERSION__[] = "0.5.25 20000603 (prerelease)"; #include <stdio.h> diff --git a/contrib/libf2c/libU77/acconfig.h b/contrib/libf2c/libU77/acconfig.h index 1400ba5..778e154 100644 --- a/contrib/libf2c/libU77/acconfig.h +++ b/contrib/libf2c/libU77/acconfig.h @@ -4,3 +4,8 @@ /* Define if your sys/time.h defines struct timezone. */ #undef HAVE_STRUCT_TIMEZONE +/* Define if your gettimeofday takes only one argument. */ +#undef GETTIMEOFDAY_ONE_ARGUMENT + +/* Define if your gettimeofday takes a time zome argument. */ +#undef HAVE_TIMEZONE diff --git a/contrib/libf2c/libU77/aclocal.m4 b/contrib/libf2c/libU77/aclocal.m4 index d230dad..b9a74fd 100644 --- a/contrib/libf2c/libU77/aclocal.m4 +++ b/contrib/libf2c/libU77/aclocal.m4 @@ -1,16 +1,64 @@ -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 - +dnl Check: +dnl * If we have gettimeofday; +dnl * If we have struct timezone for use in calling it; +dnl * If calling it with a timezone pointer actually works -- this is deemed +dnl obsolete or undefined on some systems which say you should use a null +dnl pointer -- and undefine HAVE_TIMEZONE if so; +dnl * Whether it only takes one arg. +AC_DEFUN(LIBU77_GETTIMEOFDAY, [ + AC_CHECK_FUNCS(gettimeofday) + if test "$ac_cv_func_gettimeofday" = yes; then + AC_CACHE_CHECK([for struct timezone], g77_cv_struct_timezone, + [AC_TRY_COMPILE([#include <sys/time.h>], + [struct timezone tz;], + g77_cv_struct_timezone=yes, g77_cv_struct_timezone=no)]) + if test $g77_cv_struct_timezone = yes; then + dnl It may be that we can't call gettimeofday with a non-null pointer. + dnl In that case we'll lie about struct timezone. + AC_TRY_RUN([ +#ifdef TIME_WITH_SYS_TIME +#include <sys/time.h> +#include <time.h> +#else +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#else +#include <time.h> +#endif +#endif +main () +{ + struct timeval time; + struct timezone dummy; + if (gettimeofday (&time, &dummy)) + exit (1); + else + exit (0); +}], + [AC_DEFINE(HAVE_TIMEZONE)], ,[AC_DEFINE(HAVE_TIMEZONE)]) + fi + AC_REQUIRE([AC_HEADER_TIME]) + AC_CACHE_CHECK(whether gettimeofday can accept two arguments, + emacs_cv_gettimeofday_two_arguments, + AC_TRY_LINK([ +#ifdef TIME_WITH_SYS_TIME +#include <sys/time.h> +#include <time.h> +#else +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#else +#include <time.h> +#endif +#endif + ], + [ + struct timeval time; + struct timezone dummy; + gettimeofday (&time, &dummy);], + emacs_cv_gettimeofday_two_arguments=yes, + emacs_cv_gettimeofday_two_arguments=no)) + if test $emacs_cv_gettimeofday_two_arguments = no; then + AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT) + fi + fi]) diff --git a/contrib/libf2c/libU77/config.hin b/contrib/libf2c/libU77/config.hin index 27a89c05..19f5399 100644 --- a/contrib/libf2c/libU77/config.hin +++ b/contrib/libf2c/libU77/config.hin @@ -33,8 +33,11 @@ /* 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 your gettimeofday takes only one argument. */ +#undef GETTIMEOFDAY_ONE_ARGUMENT + +/* Define if your gettimeofday takes a time zome argument. */ +#undef HAVE_TIMEZONE /* Define if you have the alarm function. */ #undef HAVE_ALARM diff --git a/contrib/libf2c/libU77/configure b/contrib/libf2c/libU77/configure index fc8a490..b9a3b22 100755 --- a/contrib/libf2c/libU77/configure +++ b/contrib/libf2c/libU77/configure @@ -1448,16 +1448,15 @@ fi for ac_func in symlink getcwd getwd lstat gethostname strerror clock \ - getrusage times alarm getlogin getgid getuid kill link ttyname \ - gettimeofday + getrusage times alarm getlogin getgid getuid kill link ttyname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1456: checking for $ac_func" >&5 +echo "configure:1455: 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 1461 "configure" +#line 1460 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1480,7 +1479,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1483: \"$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 @@ -1504,46 +1503,188 @@ else fi done -test $ac_cv_func_symlink = yes && MAYBES="$MAYBES symlnk_.o" -test $ac_cv_func_lstat = yes && MAYBES="$MAYBES lstat_.o" -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 + for ac_func in gettimeofday +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1512: 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 1520 "configure" +#line 1517 "configure" #include "confdefs.h" -#include <sys/time.h> +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + int main() { -struct timezone tz; + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + ; return 0; } EOF -if { (eval echo configure:1527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - libu77_ac_have_struct_timezone=yes + eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - libu77_ac_have_struct_timezone=no + eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi -if test $libu77_ac_have_struct_timezone = yes; then +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <<EOF -#define HAVE_STRUCT_TIMEZONE 1 +#define $ac_tr_func 1 EOF - + else echo "$ac_t""no" 1>&6 fi +done + + if test "$ac_cv_func_gettimeofday" = yes; then + echo $ac_n "checking for struct timezone""... $ac_c" 1>&6 +echo "configure:1566: checking for struct timezone" >&5 +if eval "test \"`echo '$''{'g77_cv_struct_timezone'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1571 "configure" +#include "confdefs.h" +#include <sys/time.h> +int main() { +struct timezone tz; +; return 0; } +EOF +if { (eval echo configure:1578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + g77_cv_struct_timezone=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + g77_cv_struct_timezone=no +fi +rm -f conftest* +fi + +echo "$ac_t""$g77_cv_struct_timezone" 1>&6 + if test $g77_cv_struct_timezone = yes; then + if test "$cross_compiling" = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_TIMEZONE 1 +EOF + +else + cat > conftest.$ac_ext <<EOF +#line 1599 "configure" +#include "confdefs.h" + +#ifdef TIME_WITH_SYS_TIME +#include <sys/time.h> +#include <time.h> +#else +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#else +#include <time.h> +#endif +#endif +main () +{ + struct timeval time; + struct timezone dummy; + if (gettimeofday (&time, &dummy)) + exit (1); + else + exit (0); +} +EOF +if { (eval echo configure:1622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + cat >> confdefs.h <<\EOF +#define HAVE_TIMEZONE 1 +EOF + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -fr conftest* +fi + + fi + + echo $ac_n "checking whether gettimeofday can accept two arguments""... $ac_c" 1>&6 +echo "configure:1638: checking whether gettimeofday can accept two arguments" >&5 +if eval "test \"`echo '$''{'emacs_cv_gettimeofday_two_arguments'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1643 "configure" +#include "confdefs.h" + +#ifdef TIME_WITH_SYS_TIME +#include <sys/time.h> +#include <time.h> +#else +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#else +#include <time.h> +#endif +#endif + +int main() { + + struct timeval time; + struct timezone dummy; + gettimeofday (&time, &dummy); +; return 0; } +EOF +if { (eval echo configure:1664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + emacs_cv_gettimeofday_two_arguments=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + emacs_cv_gettimeofday_two_arguments=no +fi +rm -f conftest* +fi + +echo "$ac_t""$emacs_cv_gettimeofday_two_arguments" 1>&6 + if test $emacs_cv_gettimeofday_two_arguments = no; then + cat >> confdefs.h <<\EOF +#define GETTIMEOFDAY_ONE_ARGUMENT 1 +EOF + + fi + fi + +test $ac_cv_func_symlink = yes && MAYBES="$MAYBES symlnk_.o" +test $ac_cv_func_lstat = yes && MAYBES="$MAYBES lstat_.o" +test $ac_cv_func_gethostname = yes && MAYBES="$MAYBES hostnm_.o" +test $ac_cv_func_clock = yes && MAYBES="$MAYBES mclock_.o" diff --git a/contrib/libf2c/libU77/configure.in b/contrib/libf2c/libU77/configure.in index 1262645..460e3dc 100644 --- a/contrib/libf2c/libU77/configure.in +++ b/contrib/libf2c/libU77/configure.in @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -# Copyright (C) 1995, 1998 Free Software Foundation, Inc. +# Copyright (C) 1995, 1998, 1999 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # #This file is part of the GNU Fortran libU77 library. @@ -86,16 +86,19 @@ AC_CHECK_LIB(socket, gethostname, [LIBS="$LIBS -lsocket"]) dnl Checks for library functions. AC_CHECK_FUNCS(symlink getcwd getwd lstat gethostname strerror clock \ - getrusage times alarm getlogin getgid getuid kill link ttyname \ - gettimeofday) + getrusage times alarm getlogin getgid getuid kill link ttyname) + +dnl The standard autoconf HAVE_STRUCT_TIMEZONE doesn't actually check +dnl for struct timezone, as you might think. We also need to check how +dnl to call gettimeofday if we have it. +LIBU77_GETTIMEOFDAY + test $ac_cv_func_symlink = yes && MAYBES="$MAYBES symlnk_.o" test $ac_cv_func_lstat = yes && MAYBES="$MAYBES lstat_.o" 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) AC_SUBST(RANLIB_TEST) diff --git a/contrib/libf2c/libU77/datetime_.c b/contrib/libf2c/libU77/datetime_.c index faf773a..1ea7731 100644 --- a/contrib/libf2c/libU77/datetime_.c +++ b/contrib/libf2c/libU77/datetime_.c @@ -57,24 +57,30 @@ int G77_date_and_time_0 (char *date, char *fftime, char *zone, vals[4] = ltime.tm_hour; vals[5] = ltime.tm_min; vals[6] = ltime.tm_sec; - vals[7] = 0; /* no STDC way to get this */ + vals[7] = 0; /* no STDC/POSIX way to get this */ /* GNUish way; maybe use `ftime' on other systems. */ #if HAVE_GETTIMEOFDAY { struct timeval tp; -#if HAVE_STRUCT_TIMEZONE +# if GETTIMEOFDAY_ONE_ARGUMENT + if (! gettimeofday (&tp)) +# else +# 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. */ + /* Some systems such as HPUX, do 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. Configure checks if gettimeofday actually fails with a + non-NULL arg and pretends that struct timezone is missing if it + does fail. */ if (! gettimeofday (&tp, &tzp)) -#else +# else if (! gettimeofday (&tp, (void *) 0)) -#endif +# endif /* HAVE_STRUCT_TIMEZONE */ +# endif /* GETTIMEOFDAY_ONE_ARGUMENT */ vals[7] = tp.tv_usec/1000; } -#endif +#endif /* HAVE_GETTIMEOFDAY */ if (values) /* null pointer for missing optional */ for (i=0; i<=7; i++) values[i] = vals[i]; diff --git a/contrib/libf2c/libU77/ttynam_.c b/contrib/libf2c/libU77/ttynam_.c index cb1d1e9..c7610fb 100644 --- a/contrib/libf2c/libU77/ttynam_.c +++ b/contrib/libf2c/libU77/ttynam_.c @@ -59,6 +59,6 @@ extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); } #else errno = ENOSYS; - return -1; + s_copy (ret_val, " ", ret_val_len, 1); #endif } diff --git a/contrib/libf2c/libU77/u77-test.f b/contrib/libf2c/libU77/u77-test.f index 65e972a..3c8151c 100644 --- a/contrib/libf2c/libU77/u77-test.f +++ b/contrib/libf2c/libU77/u77-test.f @@ -58,8 +58,8 @@ 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, ctim2*25 + character ctim*25, line*80, lognam*20, wd*1000, line2*80, + + ddate*8, ttime*10, zone*5, ctim2*25 integer fstatb (13), statb (13) integer *2 i2zero integer values(8) |