Author: kwilliams
Date: Mon Mar 26 19:12:35 2007
New Revision: 9337
Modified:
ExtUtils-CBuilder/trunk/Changes
ExtUtils-CBuilder/trunk/lib/ExtUtils/CBuilder/Platform/Windows.pm
Log:
embed manifest files in DLLs
Modified: ExtUtils-CBuilder/trunk/Changes
==============================================================================
--- ExtUtils-CBuilder/trunk/Changes (original)
+++ ExtUtils-CBuilder/trunk/Changes Mon Mar 26 19:12:35 2007
@@ -2,13 +2,16 @@
0.19
+ - On Windows: embed manifest files in DLLs built with Module-Build
+ when using VC8. [Steve Hay]
+
- Added a workaround for a config error on dec_osf: the linker is
$Config{cc}, not $Config{ld}. [Jarkko Hietaniemi]
- Borland's compiler "response files" will not pass through macro
definitions that contain quotes. The quotes get stripped and there
seems to be no way to escape them. So we leave macros on the
- command line.
+ command line. [Randy W. Sims]
0.18 Sat Mar 25 13:35:47 CST 2006
Modified: ExtUtils-CBuilder/trunk/lib/ExtUtils/CBuilder/Platform/Windows.pm
==============================================================================
--- ExtUtils-CBuilder/trunk/lib/ExtUtils/CBuilder/Platform/Windows.pm
(original)
+++ ExtUtils-CBuilder/trunk/lib/ExtUtils/CBuilder/Platform/Windows.pm Mon Mar
26 19:12:35 2007
@@ -9,7 +9,7 @@
use ExtUtils::CBuilder::Base;
use vars qw($VERSION @ISA);
-$VERSION = '0.12';
+$VERSION = '0.12_01';
@ISA = qw(ExtUtils::CBuilder::Base);
sub new {
@@ -192,6 +192,8 @@
$spec{output} ||= File::Spec->catfile( $spec{builddir},
$spec{basename} .
'.'.$cf->{dlext} );
+ $spec{manifest} ||= File::Spec->catfile( $spec{builddir},
+ $spec{basename} .
'.'.$cf->{dlext}.'.manifest');
$spec{implib} ||= File::Spec->catfile( $spec{builddir},
$spec{basename} . $cf->{lib_ext}
);
$spec{explib} ||= File::Spec->catfile( $spec{builddir},
@@ -203,10 +205,10 @@
$self->add_to_cleanup(
grep defined,
- @{[ @spec{qw(implib explib def_file base_file map_file)} ]}
+ @{[ @spec{qw(manifest implib explib def_file base_file map_file)} ]}
);
- foreach my $opt ( qw(output implib explib def_file map_file base_file) ) {
+ foreach my $opt ( qw(output manifest implib explib def_file map_file
base_file) ) {
$self->normalize_filespecs( \$spec{$opt} );
}
@@ -227,7 +229,7 @@
$spec{output} =~ tr/'"//d;
return wantarray
- ? grep defined, @spec{qw[output implib explib def_file map_file base_file]}
+ ? grep defined, @spec{qw[output manifest implib explib def_file map_file
base_file]}
: $spec{output};
}
@@ -338,20 +340,26 @@
sub format_linker_cmd {
my ($self, %spec) = @_;
+ my $cf = $self->{config};
foreach my $path ( @{$spec{libpath}} ) {
$path = "-libpath:$path";
}
- $spec{def_file} &&= '-def:' . $spec{def_file};
- $spec{output} &&= '-out:' . $spec{output};
- $spec{implib} &&= '-implib:' . $spec{implib};
- $spec{map_file} &&= '-map:' . $spec{map_file};
+ my $output = $spec{output};
+
+ $spec{def_file} &&= '-def:' . $spec{def_file};
+ $spec{output} &&= '-out:' . $spec{output};
+ $spec{manifest} &&= '-manifest ' . $spec{manifest};
+ $spec{implib} &&= '-implib:' . $spec{implib};
+ $spec{map_file} &&= '-map:' . $spec{map_file};
%spec = $self->write_linker_script(%spec)
if $spec{use_scripts};
- return [ grep {defined && length} (
+ my @cmds; # Stores the series of commands needed to build the module.
+
+ push @cmds, [ grep {defined && length} (
$spec{ld} ,
@{$spec{lddlflags}} ,
@{$spec{libpath}} ,
@@ -365,6 +373,15 @@
$spec{implib} ,
$spec{output} ,
) ];
+
+ if ($cf->{cc} eq 'cl' and $cf->{ccversion} =~ /^(\d+)/ and $1 >= 14) {
+ # Embed the manifest file for VC 2005 (aka VC 8) or higher
+ push @cmds, [
+ 'mt', '-nologo', $spec{manifest}, '-outputresource:' . "$output;2"
+ ];
+ }
+
+ return @cmds;
}
sub write_linker_script {