Upgrade to ExtUtils::CBuilder 0.19
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 14 Jun 2007 13:12:56 +0000 (13:12 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 14 Jun 2007 13:12:56 +0000 (13:12 +0000)
p4raw-id: //depot/perl@31381

lib/ExtUtils/CBuilder.pm
lib/ExtUtils/CBuilder/Base.pm
lib/ExtUtils/CBuilder/Changes
lib/ExtUtils/CBuilder/Platform/Windows.pm
lib/ExtUtils/CBuilder/Platform/os2.pm

index 730721f..3ca5034 100644 (file)
@@ -5,7 +5,7 @@ use File::Path ();
 use File::Basename ();
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.18';
+$VERSION = '0.19';
 $VERSION = eval $VERSION;
 
 # Okay, this is the brute-force method of finding out what kind of
index 72fd74c..bd60506 100644 (file)
@@ -7,7 +7,7 @@ use Config;
 use Text::ParseWords;
 
 use vars qw($VERSION);
-$VERSION = '0.12_01';
+$VERSION = '0.12';
 
 sub new {
   my $class = shift;
@@ -167,9 +167,9 @@ sub prelink {
     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'),
   );
   
index 32b57ca..c38a5dd 100644 (file)
@@ -1,5 +1,31 @@
 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
index 036d056..d9f29d3 100644 (file)
@@ -9,7 +9,7 @@ use File::Spec;
 use ExtUtils::CBuilder::Base;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.12_01';
+$VERSION = '0.13';
 @ISA = qw(ExtUtils::CBuilder::Base);
 
 sub new {
index 16001c2..0683819 100644 (file)
@@ -12,26 +12,60 @@ sub need_prelink { 1 }
 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 {