This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

(8/8) i386-mingw32 fixes: libU77


Patch for egcs toplevel to enable i386-mingw32 support.

Thu Dec 18 18:40:17 1997  Mumit Khan <khan@xraylith.wisc.edu>
       
	* libU77/configure.in (sys/param.h,sys/times.h): Check.
	(times,alarm): Likewise.
	* libU77/config.h.in (HAVE_SYS_PARAM_H, HAVE_SYS_TIMES_H,
	HAVE_ALARM, HAVE_TIMES): New defs.
	* libU77/alarm_.c: Conditionalize for target platform. Set errno
	to ENOSYS if target libc doesn't have the function.
	* libU77/dtime_.c: Likewise.
	* libU77/etime_.c: Likewise.
	* libU77/sys_clock_.c: Likewise.

Index: egcs/gcc/f/runtime/libU77/alarm_.c
diff -c egcs/gcc/f/runtime/libU77/alarm_.c:1.1.1.1 egcs/gcc/f/runtime/libU77/alarm_.c:1.2
*** egcs/gcc/f/runtime/libU77/alarm_.c:1.1.1.1	Sat Dec 20 12:11:11 1997
--- egcs/gcc/f/runtime/libU77/alarm_.c	Sun Dec 21 02:13:43 1997
***************
*** 24,29 ****
--- 24,30 ----
  #  include <unistd.h>
  #endif
  
+ #include <errno.h>		/* for ENOSYS */
  #include "f2c.h"
  
  #ifndef RETSIGTYPE
***************
*** 50,59 ****
  #endif
  {
    int status;
! 
    if (signal(SIGALRM, (sig_type)proc) == SIG_ERR)
      status = -1;
    else
      status = alarm (*seconds);
    return status;
  }
--- 51,64 ----
  #endif
  {
    int status;
! #if defined (HAVE_ALARM) && defined (SIGALRM)
    if (signal(SIGALRM, (sig_type)proc) == SIG_ERR)
      status = -1;
    else
      status = alarm (*seconds);
+ #else /* ! HAVE_ALARM || ! SIGALRM */
+   errno = ENOSYS;
+   status = -1;
+ #endif
    return status;
  }
Index: egcs/gcc/f/runtime/libU77/config.h.in
diff -c egcs/gcc/f/runtime/libU77/config.h.in:1.1.1.1 egcs/gcc/f/runtime/libU77/config.h.in:1.2
*** egcs/gcc/f/runtime/libU77/config.h.in:1.1.1.1	Sat Dec 20 12:11:11 1997
--- egcs/gcc/f/runtime/libU77/config.h.in	Sun Dec 21 02:13:43 1997
***************
*** 71,73 ****
--- 71,86 ----
  
  /* Define if you have the <unistd.h> header file.  */
  #undef HAVE_UNISTD_H
+ 
+ /* Define if you have the <sys/param.h> header file.  */
+ #undef HAVE_SYS_PARAM_H
+ 
+ /* Define if you have the <sys/times.h> header file.  */
+ #undef HAVE_SYS_TIMES_H
+ 
+ /* Define if you have the alarm function.  */
+ #undef HAVE_ALARM
+ 
+ /* Define if you have the times function.  */
+ #undef HAVE_TIMES
+ 
Index: egcs/gcc/f/runtime/libU77/configure.in
diff -c egcs/gcc/f/runtime/libU77/configure.in:1.1.1.1 egcs/gcc/f/runtime/libU77/configure.in:1.2
*** egcs/gcc/f/runtime/libU77/configure.in:1.1.1.1	Sat Dec 20 12:11:11 1997
--- egcs/gcc/f/runtime/libU77/configure.in	Sun Dec 21 02:13:43 1997
***************
*** 79,85 ****
  dnl AC_MSG_RESULT($ac_cv_sys_proto)              
  
  AC_HEADER_TIME
! AC_CHECK_HEADERS(limits.h unistd.h sys/time.h string.h stdlib.h)
  
  dnl Checks for typedefs, structures, and compiler characteristics.
  AC_C_CONST
--- 79,86 ----
  dnl AC_MSG_RESULT($ac_cv_sys_proto)              
  
  AC_HEADER_TIME
! AC_CHECK_HEADERS(limits.h unistd.h sys/time.h string.h stdlib.h \
!   sys/param.h sys/times.h)
  
  dnl Checks for typedefs, structures, and compiler characteristics.
  AC_C_CONST
***************
*** 96,102 ****
  
  dnl Checks for library functions.
  
! AC_CHECK_FUNCS(symlink getcwd getwd lstat gethostname strerror clock getrusage)
  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"
