X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FDynaLoader%2FXSLoader_pm.PL;h=a258f6ea51a2ca4a65d590a33b4d51f01c48ecee;hb=12c541f435c0fde6414e8942d051e05098e0253e;hp=82bdeacb803357988dc5c0b816c97f43bebaa037;hpb=9c6b46e2ec49ec38e1f74cac342d7860abe20c23;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/DynaLoader/XSLoader_pm.PL b/ext/DynaLoader/XSLoader_pm.PL index 82bdeac..a258f6e 100644 --- a/ext/DynaLoader/XSLoader_pm.PL +++ b/ext/DynaLoader/XSLoader_pm.PL @@ -15,7 +15,7 @@ print OUT <<'EOT'; package XSLoader; -$VERSION = "0.06"; +$VERSION = "0.10"; #use strict; @@ -44,8 +44,8 @@ sub load { my($module) = $_[0]; # work with static linking too - my $b = "$module\::bootstrap"; - goto &$b if defined &$b; + my $boots = "$module\::bootstrap"; + goto &$boots if defined &$boots; goto retry unless $module and defined &dl_load_file; @@ -62,6 +62,13 @@ print OUT <<'EOT' if defined &DynaLoader::mod2fname; 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]; @@ -74,6 +81,12 @@ print OUT <<'EOT'; my $bs = $file; $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library + if (-s $bs) { # only read file if it's not empty +# print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug; + eval { do $bs; }; + warn "$bs: $@\n" if $@; + } + goto retry if not -f $file or -s $bs; my $bootname = "boot_$module"; @@ -82,12 +95,17 @@ print OUT <<'EOT'; 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 @@ -115,7 +133,7 @@ print OUT <<'EOT'; push(@DynaLoader::dl_modules, $module); # record loaded module boot: - my $xs = dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file); + my $xs = dl_install_xsub($boots, $boot_symbol_ref, $file); # See comment block above push(@DynaLoader::dl_shared_objects, $file); # record files loaded @@ -150,7 +168,7 @@ XSLoader - Dynamically load C libraries into Perl code =head1 VERSION -Version 0.06 +Version 0.10 =head1 SYNOPSIS @@ -318,24 +336,24 @@ this: =head1 DIAGNOSTICS -=over 4 +=over -=item Can't find '%s' symbol in %s +=item C B<(F)> The bootstrap symbol could not be found in the extension module. -=item Can't load '%s' for module %s: %s +=item C 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 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 B<(F)> You tried to invoke C without any argument. You must supply a module name, and optionally its version. @@ -371,18 +389,19 @@ L Ilya Zakharevich originally extracted C from C. CPAN version is currently maintained by SEbastien Aperghis-Tramoni -Esebastien@aperghis.netE +Esebastien@aperghis.netE. + +Previous maintainer was Michael G Schwern . -Previous maintainer was Michael G Schwern +=head1 COPYRIGHT & LICENSE -=head1 COPYRIGHT +Copyright (C) 1990-2007 by Larry Wall and others. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut - EOT close OUT or die $!;