In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/557ab4cb986767c7868d1b0471b669e794d9b569?hp=075b00aa67c055a31de94e78b6ff2cc31607e3e1>

- Log -----------------------------------------------------------------
commit 557ab4cb986767c7868d1b0471b669e794d9b569
Author: Tony Cook <t...@develop-help.com>
Date:   Thu Jan 6 21:52:24 2011 +1100

    ignore extensions based on the configuration

M       t/porting/FindExt.t
M       win32/FindExt.pm

commit d6fb8979903e0b021272dee1efd5383d286d1ba0
Author: Tony Cook <t...@develop-help.com>
Date:   Thu Jan 6 21:51:30 2011 +1100

    actually handle the case of extensions being built statically

M       t/porting/FindExt.t
-----------------------------------------------------------------------

Summary of changes:
 t/porting/FindExt.t |    8 +++++++-
 win32/FindExt.pm    |   19 +++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/t/porting/FindExt.t b/t/porting/FindExt.t
index 923211d..0100cb1 100644
--- a/t/porting/FindExt.t
+++ b/t/porting/FindExt.t
@@ -9,6 +9,7 @@ BEGIN {
     require './test.pl';
 }
 use strict;
+use Config;
 
 # Test that Win32/FindExt.pm is consistent with Configure in determining the
 # types of extensions.
@@ -20,14 +21,19 @@ if ($^O eq "MSWin32" && !defined $ENV{PERL_STATIC_EXT}) {
     skip_all "PERL_STATIC_EXT must be set to the list of static extensions";
 }
 
+unless (defined $Config{usedl}) {
+    skip_all "FindExt just plain broken for static perl.";
+}
+
 plan tests => 10;
 use FindExt;
-use Config;
 
+FindExt::apply_config(\%Config);
 FindExt::scan_ext('../cpan');
 FindExt::scan_ext('../dist');
 FindExt::scan_ext('../ext');
 FindExt::set_static_extensions(split ' ', $ENV{PERL_STATIC_EXT}) if $^O eq 
"MSWin32";
+FindExt::set_static_extensions(split ' ', $Config{static_ext}) unless $^O eq 
"MSWin32";
 
 # Config.pm and FindExt.pm make different choices about what should be built
 my @config_built;
diff --git a/win32/FindExt.pm b/win32/FindExt.pm
index fe1febd..25fa8ce 100644
--- a/win32/FindExt.pm
+++ b/win32/FindExt.pm
@@ -9,6 +9,25 @@ my $no = join('|',qw(GDBM_File ODBM_File NDBM_File DB_File
                      VMS VMS-DCLsym VMS-Stdio Sys-Syslog IPC-SysV 
I18N-Langinfo));
 $no = qr/^(?:$no)$/i;
 
+sub apply_config {
+    my ($config) = @_;
+    my @no;
+
+    # duplicates logic from Configure (mostly)
+    push @no, "DB_File" unless $config->{i_db};
+    push @no, "GDBM_File" unless $config->{i_gdbm};
+    push @no, "I18N-Langinfo" unless $config->{i_langinfo} && 
$config->{i_nl_langinfo};
+    push @no, "IPC-SysV" unless $config->{d_msg} || $config->{d_sem} || 
$config->{d_shm};
+    push @no, "NDBM_File" unless $config->{d_ndbm};
+    push @no, "ODBM_File"
+      unless ($config->{i_dbm} || $config->{i_rpcsvcdbm}) && 
!$config->{d_cplusplus};
+    push @no, "VMS.*" unless $^O eq "VMS";
+    push @no, "Win32.*" unless $^O eq "MSWin32" || $^O eq "cygwin";
+
+    $no = join('|', @no);
+    $no = qr/^(?:$no)$/i;
+}
+
 my %ext;
 my %static;
 

--
Perl5 Master Repository

Reply via email to