--- 97,104 ----
  
  dnl Checks for library functions.
  
! AC_CHECK_FUNCS(symlink getcwd getwd lstat gethostname strerror clock \
!   getrusage times alarm)
  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"
Index: egcs/gcc/f/runtime/libU77/dtime_.c
diff -c egcs/gcc/f/runtime/libU77/dtime_.c:1.1.1.1 egcs/gcc/f/runtime/libU77/dtime_.c:1.2
*** egcs/gcc/f/runtime/libU77/dtime_.c:1.1.1.1	Sat Dec 20 12:11:11 1997
--- egcs/gcc/f/runtime/libU77/dtime_.c	Sun Dec 21 02:13:43 1997
***************
*** 23,34 ****
  #  include <unistd.h>
  #endif
  #include <sys/types.h>
! #include <sys/times.h>
! #include <sys/param.h>
  #if HAVE_GETRUSAGE
  #  include <sys/time.h>
  #  include <sys/resource.h>
  #endif
  #include "f2c.h"
  
  /* For dtime, etime we store the clock tick parameter (clk_tck) the
--- 23,39 ----
  #  include <unistd.h>
  #endif
  #include <sys/types.h>
! #if HAVE_SYS_TIMES_H
! #  include <sys/times.h>
! #endif
! #if HAVE_SYS_PARAM_H
! #  include <sys/param.h>
! #endif
  #if HAVE_GETRUSAGE
  #  include <sys/time.h>
  #  include <sys/resource.h>
  #endif
+ #include <errno.h>		/* for ENOSYS */
  #include "f2c.h"
  
  /* For dtime, etime we store the clock tick parameter (clk_tck) the
***************
*** 45,50 ****
--- 50,56 ----
  double G77_dtime_0 (real tarray[2])
  #endif
  {
+ #if defined (HAVE_GETRUSAGE) || defined (HAVE_TIMES)
    /* The getrusage version is only the default for convenience. */
  #ifdef HAVE_GETRUSAGE
    float utime, stime;
***************
*** 85,88 ****
--- 91,98 ----
  #endif /* HAVE_GETRUSAGE */
    old_utime = utime; old_stime = stime;
    return (tarray[0]+tarray[1]);
+ #else /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */
+   errno = ENOSYS;
+   return 0.0;
+ #endif /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */
  }
Index: egcs/gcc/f/runtime/libU77/etime_.c
diff -c egcs/gcc/f/runtime/libU77/etime_.c:1.1.1.1 egcs/gcc/f/runtime/libU77/etime_.c:1.2
*** egcs/gcc/f/runtime/libU77/etime_.c:1.1.1.1	Sat Dec 20 12:11:11 1997
--- egcs/gcc/f/runtime/libU77/etime_.c	Sun Dec 21 02:13:43 1997
***************
*** 23,34 ****
  #  include <unistd.h>
  #endif
  #include <sys/types.h>
! #include <sys/times.h>
! #include <sys/param.h>
  #if HAVE_GETRUSAGE
  #  include <sys/time.h>
  #  include <sys/resource.h>
  #endif
  #include "f2c.h"
  
  /* For dtime, etime we store the clock tick parameter (clk_tck) the
--- 23,39 ----
  #  include <unistd.h>
  #endif
  #include <sys/types.h>
! #if HAVE_SYS_TIMES_H
! #  include <sys/times.h>
! #endif
! #if HAVE_SYS_PARAM_H
! #  include <sys/param.h>
! #endif
  #if HAVE_GETRUSAGE
  #  include <sys/time.h>
  #  include <sys/resource.h>
  #endif
+ #include <errno.h>		/* for ENOSYS */
  #include "f2c.h"
  
  /* For dtime, etime we store the clock tick parameter (clk_tck) the
***************
*** 45,50 ****
--- 50,56 ----
  double G77_etime_0 (real tarray[2])
  #endif
  {
+ #if defined (HAVE_GETRUSAGE) || defined (HAVE_TIMES)
    /* The getrusage version is only the default for convenience. */
  #ifdef HAVE_GETRUSAGE
    struct rusage rbuff;
***************
*** 77,80 ****
--- 83,90 ----
    tarray[1] = (float) buffer.tms_stime / (float)clk_tck;
  #endif /* HAVE_GETRUSAGE */
    return (tarray[0]+tarray[1]);
+ #else /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */
+   errno = ENOSYS;
+   return 0.0;
+ #endif /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */
  }
