This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Eliminate warnings from XSLoader on 5.005 and 5.004.
authorNicholas Clark <nick@ccl4.org>
Sat, 10 Sep 2011 15:10:55 +0000 (17:10 +0200)
committerNicholas Clark <nick@ccl4.org>
Sun, 11 Sep 2011 17:30:21 +0000 (19:30 +0200)
Don't pass parameters that old ExtUtil::MakeMaker doesn't understand.
Ensure that $DynaLoader::dl_debug exists prior to calling into DynaLoader's
XS code.

dist/XSLoader/Makefile.PL
dist/XSLoader/XSLoader_pm.PL
pod/perldelta.pod

index bb92d84..111d85a 100644 (file)
@@ -34,10 +34,12 @@ my $installdirs = $] < 5.011 ? "perl" : "site";
 
 WriteMakefile(
     NAME            => $PACKAGE,
-    LICENSE         => 'perl',
-    AUTHOR          => 'Sebastien Aperghis-Tramoni <sebastien@aperghis.net>',
+    ($ExtUtils::MakeMaker::VERSION > 6.30 ?
+     (LICENSE       => 'perl',
+      AUTHOR        => 'Sebastien Aperghis-Tramoni <sebastien@aperghis.net>',
+      ABSTRACT_FROM => 'XSLoader_pm.PL',
+     ) : ()),
     VERSION_FROM    => 'XSLoader_pm.PL',
-    ABSTRACT_FROM   => 'XSLoader_pm.PL',
     INSTALLDIRS     => $installdirs,
     PL_FILES        => { 'XSLoader_pm.PL'  => 'XSLoader.pm' },
     PM              => { 'XSLoader.pm' => '$(INST_ARCHLIB)/XSLoader.pm' },
index 64ebcc2..98a19ea 100644 (file)
@@ -8,15 +8,35 @@ print OUT <<'EOT';
 
 package XSLoader;
 
-$VERSION = "0.15";
+$VERSION = "0.16";
 
 #use strict;
 
+package DynaLoader;
+
+EOT
+
+# dlutils.c before 5.006 has this:
+#
+#    #ifdef DEBUGGING
+#        dl_debug = SvIV( perl_get_sv("DynaLoader::dl_debug", 0x04) );
+#    #endif
+#
+# where 0x04 is GV_ADDWARN, which causes a warning to be issued by the call
+# into XS below, if DynaLoader.pm hasn't been loaded.
+# It was changed to 0 in the commit(s) that added XSLoader to the core
+# (9cf41c4d23a47c8b and its parent 9426adcd48655815)
+# Hence to backport XSLoader to work silently with earlier DynaLoaders we need
+# to ensure that the variable exists:
+
+print OUT <<'EOT' if $] < 5.006;
+
 # enable debug/trace messages from DynaLoader perl code
-$dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug;
+$dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug;
 
-package DynaLoader;
+EOT
 
+print OUT <<'EOT';
 # No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
 # NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB
 boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
index 301d63d..97f1a22 100644 (file)
@@ -241,6 +241,10 @@ implementation detail was buggy, and may fail as a result of this change.
 The module's Perl code has been considerably simplified, roughly halving
 the number of lines, with no change in functionality.
 
+=item *
+
+L<XSLoader> has been upgraded from version 0.15 to version 0.16.
+
 =back
 
 =head2 Removed Modules and Pragmata