Subject: | 61454 breaks Devel::CheckLib on ActivePerl |
Hi,
The patch at https://rt.cpan.org/Ticket/Display.html?id=61454 (which
has been incorporated into Devel-CheckLib-0.91) renders that module
unloadable on ActivePerl when using the MinGW compiler.
As a demo, this script, when run on ActivePerl 5.10:
==============================
use warnings;
use strict;
use Config qw(%Config);
use Text::ParseWords 'quotewords';
my @flags = grep { length } map
{ quotewords('\s+', 0, $_ || ()) }
@Config{qw(ccflags ldflags)};
print "@flags\n";
==============================
produces this output (and similar for ActivePerl 5.12):
==============================
%Config::Config is read-only
BEGIN failed--compilation aborted at
C:/_32/ap1005/lib/ActiveState/Path.pm line
12.
Compilation failed in require at C:/_32/ap1005/lib/ActivePerl/Config.pm
line 46.
==============================
Also, even on my own MinGW-built perls (where Devel-CheckLib-0.91
builds and passes all tests) @flags contains:
==============================
-s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -
DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -
DPERL_MSVCRT_READFIX -s -Lc:perl512_MlibCORE -
LC:homerobmingw_vistai686-pc-mingw32lib
==============================
(Note that the path separators are missing.)
I haven't gone digging to see what's really needed here - on the
surface, it looks as though we could just do:
@flags = ($Config{ccflags}, $Config{ldflags});
I tried that out and it seemed to work ok (in so far as it didn't cause
any tests to fail).
However, I then noticed that t/multi-word-compiler.t also violates the
"%Config::Config is read-only" condition on ActivePerl.
In that file the violation is caused by:
$Config{cc} = "$^X $Config{cc}";
Cheers,
Rob