Change 30115 by [EMAIL PROTECTED] on 2007/02/04 18:49:54

        Integrate:
        [ 24041]
        Don't use vars in DynaLoader
        Remove left-over maintenance code
        
        [ 24271]
        Subject: [PATCH] Symbian port of Perl
        From: <[EMAIL PROTECTED]>
        Date: Mon, 18 Apr 2005 13:18:30 +0300
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 27522]
        Avoid hardcoded $(OBJ_EXT)
        
        [ 27549]
        Move DynaLoader.o into libperl.so.
        
        This avoids the need to statically link DynaLoader into the stub perl
        executable and make libperl.so provide all the code needed to get a
        functional embedded perl interpreter up running.  As a side effect
        this also moves DynaLoader into libperl.a for non-useshrplib builds.
        
        Fixes [perl #32539]
        
        [ 27566]
        Adjust docs to reflect that DynaLoader, as of change 27549,
        is part of libperl.
        
        [ 28226]
        Subject: [PATCH] Test script for DynaLoader
        From: Sébastien Aperghis-Tramoni <[EMAIL PROTECTED]>
        Date: Thu, 18 May 2006 16:46:00 +0200
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 28227]
        Nits in the DynaLoader test: make it warning-clean,
        and avoid checking OS- and locale-specific messages
        
        [ 28228]
        We can now remove DynaLoader from 1_compile.t
        
        [ 28274]
        Better handling for error-checking
        From: IRC/#p5p/Maddingue (Sebastien Aperghis-Tramoni)
        
        [ 28308]
        Subject: Re: [PATCH] Test script for DynaLoader
        From: demerphq <[EMAIL PROTECTED]>
        Date: Thu, 25 May 2006 13:20:53 +0200
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 28318]
        use the same arg names everyone else does and handle undef filename
        
        [ 28321]
        Subject: [PATCH] DynaLoader.t: less assumptions
        From: Jarkko Hietaniemi <[EMAIL PROTECTED]>
        Message-ID: <[EMAIL PROTECTED]>
        Date: Sun, 28 May 2006 12:18:42 +0300
        
        [ 28333]
        And some more DynaLoader things that should not be tested on
        VMS since they are not part of the implementation.
        
        [ 28840]
        darwin also seems to be lacking a dl_unload_file() in its
        DynaLoader, so some additional skips are needed.  If I only
        had a NeXT to test with now...
        
        [ 29017]
        Upgrade to XSLoader-0.07.
        
        [ 29188]
        Subject: [patch at 21983] factor out $^O eq 'darwin' from XSLoader.pm
        From: "Konovalov, Vadim Vladimirovich (Vadim)** CTR **" <[EMAIL 
PROTECTED]>
        Date: Thu, 2 Nov 2006 12:36:49 +0100 
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 29198]
        Wrap the $VERSION initialization of DynaLoader in a BEGIN block
        
        Subject: [perl #40651] (Obscure) Bug in Dynaloader 
        From: [EMAIL PROTECTED] (via RT) <[EMAIL PROTECTED]>
        Date: Thu, 02 Nov 2006 09:30:34 -0800
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 29200]
        The assignment to $VERSION must be on its own line, for
        ExtUtils::MM_Unix::parse_version to be happy.
        
        [ 29253]
        The DynaLoader test isn't happy with OpenBSD's libc.so.39.3.
        
        [ 29580]
        Subject: [PATCH 5.8.8] OS/2-specific fixes, round II
        From: Ilya Zakharevich <[EMAIL PROTECTED]>
        Date: Mon, 18 Dec 2006 00:45:24 -0800
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 29707]
        Subject: DynaLoader test failure on cygwin
        From: "Yitzchak Scott-Thoennes" <[EMAIL PROTECTED]>
        Date: Sun, 7 Jan 2007 11:56:21 -0800 (PST)
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 29857]
        Fix a typo in Dynaloader_pm.PL.

Affected files ...

... //depot/maint-5.8/perl/MANIFEST#303 integrate
... //depot/maint-5.8/perl/Makefile.SH#64 integrate
... //depot/maint-5.8/perl/ext/DynaLoader/DynaLoader_pm.PL#13 integrate
... //depot/maint-5.8/perl/ext/DynaLoader/Makefile.PL#3 integrate
... //depot/maint-5.8/perl/ext/DynaLoader/XSLoader_pm.PL#7 integrate
... //depot/maint-5.8/perl/ext/DynaLoader/dl_vms.xs#4 integrate
... //depot/maint-5.8/perl/ext/DynaLoader/dlutils.c#4 integrate
... //depot/maint-5.8/perl/ext/DynaLoader/t/DynaLoader.t#1 branch
... //depot/maint-5.8/perl/ext/DynaLoader/t/XSLoader.t#5 integrate
... //depot/maint-5.8/perl/ext/util/make_ext#2 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/Embed.pm#3 integrate
... //depot/maint-5.8/perl/t/lib/1_compile.t#5 integrate
... //depot/maint-5.8/perl/writemain.SH#5 integrate

