Subject: | cl on Windows |
Fails with message:
failed to generate import library
Please find patch in this report. Tested only on Windows.
Subject: | Devel-CallParser-0.002.patch |
diff -Naur Devel-CallParser-0.002.orig/Build.PL Devel-CallParser-0.002.new/Build.PL
--- Devel-CallParser-0.002.orig/Build.PL 2013-09-21 21:21:33.000000000 +0200
+++ Devel-CallParser-0.002.new/Build.PL 2015-04-08 14:31:37.079740800 +0200
@@ -5,6 +5,9 @@
use Module::Build;
Module::Build->subclass(code => q{
+ use File::Spec;
+ use File::Basename;
+ use File::Copy qw/cp/;
unless(__PACKAGE__->can("cbuilder")) {
*cbuilder = sub { $_[0]->_cbuilder or die "no C support" };
}
@@ -78,12 +81,14 @@
@_ = ($self, %args);
goto &$orig_cb_link;
};
- my($libfile, $impfile);
+ my($libfile, $impfile, $objfile);
if($^O eq "MSWin32") {
my $dlext = $cb->{config}->{dlext};
my $libext = $cb->{config}->{lib_ext};
+ my $objext = $cb->{config}->{obj_ext};
$libfile = $spec->{lib_file};
- ($impfile = $libfile) =~ s/\.\Q$dlext\E\z/$libext/
+ $objfile = $spec->{obj_file};
+ ($impfile = $objfile) =~ s/\Q$objext\E\z/$libext/
or die "can't generate import library name";
unlink $libfile, $impfile
unless $self->up_to_date($libfile, $impfile);
@@ -109,9 +114,14 @@
} if $cb->isa("ExtUtils::CBuilder::Platform::Windows::GCC");
$self->SUPER::link_c($spec);
if($^O eq "MSWin32") {
- die "failed to generate import library"
+ die "failed to generate import library $impfile"
unless -e $impfile;
- $self->add_to_cleanup($impfile);
+ my $impfinalfile = File::Spec->catfile(dirname($libfile), basename($impfile));
+ if (! -e $impfinalfile) {
+ print STDERR "copy $impfile $impfinalfile\n";
+ cp($impfile, $impfinalfile);
+ $self->add_to_cleanup($impfile);
+ }
}
}
})->new(
@@ -129,6 +139,8 @@
"ExtUtils::CBuilder" => "0.15",
"ExtUtils::ParseXS" => 0,
"File::Spec" => 0,
+ "File::Basename" => 0,
+ "File::Copy" => 0,
"IO::File" => "1.03",
"Module::Build" => 0,
"Test::More" => 0,