Index: egcs/gcc/f/runtime/libU77/link_.c
diff -c egcs/gcc/f/runtime/libU77/link_.c:1.1.1.1 egcs/gcc/f/runtime/libU77/link_.c:1.2
*** egcs/gcc/f/runtime/libU77/link_.c:1.1.1.1	Sat Dec 20 12:11:11 1997
--- egcs/gcc/f/runtime/libU77/link_.c	Sun Dec 21 02:13:43 1997
***************
*** 28,34 ****
  #  include <unistd.h>
  #endif
  #include <errno.h>
! #include <sys/param.h>
  #include "f2c.h"
  
  #ifdef KR_headers
--- 28,36 ----
  #  include <unistd.h>
  #endif
  #include <errno.h>
! #if HAVE_SYS_PARAM_H
! #  include <sys/param.h>
! #endif
  #include "f2c.h"
  
  #ifdef KR_headers
Index: egcs/gcc/f/runtime/libU77/symlnk_.c
diff -c egcs/gcc/f/runtime/libU77/symlnk_.c:1.1.1.1 egcs/gcc/f/runtime/libU77/symlnk_.c:1.2
*** egcs/gcc/f/runtime/libU77/symlnk_.c:1.1.1.1	Sat Dec 20 12:11:12 1997
--- egcs/gcc/f/runtime/libU77/symlnk_.c	Sun Dec 21 02:13:43 1997
***************
*** 28,34 ****
  #  include <unistd.h>
  #endif
  #include <errno.h>
! #include <sys/param.h>
  #include "f2c.h"
  
  #ifdef KR_headers
--- 28,36 ----
  #  include <unistd.h>
  #endif
  #include <errno.h>
! #if HAVE_SYS_PARAM_H
! #  include <sys/param.h>
! #endif
  #include "f2c.h"
  
  #ifdef KR_headers
Index: egcs/gcc/f/runtime/libU77/sys_clock_.c
diff -c egcs/gcc/f/runtime/libU77/sys_clock_.c:1.1.1.1 egcs/gcc/f/runtime/libU77/sys_clock_.c:1.2
*** egcs/gcc/f/runtime/libU77/sys_clock_.c:1.1.1.1	Sat Dec 20 12:11:12 1997
--- egcs/gcc/f/runtime/libU77/sys_clock_.c	Sun Dec 21 02:13:44 1997
***************
*** 29,39 ****
  #  include <time.h>
  # endif
  #endif
! #include <sys/times.h>
  #include <limits.h>
  #if HAVE_UNISTD_H
  #  include <unistd.h>
  #endif
  #include "f2c.h"
  
  #ifdef KR_headers
--- 29,42 ----
  #  include <time.h>
  # endif
  #endif
! #if HAVE_SYS_TIMES_H
! #  include <sys/times.h>
! #endif
  #include <limits.h>
  #if HAVE_UNISTD_H
  #  include <unistd.h>
  #endif
+ #include <errno.h>		/* for ENOSYS */
  #include "f2c.h"
  
  #ifdef KR_headers
***************
*** 43,48 ****
--- 46,52 ----
  int G77_system_clock_0 (integer *count, integer *count_rate, integer *count_max)
  #endif
  {
+ #if defined (HAVE_TIMES)
    struct tms buffer;
    unsigned long cnt;
  #ifdef _SC_CLK_TCK
***************
*** 63,66 ****
--- 67,74 ----
    else
      *count = cnt;
    return 0;
+ #else /* ! HAVE_TIMES */
+   errno = ENOSYS;
+   return -1;
+ #endif /* ! HAVE_TIMES */
  }
Index: egcs/gcc/f/runtime/libU77/unlink_.c
diff -c egcs/gcc/f/runtime/libU77/unlink_.c:1.1.1.1 egcs/gcc/f/runtime/libU77/unlink_.c:1.2
*** egcs/gcc/f/runtime/libU77/unlink_.c:1.1.1.1	Sat Dec 20 12:11:12 1997
--- egcs/gcc/f/runtime/libU77/unlink_.c	Sun Dec 21 02:13:44 1997
***************
*** 28,34 ****
  #  include <unistd.h>
  #endif
  #include <errno.h>
! #include <sys/param.h>
  #include "f2c.h"
  
  #ifdef KR_headers
--- 28,36 ----
  #  include <unistd.h>
  #endif
  #include <errno.h>
! #if HAVE_SYS_PARAM_H
! #  include <sys/param.h>
! #endif
  #include "f2c.h"
  
  #ifdef KR_headers

Regards,
Mumit -- khan@xraylith.wisc.edu
http://www.xraylith.wisc.edu/~khan/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]