delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/08/04:30:24

Message-ID: <35A33C50.99A06D38@catalysis.nsk.su>
Date: Wed, 08 Jul 1998 15:30:56 +0600
From: Alexey Yakovlev <jack AT catalysis DOT nsk DOT su>
Organization: Inst. of Catalysis
MIME-Version: 1.0
To: Andris Pavenis <pavenis AT lanet DOT lv>
CC: djgpp AT delorie DOT com, Craig Burley <burley AT gnu DOT org>
Subject: Re: Inconsistencies between g77 v0.5.23 and v0.5.19
References: <Pine DOT A32 DOT 3 DOT 91 DOT 980707084027 DOT 56086A-100000 AT ieva01 DOT lanet DOT lv>

On Mon, 6 Jul 1998, Alexey Yakovlev wrote:

> Hi all.
>  The I/O library in libg2c of g77 v0.5.23 was compiled incorrectly.
> It opens an "unformatted" file as text which causes CR->CRLF conversion
> on output. The runtime library of g77 under DJGPP has to be compiled
> with NON_ANSI_RW_MODES undefined. Perhaps, one has to rebuild g77-0.5.23
> for DJGPP or, at least, libg2c.a.
>
Hi!
 There is one more point here. The libc's tmpfile() function opens a 
temporary file in the default O_TEXT mode. The function is called when
a Fortran's scratch file is opened in any mode (FORMATTED or UNFORMATTED, 
SEQUENTIAL or DIRECT) and this leads to the same problem.
The solution could be either to set _fmode variable to O_BINARY in 
f_open() or to compile libg2c with -DNON_ANSI_STDIO flag. I tested them 
both and either works for me. Perhaps the later is better because it 
doesn't involve code changes. 
 My question is how to make configure script to add -DNON_ANSI_STDIO to 
definitions for DJGPP. As to the NON_ANSI_RW_MODES case, it can be handled 
in configure.in in the way as it is done for cygwin.


With best regards.
Alexey Yakovlev

Here I include the patch for gcc-2.81/f/runtime/configure.in to
fix the NON_ANSI_RW_MODES. However it doesn't fix the 'SCRATCH' bug.

--- configure.in	Sat Apr 25 16:22:18 1998
+++ configure_dj.in	Tue Jul  7 12:35:46 1998
@@ -123,6 +123,18 @@
   g77_cv_sys_mingw32=no))
 AC_MSG_RESULT($g77_cv_sys_mingw32)
 
+# ditto for djgpp.
+AC_MSG_CHECKING([for djgpp])
+AC_CACHE_VAL(g77_cv_sys_djgpp,
+  AC_EGREP_CPP(yes,
+  [#ifdef __GO32__
+  yes
+#endif
+],
+  g77_cv_sys_djgpp=yes,
+  g77_cv_sys_djgpp=no))
+AC_MSG_RESULT($g77_cv_sys_djgpp)
+
 
 AC_CHECK_HEADER(fcntl.h,
    test $g77_cv_header_posix = yes && AC_DEFINE(_POSIX_SOURCE),
@@ -222,7 +234,9 @@
   yes
 #endif
 ], is_unix=yes, is_unix=no)
-if test $g77_cv_sys_cygwin32 = yes || test $g77_cv_sys_mingw32 = yes; then
+if test $g77_cv_sys_cygwin32 = yes \
+  || test $g77_cv_sys_djgpp = yes \
+  || test $g77_cv_sys_mingw32 = yes; then
   AC_MSG_RESULT(no)
 else
   if test $is_unix = yes; then

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019