How to change CR/LF to LF when compile gcc-4.1.2 in Mingw32 in Windows XP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all:

Whne I compile m4-1.4.X using gcc-4.1.2 in Mingw32 in
Windows XP, it can be compiled, but Can't be used(It
can be  used with gcc-2.95.3).

I asked mingw office team, they told me that this
error is in  CR/LF, gcc-2.95.3  I/O 
defaults to binary, with LF only line endings, but
gcc-4.1.2 default is text, hence CRLF line endings.

How can I change source code in gcc-4.1.X from
"default is text, hence CRLF line endings" to
"defaults to binary, with LF only line endings"

The following is the talking content with mingw team:
===================================================
On Sunday 08 July 2007 16:04, haibin zhang wrote:
> As I know , you must build m4-1.4.9 with gcc-2.95.3,
> It can't work when you build with gcc-3.4.X.

No, this is not the case.  Yes, there is a problem,
but your evaluation
 
is completely wrong.  You keep making these wild
assessments, without 
presenting any form of corroborating evidence; let
*me* make a wild 
guess: your gcc-2.95.3 is the MSYS development
compiler; gcc-3.4.x is a
 
MinGW compiler, which is unsuitable for building MSYS
components.

> I have reported the bug to m4 team , but they said
> they can't help me to resolve this problem.

Nor should they, on the basis of your inadequate
problem assessment.

> why m4-1.4.X can work building with gcc-2.95.3, but
> can't work building with gcc-3.4.X, I guess that the
> error is maybe ?in path resolve

Nope.  You are way off beam here; it has nothing to do
with path 
resolution.  The difference is in binary mode versus
text mode for 
standard stream I/O.

> I guess that m4-1.4.X can resolve path /usr/bin as
> /usr/bin in gcc-2.95.3 , but it many resolve path
> /usr/bin as c:/msys/bin in gcc-3.4.X , so m4-1.4.X
> can't be used .

Again, no.  When you build with the MSYS development
compiler, I/O 
defaults to binary, with LF only line endings; when
you build with a 
MinGW compiler, the default is text, hence CRLF line
endings.  Those 
line ending differences completely explain the failure
of the MinGW 
built m4-1.4.9 to work correctly with autoconf.  If I
patch m4-1.4.9 
sources, to force all standard streams, and all files
opened by m4, to 
binary mode, then recompile with MinGW's 3.4.5
compiler, the resulting 
m4.exe seems to work perfectly well with
autoconf-2.61.  However, the 
resulting m4 build does then fail four of its
testsuite checks; in each
 
case, the reported failure does appear to be related
to CRLF vs. LF 
distinctions, for in each of the four cases, the
expected and actual 
output appear identical to the naked eye; 
===================================================

Regards

Zhang HaiBin


      ___________________________________________________________ 
抢注雅虎免费邮箱3.5G容量,20M附件! 
http://cn.mail.yahoo.com

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux