logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: [Module::Build] ExtUtils::CBuilder: cygwin gcc in mingw mode misparses : msg#00312

Subject: Re: [Module::Build] ExtUtils::CBuilder: cygwin gcc in mingw mode misparses command line
Hi guys,

How come a cygwin issue needs a patch in Windows.pm? Or is this just a general Windows issue with us doing the shell quoting wrong?

 -Ken


On Feb 21, 2006, at 3:27 AM, Randy W. Sims wrote:

Yitzchak Scott-Thoennes wrote:
Cygwin programs when run by non-cygwin programs do not interpret \" as
an escaped " except within "".  This results in errors like the
following when using cygwin gcc in "mingw" mode:
gcc -mno-cygwin -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT - DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing - DPERL_MSVCRT_READFIX -s -O2 -DXS_VERSION=\"0.01\" -DVERSION=\"0.01 \" -I"..\..\..\lib\CORE" -I"C:\MinGW\include" -o "lib\Simple.o" "lib\Simple.c"
gcc: no input files
error building dll file from 'lib\Simple.c' at C:\cygwin\home \sthoenna\bleadperl\wp\lib/ExtUtils/CBuilder/Platform/Windows.pm line 143.
The first backslash in -DXS_VERSION=\"0.01\" is treated as a literal
backslash, and the " after it starts a quoted string, resulting in gcc
getting everything after -O2 as a single argument:
-DXS_VERSION=\0.01" -DVERSION="0.01" -I......libCORE - IC:MinGWinclude -o libSimple.o libSimple.c
The following patch fixes this and in theory should not cause any
problems.

Thanks. I've checked this into CVS.

Randy.


--- lib/ExtUtils/CBuilder/Platform/Windows.pm.orig 2005-10-04 04:32:20.000000000 -0700 +++ lib/ExtUtils/CBuilder/Platform/Windows.pm 2006-01-09 19:55:07.807132800 -0800
@@ -93,7 +93,7 @@
 sub arg_defines {
   my ($self, %args) = @_;
   s/"/\\"/g foreach values %args;
-  return map "-D$_=$args{$_}", keys %args;
+  return map qq{"-D$_=$args{$_}"}, keys %args;
 }



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642


<Prev in Thread] Current Thread [Next in Thread>