Re: [Module::Build] ExtUtils::CBuilder: cygwin gcc in mingw mode misparses command line
Status: Beta
Brought to you by:
kwilliams
|
From: Randy W. S. <ml...@th...> - 2006-02-21 09:27:35
|
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;
> }
|