Differences ...

==== //depot/maint-5.8/perl/MANIFEST#303 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#302~30102~    2007-02-02 14:11:03.000000000 -0800
+++ perl/MANIFEST       2007-02-04 10:49:54.000000000 -0800
@@ -376,6 +376,7 @@
 ext/DynaLoader/hints/openbsd.pl        Hint for DynaLoader for named 
architecture
 ext/DynaLoader/Makefile.PL     Dynamic Loader makefile writer
 ext/DynaLoader/README          Dynamic Loader notes and intro
+ext/DynaLoader/t/DynaLoader.t  See if DynaLoader works
 ext/DynaLoader/t/XSLoader.t    See if XSLoader works
 ext/DynaLoader/XSLoader_pm.PL  Simple XS Loader perl module
 ext/Encode/AUTHORS             List of authors

==== //depot/maint-5.8/perl/Makefile.SH#64 (text) ====
Index: perl/Makefile.SH
--- perl/Makefile.SH#63~30060~  2007-01-29 09:14:16.000000000 -0800
+++ perl/Makefile.SH    2007-02-04 10:49:54.000000000 -0800
@@ -263,7 +263,7 @@
 static_ext = $static_list
 nonxs_ext = $nonxs_list
 ext = \$(dynamic_ext) \$(static_ext) \$(nonxs_ext)
-DYNALOADER = lib/auto/DynaLoader/DynaLoader\$(LIB_EXT)
+DYNALOADER = DynaLoader\$(OBJ_EXT)
 
 libs = $perllibs $cryptlib
 
@@ -598,12 +598,12 @@
 !GROK!THIS!
 else
        $spitshell >>Makefile <<'!NO!SUBS!'
-$(LIBPERL): $& $(obj) $(LIBPERLEXPORT)
+$(LIBPERL): $& $(obj) $(DYNALOADER) $(LIBPERLEXPORT)
 !NO!SUBS!
        case "$useshrplib" in
        true)
                $spitshell >>Makefile <<'!NO!SUBS!'
-       $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(libs)
+       $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs)
 !NO!SUBS!
                case "$osname" in
                aix)
@@ -618,7 +618,7 @@
        *)
                $spitshell >>Makefile <<'!NO!SUBS!'
        rm -f $(LIBPERL)
-       $(AR) rcu $(LIBPERL) $(obj)
+       $(AR) rcu $(LIBPERL) $(obj) $(DYNALOADER)
        @$(ranlib) $(LIBPERL)
 !NO!SUBS!
                ;;
@@ -669,19 +669,21 @@
                    ;;
                esac
                $spitshell >>Makefile <<'!NO!SUBS!'
-miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
+miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(obj) opmini$(OBJ_EXT)
        [EMAIL PROTECTED] -f miniperl.xok
        $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o miniperl \
-           miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs)
+           `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
+           miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(libs)
        $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
 !NO!SUBS!
                ;;
        *)
                $spitshell >>Makefile <<'!NO!SUBS!'
-miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
+miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(obj) opmini$(OBJ_EXT)
        [EMAIL PROTECTED] -f miniperl.xok
        $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl \
-           miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs)
+           `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
+           miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(libs)
        $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
 !NO!SUBS!
                ;;
@@ -689,20 +691,20 @@
 
        $spitshell >>Makefile <<'!NO!SUBS!'
 
-perl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) 
ext.libs $(PERLEXPORT)
+perl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs 
$(PERLEXPORT)
        [EMAIL PROTECTED] -f miniperl.xok
