In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/13cedc2a3e4c518d94e81e9837febef77948e0e5?hp=903f2d7006dbd87b9347acb742b9d7848f566aed>

- Log -----------------------------------------------------------------
commit 13cedc2a3e4c518d94e81e9837febef77948e0e5
Author: Steve Hay <[email protected]>
Date:   Sat Jun 8 02:16:17 2013 +0100

    Include the Encode extension in the ALL_STATIC build on Win32 for VC++
    
    Thanks to Jan Dubois and Nicholas Clark for pointing out that Encode has
    subextensions which need statically linking too, and that Configure has
    a special case for handling this which we can mimic in config_sh.PL.
    
    Unfortunately, however, while this works for VC++, with MinGW it gives
    undefined reference errors to three symbols from Encode/CN.o
    (_cp936_encoding, _euc_cn_encoding and MacChineseSimp_encoding) and two
    from Encode/JP.o (_cp932_encoding and _euc_jp_encoding), so we must retain
    the exclusion on Encode for MinGW for now, much like the Compress/Raw/Bzip2
    problem found before. Hopefully these are all fixable soon.
-----------------------------------------------------------------------

Summary of changes:
 win32/Makefile     |    3 +--
 win32/config_sh.PL |   13 +++++++++++++
 win32/makefile.mk  |    8 ++++----
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/win32/Makefile b/win32/Makefile
index 545dc92..cb3f7df 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -772,8 +772,7 @@ SETARGV_OBJ = setargv$(o)
 !IF "$(ALL_STATIC)" == "define"
 # some exclusions, unfortunately, until fixed:
 #  - MakeMaker isn't capable enough for SDBM_File (small bug)
-#  - Encode (encoding search algorithm relies on shared library?)
-STATIC_EXT     = * !SDBM_File !Encode
+STATIC_EXT     = * !SDBM_File
 !ELSE
 # specify static extensions here, for example:
 # (be sure to include Win32CORE to load Win32 on demand)
diff --git a/win32/config_sh.PL b/win32/config_sh.PL
index d866f76..eb9471c 100644
--- a/win32/config_sh.PL
+++ b/win32/config_sh.PL
@@ -56,6 +56,19 @@ $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) {
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 0e383cd..57373c2 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -875,11 +875,11 @@ SETARGV_OBJ       = setargv$(o)
 .IF "$(ALL_STATIC)" == "define"
 # some exclusions, unfortunately, until fixed:
 #  - MakeMaker isn't capable enough for SDBM_File (small bug)
-#  - Encode (encoding search algorithm relies on shared library?)
-#  - GCC's linker gets undefined reference to _BZ2_compressBlock
-STATIC_EXT     = * !SDBM_File !Encode
+#  - GCC's linker gets undefined references to _BZ2_compressBlock and
+#    _cp936_encoding, _cp932_encoding and others in Encode/CN.o and Encode/JP.o
+STATIC_EXT     = * !SDBM_File
 .IF "$(CCTYPE)" == "GCC"
-STATIC_EXT     += !Compress/Raw/Bzip2
+STATIC_EXT     += !Compress/Raw/Bzip2 !Encode
 .ENDIF
 .ELSE
 # specify static extensions here, for example:

--
Perl5 Master Repository

Reply via email to