Subject: | Module::Build fails to link version::vxs on Strawberry Perl (win32) |
The problem is that version defines module_name to 'version' in
Build.PL, however it also compiles xs from lib/version/vxs.xs. During
compilation stage _infer_xs_spec correctly defines module_name
to 'version::vxs', however in sub link_c we are suddenly using $self-
Show quoted text
>module_name (which is always defined), along with a useless
$module_name ||= $spec->{module_name}; Now during link time we have
module_name 'version' and when we generate .def file (and .exp from
that) we are trying to export boot_version, which does not exist
(generated vxs.c contains boot_version__vxs).
The fix seems to be simple: just flip these over and use $spec->
{module_name} and fall back to $self->module_name (which is kind of
useless, since $spec->{module_name} should always be defined, but just
in case). The patch is attached, however I'm not sure if this could
potentially break anything else. Theoretically, we should compile and
link with the same module_name, so my patch should be correct. Any
ideas?
Subject: | Module-Build-0.2808-link_c.patch |
diff -druN Module-Build-0.2808.orig/lib/Module/Build/Base.pm Module-Build-0.2808/lib/Module/Build/Base.pm
--- Module-Build-0.2808.orig/lib/Module/Build/Base.pm 2007-04-28 21:50:55 +0400
+++ Module-Build-0.2808/lib/Module/Build/Base.pm 2008-07-31 13:34:33 +0400
@@ -3915,8 +3915,8 @@
if $self->up_to_date([$spec->{obj_file}, @$objects],
$spec->{lib_file});
- my $module_name = $self->module_name;
- $module_name ||= $spec->{module_name};
+ my $module_name = $spec->{module_name};
+ $module_name ||= $self->module_name;
my $b = $self->_cbuilder
or die "Module::Build is not configured with C_support";