This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Set Config's *extensions and *_ext vars correctly for Win32 static builds
authorSteve Hay <steve.m.hay@googlemail.com>
Mon, 17 Jun 2013 16:54:27 +0000 (17:54 +0100)
committerSteve Hay <steve.m.hay@googlemail.com>
Mon, 17 Jun 2013 16:55:33 +0000 (17:55 +0100)
When building with ALL_STATIC=define on Win32, we arranged for Encode's
sub-extensions to get built (in win32/config_sh.PL), but neglected to list
them in the relevant Config variables, causing test failures in
t/porting/FindExt.t and lib/Config/Extensions.t. Moving the special logic
for Encode into win32/FindExt.pm fixes that.

Fix a related test failure regarding Sys-Syslog (not built on Win32) while
we're at it.

win32/FindExt.pm
win32/config_sh.PL

index f1957f1..c7e52ae 100644 (file)
@@ -13,6 +13,8 @@ sub apply_config {
     my ($config) = @_;
     my @no;
 
+    push @no, 'Sys-Syslog' if $^O eq 'MSWin32';
+
     # duplicates logic from Configure (mostly)
     push @no, "DB_File" unless $config->{i_db};
     push @no, "GDBM_File" unless $config->{i_gdbm};
@@ -46,6 +48,20 @@ sub set_static_extensions {
         $static{$_} = 1;
         $ext{$_} = 'static' if $ext{$_} && $ext{$_} eq 'dynamic';
     }
+
+    # Encode is a special case.  If we are building Encode as a static
+    # extension, we need to explicitly list its subextensions as well.
+    # For other nested extensions, this is handled automatically by
+    # the appropriate Makefile.PL.
+    if ($ext{Encode} && $ext{Encode} eq 'static') {
+       foreach my $file (`dir /s /b ..\\cpan\\Encode\\Makefile.PL`) {
+           if ($file =~ /\b(Encode\\.+)\\Makefile\.PL/) {
+               (my $xxx = $1) =~ s|\\|/|g;
+               $static{$xxx} = 1;
+               $ext{$xxx} = 'static';
+           }
+       }
+    }
 }
 
 sub scan_ext
index eb9471c..d866f76 100644 (file)
@@ -56,19 +56,6 @@ $opt{dynamic_ext}      = join(' ',FindExt::dynamic_ext()) || ' ';
 $opt{extensions}       = join(' ',FindExt::extensions()) || ' ';
 $opt{known_extensions} = join(' ',FindExt::known_extensions()) || ' ';
 
-# Encode is a special case.  If we are building Encode as a static
-# extension, we need to explicitly list its subextensions as well.
-# For other nested extensions, this is handled automatically by
-# the appropriate Makefile.PL.
-if ($opt{static_ext} =~ /\bEncode\b/) {
-    foreach my $file (`dir /s /b ..\\cpan\\Encode\\Makefile.PL`) {
-       if ($file =~ /\b(Encode\\.+)\\Makefile\.PL/) {
-           (my $xxx = $1) =~ s|\\|/|g;
-           $opt{static_ext} .= " $xxx";
-       }
-    }
-}
-
 my $pl_h = '../patchlevel.h';
 
 if (-e $pl_h) {