(7/8) i386-mingw32 fixes: libf2c
Mumit Khan
khan@xraylith.wisc.edu
Sun Dec 21 00:41:00 GMT 1997
Patch for egcs toplevel to enable i386-mingw32 support.
Thu Dec 18 18:40:17 1997 Mumit Khan <khan@xraylith.wisc.edu>
* configure.in (NON_UNIX_STDIO): Define if MINGW32.
(NON_ANSI_RW_MODE): Do not define for CYGWIN32 or MINGW32.
* libI77/rawio.h: Don't providing conflicting declarations for
read() and write(). MINGW32 header files use "const" quals.
* libF77/s_paus.c: _WIN32 does not have pause().
Index: egcs/gcc/f/runtime/configure.in
diff -c egcs/gcc/f/runtime/configure.in:1.1.1.1 egcs/gcc/f/runtime/configure.in:1.2
*** egcs/gcc/f/runtime/configure.in:1.1.1.1 Sat Dec 20 12:11:08 1997
--- egcs/gcc/f/runtime/configure.in Sat Dec 20 16:47:43 1997
***************
*** 118,123 ****
--- 118,136 ----
g77_cv_sys_cygwin32=no))
AC_MSG_RESULT($g77_cv_sys_cygwin32)
+ # ditto for mingw32.
+ AC_MSG_CHECKING([for mingw32])
+ AC_CACHE_VAL(g77_cv_sys_mingw32,
+ AC_EGREP_CPP(yes,
+ [#ifdef __MINGW32__
+ yes
+ #endif
+ ],
+ g77_cv_sys_mingw32=yes,
+ g77_cv_sys_mingw32=no))
+ AC_MSG_RESULT($g77_cv_sys_mingw32)
+
+
AC_CHECK_HEADER(fcntl.h,
test $g77_cv_header_posix = yes && AC_DEFINE(_POSIX_SOURCE),
AC_DEFINE(NO_FCNTL) AC_DEFINE(OPEN_DECL))
***************
*** 141,150 ****
# This should always succeed on unix.
# Apparently positive result on cygwin loses re. NON_UNIX_STDIO
! # (as of cygwin b18).
AC_CHECK_FUNC(fstat)
AC_MSG_CHECKING([need for NON_UNIX_STDIO])
! if test $g77_cv_sys_cygwin32 = yes || test $ac_cv_func_fstat = no; then
AC_MSG_RESULT(yes)
AC_DEFINE(NON_UNIX_STDIO)
else
--- 154,165 ----
# This should always succeed on unix.
# Apparently positive result on cygwin loses re. NON_UNIX_STDIO
! # (as of cygwin b18). Likewise on mingw.
AC_CHECK_FUNC(fstat)
AC_MSG_CHECKING([need for NON_UNIX_STDIO])
! if test $g77_cv_sys_cygwin32 = yes \
! || test $g77_cv_sys_mingw32 = yes \
! || test $ac_cv_func_fstat = no; then
AC_MSG_RESULT(yes)
AC_DEFINE(NON_UNIX_STDIO)
else
***************
*** 215,221 ****
yes
#endif
], is_unix=yes, is_unix=no)
! if test $g77_cv_sys_cygwin32 = yes; then
AC_MSG_RESULT(no)
else
if test $is_unix = yes; then
--- 230,236 ----
yes
#endif
], is_unix=yes, is_unix=no)
! if test $g77_cv_sys_cygwin32 = yes || test $g77_cv_sys_mingw32 = yes; then
AC_MSG_RESULT(no)
else
if test $is_unix = yes; then
Index: egcs/gcc/f/runtime/libF77/s_paus.c
diff -c egcs/gcc/f/runtime/libF77/s_paus.c:1.1.1.1 egcs/gcc/f/runtime/libF77/s_paus.c:1.2
*** egcs/gcc/f/runtime/libF77/s_paus.c:1.1.1.1 Sat Dec 20 12:11:10 1997
--- egcs/gcc/f/runtime/libF77/s_paus.c Sat Dec 20 17:00:21 1997
***************
*** 60,66 ****
if( isatty(fileno(stdin)) )
s_1paus(stdin);
else {
! #if (defined (MSDOS) && !defined (GO32)) || defined(__CYGWIN32__)
FILE *fin;
fin = fopen("con", "r");
if (!fin) {
--- 60,66 ----
if( isatty(fileno(stdin)) )
s_1paus(stdin);
else {
! #if (defined (MSDOS) && !defined (GO32)) || defined (_WIN32)
FILE *fin;
fin = fopen("con", "r");
if (!fin) {
Index: egcs/gcc/f/runtime/libI77/rawio.h
diff -c egcs/gcc/f/runtime/libI77/rawio.h:1.1.1.1 egcs/gcc/f/runtime/libI77/rawio.h:1.2
*** egcs/gcc/f/runtime/libI77/rawio.h:1.1.1.1 Sat Dec 20 12:11:11 1997
--- egcs/gcc/f/runtime/libI77/rawio.h Sat Dec 20 17:00:21 1997
***************
*** 19,25 ****
--- 19,27 ----
extern int creat(const char*,int), open(const char*,int);
#endif
extern int close(int);
+ #if !(defined(_WIN32) && !defined(__CYGWIN32__))
extern int read(int,void*,size_t), write(int,void*,size_t);
+ #endif
extern int unlink(const char*);
#ifndef _POSIX_SOURCE
#ifndef NON_UNIX_STDIO
Regards,
Mumit -- khan@xraylith.wisc.edu
http://www.xraylith.wisc.edu/~khan/
More information about the Gcc-bugs
mailing list