use Text::ParseWords;
use vars qw($VERSION);
-$VERSION = '0.12_01';
+$VERSION = '0.12';
sub new {
my $class = shift;
DL_FUNCS => $args{dl_funcs} || {},
FUNCLIST => $args{dl_func_list} || [],
IMPORTS => $args{dl_imports} || {},
- NAME => $args{dl_name},
- DLBASE => $args{dl_base},
- FILE => $args{dl_file},
+ NAME => $args{dl_name}, # Name of the Perl module
+ DLBASE => $args{dl_base}, # Basename of DLL file
+ FILE => $args{dl_file}, # Dir + Basename of symlist file
VERSION => (defined $args{dl_version} ? $args{dl_version} : '0.0'),
);
Revision history for Perl extension ExtUtils::CBuilder.
+ - When building as part of the perl core (so this is irrelevant for
+ people downloading from CPAN) we now try a little harder to find
+ the perl sources. [Jos Boumans]
+
+ - Fixed a part of the manifest thingy that got broken on 64-bit
+ Windows platforms in version 0.18. [Steve Hay, Jan Dubois]
+
+0.18 - Mon Mar 26 21:29:09 2007
+
+ - Various OS/2 fixes:
+ + Put .LIB file near .DEF file
+ + Got library-file building working better
+ + Handled libperl_overrides better
+ [Ilya Zakharevich]
+
+ - 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. [Randy W. Sims]
+
0.18 Sat Mar 25 13:35:47 CST 2006
- Yet more fixes for arg_defines() on VMS. [Craig A. Berry and John
sub prelink {
# Generate import libraries (XXXX currently near .DEF; should be near DLL!)
my $self = shift;
- my @res = $self->SUPER::prelink(@_);
+ my %args = @_;
+
+ my @res = $self->SUPER::prelink(%args);
die "Unexpected number of DEF files" unless @res == 1;
die "Can't find DEF file in the output"
- unless $res[0] =~ m,^(.*?)([^\\/]+)\.def$,si;
- my $libname = "$2$self->{config}{lib_ext}";
+ unless $res[0] =~ m,^(.*)\.def$,si;
+ my $libname = "$1$self->{config}{lib_ext}"; # Put .LIB file near .DEF file
$self->do_system('emximp', '-o', $libname, $res[0]) or die "emxexp: res=$?";
return (@res, $libname);
}
sub _do_link {
+ my $self = shift;
+ my ($how, %args) = @_;
+ if ($how eq 'lib_file'
+ and (defined $args{module_name} and length $args{module_name})) {
+
+ # DynaLoader::mod2fname() is a builtin func
+ my $lib = DynaLoader::mod2fname([split /::/, $args{module_name}]);
+
+ # Now know the basename, find directory parts via lib_file, or objects
+ my $objs = ( (ref $args{objects}) ? $args{objects} : [$args{objects}] );
+ my $near_obj = $self->lib_file(@$objs);
+ my $ref_file = ( defined $args{lib_file} ? $args{lib_file} : $near_obj );
+ my $lib_dir = ($ref_file =~ m,(.*)[/\\],s ? "$1/" : '' );
+ my $exp_dir = ($near_obj =~ m,(.*)[/\\],s ? "$1/" : '' );
+
+ $args{dl_file} = $1 if $near_obj =~ m,(.*)\.,s; # put ExportList near OBJ
+ $args{lib_file} = "$lib_dir$lib.$self->{config}{dlext}"; # DLL file
+
+ # XXX _do_link does not have place to put libraries?
+ push @$objs, $self->perl_inc() . "/libperl$self->{config}{lib_ext}";
+ $args{objects} = $objs;
+ }
# Some 'env' do exec(), thus return too early when run from ksh;
# To avoid 'env', remove (useless) shrpenv
- my $self = shift;
local $self->{config}{shrpenv} = '';
- return $self->SUPER::_do_link(@_);
+ return $self->SUPER::_do_link($how, %args);
}
-sub extra_link_args_after_prelink { # Add .DEF file to the link line
+sub extra_link_args_after_prelink {
+ # Add .DEF file to the link line
my ($self, %args) = @_;
- grep /\.def$/i, @{$args{prelink_res}};
+
+ my @DEF = grep /\.def$/i, @{$args{prelink_res}};
+ die "More than one .def files created by `prelink' stage" if @DEF > 1;
+ # XXXX No "$how" argument here, so how to test for dynamic link?
+ die "No .def file created by `prelink' stage"
+ unless @DEF or not @{$args{prelink_res}};
+
+ my @after_libs = ($OS2::is_aout ? ()
+ : $self->perl_inc() . "/libperl_override$self->{config}{lib_ext}");
+ # , "-L", "-lperl"
+ (@after_libs, @DEF);
}
sub link_executable {