-       $(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX) 
$(PERL_PROFILE_LDFLAGS) $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) 
$(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
+       $(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX) 
$(PERL_PROFILE_LDFLAGS) $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) 
$(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
 
 # Purify/Quantify Perls.
 
-pureperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) 
$(static_ext) ext.libs $(PERLEXPORT)
-       $(SHRPENV) $(LDLIBPTH) purify $(CC) -o pureperl $(CLDFLAGS) 
$(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat 
ext.libs` $(libs)
+pureperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs 
$(PERLEXPORT)
+       $(SHRPENV) $(LDLIBPTH) purify $(CC) -o pureperl $(CLDFLAGS) 
$(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
 
-purecovperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) 
$(static_ext) ext.libs $(PERLEXPORT)
-       $(SHRPENV) $(LDLIBPTH) purecov $(CC) -o purecovperl $(CLDFLAGS) 
$(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat 
ext.libs` $(libs)
+purecovperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs 
$(PERLEXPORT)
+       $(SHRPENV) $(LDLIBPTH) purecov $(CC) -o purecovperl $(CLDFLAGS) 
$(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
 
-quantperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) 
$(static_ext) ext.libs $(PERLEXPORT)
-       $(SHRPENV) $(LDLIBPTH) quantify $(CC) -o quantperl $(CLDFLAGS) 
$(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat 
ext.libs` $(libs)
+quantperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs 
$(PERLEXPORT)
+       $(SHRPENV) $(LDLIBPTH) quantify $(CC) -o quantperl $(CLDFLAGS) 
$(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
 
 # Valgrind perl (currently Linux only)
 
@@ -799,8 +801,8 @@
 # checks as well as the special code to validate that the script in question
 # has been invoked correctly.
 
-suidperl$(EXE_EXT): $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) 
$(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
-       $(SHRPENV) $(LDLIBPTH) $(CC) -o suidperl $(CLDFLAGS) $(CCDLFLAGS) 
perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat 
ext.libs` $(libs)
+suidperl$(EXE_EXT): $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) 
$(static_ext) ext.libs $(PERLEXPORT)
+       $(SHRPENV) $(LDLIBPTH) $(CC) -o suidperl $(CLDFLAGS) $(CCDLFLAGS) 
perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` 
$(libs)
 
 !NO!SUBS!
 

==== //depot/maint-5.8/perl/ext/DynaLoader/DynaLoader_pm.PL#13 (text) ====
Index: perl/ext/DynaLoader/DynaLoader_pm.PL
--- perl/ext/DynaLoader/DynaLoader_pm.PL#12~30113~      2007-02-04 
04:08:57.000000000 -0800
+++ perl/ext/DynaLoader/DynaLoader_pm.PL        2007-02-04 10:49:54.000000000 
-0800
@@ -26,6 +26,10 @@
 #   
 #  -- added by VKON, 03-10-2004 to separate $^O-specific between OSes
 #     (so that Win32 never checks for $^O eq 'VMS' for example)
+#
+# The $^O tests test both for $^O and for $Config{osname}.
+# The latter is better for some for cross-compilation setups.
+#
 sub expand_os_specific {
     my $s = shift;
     for ($s) {
@@ -36,7 +40,7 @@
          if ($expr =~ m[^(.*?)<<\|\$\^O-$op-$os>>(.*?)$]s) {
              # #if;#else;#endif
              my ($if,$el) = ($1,$2);
-             if (($op eq 'eq' and $^O eq $os) || ($op eq 'ne' and $^O ne $os)) 
{
+             if (($op eq 'eq' and ($^O eq $os || $Config{osname} eq $os)) || 
($op eq 'ne' and ($^O ne $os || $Config{osname} ne $os))) {
                  $if
              }
              else {
@@ -45,7 +49,7 @@
          }
          else {
              # #if;#endif
-             if (($op eq 'eq' and $^O eq $os) || ($op eq 'ne' and $^O ne $os)) 
{
+             if (($op eq 'eq' and ($^O eq $os || $Config{osname} eq $os)) || 
($op eq 'ne' and ($^O ne $os || $Config{osname} ne $os))) {
                  $expr
              }
              else {
@@ -64,7 +68,7 @@
 open OUT, ">DynaLoader.pm" or die $!;
 print OUT <<'EOT';
 
-# Generated from DynaLoader.pm.PL
+# Generated from DynaLoader_pm.PL
 
 package DynaLoader;
 
@@ -80,9 +84,16 @@
 #
 # [EMAIL PROTECTED], August 1994
 
-use vars qw($VERSION *AUTOLOAD $XS_VERSION);
+# Sadly we can't remove this in 5.8.x *either*, because we had being using
+# vars, and vars.pm requires warnings::register requires warnings requires
+# Carp, and at that point we're covering up buggy code that does require Carp;
+# Carp::croak "..."; without brackets. Only now will 5.10.0 actually manage
+# to ship a DynaLoader that doesn't indirectly load Carp;
+require Carp;
 
-$VERSION = '1.06';
+BEGIN {
+    $VERSION = '1.08';
+}
 
 # See http://rt.perl.org/rt3//Public/Bug/Display.html?id=32539
 # for why we need this. Basically any embedded code will have 1.05 hard-coded
@@ -105,13 +116,6 @@
 
 use Config;
 
-# The following require can't be removed during maintenance
-# releases, sadly, because of the risk of buggy code that does 
-# require Carp; Carp::croak "..."; without brackets dying 
-# if Carp hasn't been loaded in earlier compile time. :-( 
-# We'll let those bugs get found on the development track.
-require Carp if $] < 5.00450; 
-
 # enable debug/trace messages from DynaLoader perl code
 $dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug;
 
@@ -521,13 +525,22 @@
             push(@names,"$_.a")          if !m/\.a$/ and $dlsrc eq "dl_dld.xs";
             push(@names, $_);
         }
+       my $dirsep = '/';
+       <<$^O-eq-symbian>>
+       $dirsep = '\\';
+       if ($0 =~ /^([a-z]):/i) {
+           my $drive = $1;
+           @dirs = map { "$drive:$_" } @dirs;
+           @dl_library_path = map { "$drive:$_" } @dl_library_path;
+       }
+       <</$^O-eq-symbian>>
         foreach $dir (@dirs, @dl_library_path) {
             next unless -d $dir;
            <<$^O-eq-VMS>>
             chop($dir = VMS::Filespec::unixpath($dir));
            <</$^O-eq-VMS>>
             foreach $name (@names) {
-               my($file) = "$dir/$name";
+               my($file) = "$dir$dirsep$name";
                 print STDERR " checking in $dir for $name\n" if $dl_debug;
                $file = ($do_expand) ? dl_expandspec($file) : (-f $file && 
$file);
                #$file = _check_file($file);

==== //depot/maint-5.8/perl/ext/DynaLoader/Makefile.PL#3 (text) ====
Index: perl/ext/DynaLoader/Makefile.PL
--- perl/ext/DynaLoader/Makefile.PL#2~30112~    2007-02-04 03:54:14.000000000 
-0800
+++ perl/ext/DynaLoader/Makefile.PL     2007-02-04 10:49:54.000000000 -0800
@@ -13,7 +13,7 @@
                    'XSLoader_pm.PL'=>'XSLoader.pm'},
     PM         => {'DynaLoader.pm' => '$(INST_LIBDIR)/DynaLoader.pm',
                    'XSLoader.pm' => '$(INST_LIBDIR)/XSLoader.pm'},
-    depend      => {'DynaLoader.o' => 'dlutils.c'},
+    depend      => {'DynaLoader$(OBJ_EXT)' => 'dlutils.c'},
     clean      => {FILES => 'DynaLoader.c DynaLoader.xs DynaLoader.pm ' .
                             'XSLoader.pm'},
 );
@@ -33,3 +33,10 @@
 ';
 }
 
+sub MY::static {
+       '
+static :: $(FIRST_MAKEFILE) $(OBJECT)
+       $(RM_RF) $(PERL_SRC)/$(OBJECT)
+       $(CP) $(OBJECT) $(PERL_SRC)/$(OBJECT)
+';
+}

==== //depot/maint-5.8/perl/ext/DynaLoader/XSLoader_pm.PL#7 (text) ====
Index: perl/ext/DynaLoader/XSLoader_pm.PL
--- perl/ext/DynaLoader/XSLoader_pm.PL#6~26618~ 2006-01-03 10:15:54.000000000 
-0800
+++ perl/ext/DynaLoader/XSLoader_pm.PL  2007-02-04 10:49:54.000000000 -0800
@@ -15,7 +15,7 @@
 
 package XSLoader;
 
-$VERSION = "0.06";
+$VERSION = "0.07";
 
 #use strict;
 
@@ -62,6 +62,13 @@
 
 EOT
 
+print OUT <<'EOT' if $^O eq 'os2';
+
+    # os2 static build can dynaload, but cannot dynaload Perl modules...
+    die 'Dynaloaded Perl modules are not available in this build of Perl' if 
$OS2::is_static;
+
+EOT
+ 
 print OUT <<'EOT';
     my $modpname = join('/',@modparts);
     my $modlibname = (caller())[1];
@@ -82,12 +89,17 @@
 
     my $boot_symbol_ref;
 
+EOT
+
     if ($^O eq 'darwin') {
+print OUT <<'EOT';
         if ($boot_symbol_ref = dl_find_symbol(0, $bootname)) {
             goto boot; #extension library has already been loaded, e.g. darwin
         }
+EOT
     }
 
+print OUT <<'EOT';
     # Many dynamic extension loading problems will appear to come from
     # this section of code: XYZ failed at line 123 of DynaLoader.pm.
     # Often these errors are actually occurring in the initialisation
@@ -150,7 +162,7 @@
 
 =head1 VERSION
 
-Version 0.06
+Version 0.07
 
 =head1 SYNOPSIS
 
@@ -318,24 +330,24 @@
 
 =head1 DIAGNOSTICS
 
-=over 4
+=over
 
-=item Can't find '%s' symbol in %s
+=item C<Can't find '%s' symbol in %s>
 
 B<(F)> The bootstrap symbol could not be found in the extension module.
 
-=item Can't load '%s' for module %s: %s
+=item C<Can't load '%s' for module %s: %s>
 
 B<(F)> The loading or initialisation of the extension module failed.
 The detailed error follows.
 
-=item Undefined symbols present after loading %s: %s
+=item C<Undefined symbols present after loading %s: %s>
 
 B<(W)> As the message says, some symbols stay undefined although the
 extension module was correctly loaded and initialised. The list of undefined
 symbols follows.
 
-=item XSLoader::load('Your::Module', $Your::Module::VERSION)
+=item C<XSLoader::load('Your::Module', $Your::Module::VERSION)>
 
 B<(F)> You tried to invoke C<load()> without any argument. You must supply
 a module name, and optionally its version.
@@ -371,9 +383,9 @@
 Ilya Zakharevich originally extracted C<XSLoader> from C<DynaLoader>.
 
 CPAN version is currently maintained by SE<eacute>bastien Aperghis-Tramoni
-E<lt>[EMAIL PROTECTED]<gt>
+E<lt>[EMAIL PROTECTED]<gt>.
 
-Previous maintainer was Michael G Schwern <[EMAIL PROTECTED]>
+Previous maintainer was Michael G Schwern <[EMAIL PROTECTED]>.
 
 
 =head1 COPYRIGHT

==== //depot/maint-5.8/perl/ext/DynaLoader/dl_vms.xs#4 (text) ====
Index: perl/ext/DynaLoader/dl_vms.xs
--- perl/ext/DynaLoader/dl_vms.xs#3~29968~      2007-01-25 02:55:13.000000000 
-0800
+++ perl/ext/DynaLoader/dl_vms.xs       2007-02-04 10:49:54.000000000 -0800
@@ -1,8 +1,8 @@
 /* dl_vms.xs
  * 
- * Platform:  OpenVMS, VAX or AXP
+ * Platform:  OpenVMS, VAX or AXP or IA64
  * Author:    Charles Bailey  [EMAIL PROTECTED]
- * Revised:   12-Dec-1994
+ * Revised:   See http://public.activestate.com/cgi-bin/perlbrowse
  *
  *                           Implementation Note
  *     This section is added as an aid to users and DynaLoader developers, in
@@ -247,8 +247,8 @@
     }
 
 void
-dl_load_file(filespec, flags)
-    char *     filespec
+dl_load_file(filename, flags=0)
+    char *     filename
     int                flags
     PREINIT:
     dTHX;
@@ -269,10 +269,13 @@
     void (*entry)();
     CODE:
 
-    DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", 
filespec,flags));
-    specdsc.dsc$a_pointer = tovmsspec(filespec,vmsspec);
+    DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", 
filename,flags));
+    specdsc.dsc$a_pointer = tovmsspec(filename,vmsspec);
     specdsc.dsc$w_length = strlen(specdsc.dsc$a_pointer);
-    DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tVMS-ified filespec is %s\n",
+    if (specdsc.dsc$w_length == 0) { /* undef in, empty out */
+        XSRETURN_EMPTY;
+    }
+    DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tVMS-ified filename is %s\n",
                       specdsc.dsc$a_pointer));
     Newx(dlptr,1,struct libref);
     dlptr->name.dsc$b_dtype = dlptr->defspec.dsc$b_dtype = DSC$K_DTYPE_T;
@@ -338,7 +341,7 @@
     void (*entry)();
     vmssts sts;
 
-    DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_find_dymbol(%.*s,%.*s):\n",
+    DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_find_symbol(%.*s,%.*s):\n",
                       thislib.name.dsc$w_length, thislib.name.dsc$a_pointer,
                       symdsc.dsc$w_length,symdsc.dsc$a_pointer));
     sts = my_find_image_symbol(&(thislib.name),&symdsc,

==== //depot/maint-5.8/perl/ext/DynaLoader/dlutils.c#4 (text) ====
Index: perl/ext/DynaLoader/dlutils.c
--- perl/ext/DynaLoader/dlutils.c#3~28128~      2006-05-08 12:22:03.000000000 
-0700
+++ perl/ext/DynaLoader/dlutils.c       2007-02-04 10:49:54.000000000 -0800
@@ -8,6 +8,12 @@
  *                      files when the interpreter exits
  */
 
+#ifndef START_MY_CXT /* Some IDEs try compiling this standalone. */
+#   include "EXTERN.h"
+#   include "perl.h"
+#   include "XSUB.h"
+#endif
+
 #ifndef XS_VERSION
 #  define XS_VERSION "0"
 #endif
@@ -110,6 +116,7 @@
 }
 
 
+#ifndef SYMBIAN
 /* SaveError() takes printf style args and saves the result in dl_last_error */
 static void
 SaveError(pTHX_ const char* pat, ...)
@@ -133,4 +140,5 @@
     sv_setpvn(MY_CXT.x_dl_last_error, message, len) ;
     DLDEBUG(2,PerlIO_printf(Perl_debug_log, "DynaLoader: stored error msg 
'%s'\n",dl_last_error));
 }
+#endif
 

==== //depot/maint-5.8/perl/ext/DynaLoader/t/DynaLoader.t#1 (text) ====
Index: perl/ext/DynaLoader/t/DynaLoader.t
--- /dev/null   2007-01-16 11:55:45.526841103 -0800
+++ perl/ext/DynaLoader/t/DynaLoader.t  2007-02-04 10:49:54.000000000 -0800
@@ -0,0 +1,126 @@
+#!/usr/bin/perl -wT
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    }
+}
+
+use strict;
+use Config;
+use Test::More;
+my %modules;
+
+%modules = (
+   # ModuleName  => q| code to check that it was loaded |,
+    'Cwd'        => q| ::is( ref Cwd->can('fastcwd'),'CODE' ) |,         # 5.7 
?
+    'File::Glob' => q| ::is( ref File::Glob->can('doglob'),'CODE' ) |,   # 5.6
+    'SDBM_File'  => q| ::is( ref SDBM_File->can('TIEHASH'), 'CODE' ) |,  # 5.0
+    'Socket'     => q| ::is( ref Socket->can('inet_aton'),'CODE' ) |,    # 5.0
+    'Time::HiRes'=> q| ::is( ref Time::HiRes->can('usleep'),'CODE' ) |,  # 
5.7.3
+);
+
+plan tests => 27 + keys(%modules) * 2;
+
+
+# Try to load the module
+use_ok( 'DynaLoader' );
+
+
+# Check functions
+can_ok( 'DynaLoader' => 'bootstrap'               ); # defined in Perl section
+can_ok( 'DynaLoader' => 'dl_error'                ); # defined in XS section
+can_ok( 'DynaLoader' => 'dl_find_symbol'          ); # defined in XS section
+can_ok( 'DynaLoader' => 'dl_install_xsub'         ); # defined in XS section
+can_ok( 'DynaLoader' => 'dl_load_file'            ); # defined in XS section
+can_ok( 'DynaLoader' => 'dl_load_flags'           ); # defined in Perl section
+can_ok( 'DynaLoader' => 'dl_undef_symbols'        ); # defined in XS section
+SKIP: {
+    skip "unloading unsupported on $^O", 1 if ($^O eq 'VMS' || $^O eq 
'darwin');
+    can_ok( 'DynaLoader' => 'dl_unload_file'          ); # defined in XS 
section
+}
+
+TODO: {
+local $TODO = "Test::More::can_ok() seems to have trouble dealing with 
AutoLoaded functions";
+can_ok( 'DynaLoader' => 'dl_expandspec'           ); # defined in AutoLoaded 
section
+can_ok( 'DynaLoader' => 'dl_findfile'             ); # defined in AutoLoaded 
section
+can_ok( 'DynaLoader' => 'dl_find_symbol_anywhere' ); # defined in AutoLoaded 
section
+}
+
+
+# Check error messages
+# .. for bootstrap()
+eval { DynaLoader::bootstrap() };
+like( $@, q{/^Usage: DynaLoader::bootstrap\(module\)/},
+        "calling DynaLoader::bootstrap() with no argument" );
+
+eval { package egg_bacon_sausage_and_spam; 
DynaLoader::bootstrap("egg_bacon_sausage_and_spam") };
+like( $@, q{/^Can't locate loadable object for module 
egg_bacon_sausage_and_spam/},
+        "calling DynaLoader::bootstrap() with a package without binary object" 
);
+
+# .. for dl_load_file()
+eval { DynaLoader::dl_load_file() };
+like( $@, q{/^Usage: DynaLoader::dl_load_file\(filename, flags=0\)/},
+        "calling DynaLoader::dl_load_file() with no argument" );
+
+eval { no warnings 'uninitialized'; DynaLoader::dl_load_file(undef) };
+is( $@, '', "calling DynaLoader::dl_load_file() with undefined argument" );    
 # is this expected ?
+
+my ($dlhandle, $dlerr);
+eval { $dlhandle = DynaLoader::dl_load_file("egg_bacon_sausage_and_spam") };
+$dlerr = DynaLoader::dl_error();
+SKIP: {
+    skip "dl_load_file() does not attempt to load file on VMS (and thus does 
not fail) when [EMAIL PROTECTED] is empty", 1 if $^O eq 'VMS';
+    ok( !$dlhandle, "calling DynaLoader::dl_load_file() without an existing 
library should fail" );
+}
+ok( defined $dlerr, "dl_error() returning an error message: '$dlerr'" );
+
+# Checking for any particular error messages or numeric codes
+# is very unportable, please do not try to do that.  A failing
+# dl_load_file() is not even guaranteed to set the $! or the $^E.
+
+# ... dl_findfile()
+SKIP: {
+    my @files = ();
+    eval { @files = DynaLoader::dl_findfile("c") };
+    is( $@, '', "calling dl_findfile()" );
+    # Some platforms are known to not have a "libc"
+    # (not at least by that name) that the dl_findfile()
+    # could find.
+    skip "dl_findfile test not appropriate on $^O", 1
+       if $^O =~ /(win32|vms|openbsd|cygwin)/i;
+    # Play safe and only try this test if this system
+    # looks pretty much Unix-like.
+    skip "dl_findfile test not appropriate on $^O", 1
+       unless -d '/usr' && -f '/bin/ls';
+    cmp_ok( scalar @files, '>=', 1, "array should contain one result result or 
more: libc => (@files)" );
+}
+
+# Now try to load well known XS modules
+my $extensions = $Config{'extensions'};
+$extensions =~ s|/|::|g;
+
+for my $module (sort keys %modules) {
+    SKIP: {
+        skip "$module not available", 1 if $extensions !~ /\b$module\b/;
+        eval "use $module";
+        is( $@, '', "loading $module" );
+    }
+}
+
+# checking internal consistency
+is( scalar @DynaLoader::dl_librefs, scalar keys %modules, "checking number of 
items in [EMAIL PROTECTED]" );
+is( scalar @DynaLoader::dl_modules, scalar keys %modules, "checking number of 
items in [EMAIL PROTECTED]" );
+
+my @loaded_modules = @DynaLoader::dl_modules;
+for my $libref (reverse @DynaLoader::dl_librefs) {
+  SKIP: {
+    skip "unloading unsupported on $^O", 2 if ($^O eq 'VMS' || $^O eq 
'darwin');
+    my $module = pop @loaded_modules;
+    my $r = eval { DynaLoader::dl_unload_file($libref) };
+    is( $@, '', "calling dl_unload_file() for $module" );
+    is( $r,  1, " - unload was successful" );
+  }
+}
+

==== //depot/maint-5.8/perl/ext/DynaLoader/t/XSLoader.t#5 (text) ====
Index: perl/ext/DynaLoader/t/XSLoader.t
--- perl/ext/DynaLoader/t/XSLoader.t#4~26618~   2006-01-03 10:15:54.000000000 
-0800
+++ perl/ext/DynaLoader/t/XSLoader.t    2007-02-04 10:49:54.000000000 -0800
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -wT
+#!/usr/bin/perl -T
 
 BEGIN {
     if( $ENV{PERL_CORE} ) {
@@ -9,43 +9,59 @@
 
 use strict;
 use Config;
-use Test::More;
-my %modules;
+
 BEGIN {
-    %modules = (
-      # ModuleName  => q|code to check that it was loaded|,
-       'Cwd'        => q| ::is( ref Cwd->can('fastcwd'),'CODE' ) |,         # 
5.7 ?
-       'File::Glob' => q| ::is( ref File::Glob->can('doglob'),'CODE' ) |,   # 
5.6
-       'SDBM_File'  => q| ::is( ref SDBM_File->can('TIEHASH'), 'CODE' ) |,  # 
5.0
-       'Socket'     => q| ::is( ref Socket->can('inet_aton'),'CODE' ) |,    # 
5.0
-       'Time::HiRes'=> q| ::is( ref Time::HiRes->can('usleep'),'CODE' ) |,  # 
5.7.3
-    );
-    plan tests => keys(%modules) * 2 + 3
+    eval "use Test::More";
+    if ($@) {
+        print "1..0 # Skip: Test::More not available\n";
+        die "Test::More not available\n";
+    }
 }
 
 
-BEGIN {
-    use_ok( 'XSLoader' );
-}
+my %modules = (
+    # ModuleName  => q|code to check that it was loaded|,
+    'Cwd'        => q| ::can_ok( 'Cwd' => 'fastcwd'         ) |,  # 5.7 ?
+    'File::Glob' => q| ::can_ok( 'File::Glob' => 'doglob'   ) |,  # 5.6
+    'SDBM_File'  => q| ::can_ok( 'SDBM_File' => 'TIEHASH'   ) |,  # 5.0
+    'Socket'     => q| ::can_ok( 'Socket' => 'inet_aton'    ) |,  # 5.0
+    'Time::HiRes'=> q| ::can_ok( 'Time::HiRes' => 'usleep'  ) |,  # 5.7.3
+);
+
+plan tests => keys(%modules) * 3 + 5;
+
+# Try to load the module
+use_ok( 'XSLoader' );
 
 # Check functions
 can_ok( 'XSLoader' => 'load' );
-#can_ok( 'XSLoader' => 'bootstrap_inherit' );  # doesn't work
+can_ok( 'XSLoader' => 'bootstrap_inherit' );
 
 # Check error messages
 eval { XSLoader::load() };
 like( $@, '/^XSLoader::load\(\'Your::Module\', \$Your::Module::VERSION\)/',
         "calling XSLoader::load() with no argument" );
 
+eval q{ package Thwack; XSLoader::load('Thwack'); };
+like( $@, q{/^Can't locate loadable object for module Thwack in @INC/},
+        "calling XSLoader::load() under a package with no XS part" );
+
 # Now try to load well known XS modules
 my $extensions = $Config{'extensions'};
 $extensions =~ s|/|::|g;
 
 for my $module (sort keys %modules) {
     SKIP: {
-        skip "$module not available", 2 if $extensions !~ /\b$module\b/;
-        eval qq| package $module; XSLoader::load('$module'); | . 
$modules{$module};
+        skip "$module not available", 3 if $extensions !~ /\b$module\b/;
+
+        eval qq{ package $module; XSLoader::load('$module', "qunckkk"); };
+        like( $@, "/^$module object version \\S+ does not match bootstrap 
parameter (?:qunckkk|0\\.000)/",  
+                "calling XSLoader::load() with a XS module and an incorrect 
version" );
+
+        eval qq{ package $module; XSLoader::load('$module'); };
         is( $@, '',  "XSLoader::load($module)");
+
+        eval qq{ package $module; $modules{$module}; };
     }
 }
 

==== //depot/maint-5.8/perl/ext/util/make_ext#2 (text) ====
Index: perl/ext/util/make_ext
--- perl/ext/util/make_ext#1~17645~     2002-07-19 12:29:57.000000000 -0700
+++ perl/ext/util/make_ext      2007-02-04 10:49:54.000000000 -0800
@@ -65,6 +65,7 @@
        pname=`echo "$extspec" | sed -e 's:^ext/::' -e 's:/pm_to_blib$::' ` ;;
 *::*)  # Convert :: to /
        pname=`echo "$extspec" | sed -e 's/::/\//g' ` ;;
+*.o)    pname=`echo "$extspec" | sed -e 's/\.o//'` ;;
 *)     pname="$extspec" ;;
 esac
 # echo "Converted $extspec to $pname"

==== //depot/maint-5.8/perl/lib/ExtUtils/Embed.pm#3 (text) ====
Index: perl/lib/ExtUtils/Embed.pm
--- perl/lib/ExtUtils/Embed.pm#2~25817~ 2005-10-21 08:28:21.000000000 -0700
+++ perl/lib/ExtUtils/Embed.pm  2007-02-04 10:49:54.000000000 -0800
@@ -425,7 +425,7 @@
  perl -MExtUtils::Embed -e ldopts
 
 
-This will print arguments for linking with B<libperl.a>, B<DynaLoader> and 
+This will print arguments for linking with B<libperl> and
 extensions found in B<$Config{static_ext}>.  This includes libraries
 found in B<$Config{libs}> and the first ModuleName.a library
 for each extension that is found by searching B<@INC> or the path 
@@ -439,17 +439,8 @@
 
 This will do the same as the above example, along with printing additional 
arguments for linking with the B<Socket> extension.
 
-
- perl -MExtUtils::Embed -e ldopts -- DynaLoader
-
-
-This will print arguments for linking with just the B<DynaLoader> extension
-and B<libperl.a>.
-
-
  perl -MExtUtils::Embed -e ldopts -- -std Msql -- -L/usr/msql/lib -lmsql
 
-
 Any arguments after the second '--' token are additional linker
 arguments that will be examined for potential conflict.  If there is no
 conflict, the additional arguments will be part of the output.  

==== //depot/maint-5.8/perl/t/lib/1_compile.t#5 (text) ====
Index: perl/t/lib/1_compile.t
--- perl/t/lib/1_compile.t#4~26697~     2006-01-07 05:18:30.000000000 -0800
+++ perl/t/lib/1_compile.t      2007-02-04 10:49:54.000000000 -0800
@@ -75,5 +75,4 @@
 __DATA__
 ByteLoader
 CPAN::FirstTime
-DynaLoader
 Pod::Plainer

==== //depot/maint-5.8/perl/writemain.SH#5 (text) ====
Index: perl/writemain.SH
--- perl/writemain.SH#4~29968~  2007-01-25 02:55:13.000000000 -0800
+++ perl/writemain.SH   2007-02-04 10:49:54.000000000 -0800
@@ -39,8 +39,8 @@
 : Remove any .a suffixes and any leading path components
 for file in $orig ; do
         case "$file" in
-           *.a)  file=`echo $file | sed 's/\.a//g'`
-                 ;;
+           *.a)  file=`echo $file | sed 's/\.a//g'`;;
+           *.o)  file=`echo $file | sed 's/\.o//g'`;;
         esac
        case "$file" in
        ext/*)  file=`echo $file | sed 's:ext/\(.*\)/[^/]*:\1:'`
End of Patch.

Reply via email to