summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/DynaLoader.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/DynaLoader.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/DynaLoader.pm52
1 files changed, 17 insertions, 35 deletions
diff --git a/Master/tlpkg/tlperl/lib/DynaLoader.pm b/Master/tlpkg/tlperl/lib/DynaLoader.pm
index 8ffc9b7672c..44b1c1735f6 100644
--- a/Master/tlpkg/tlperl/lib/DynaLoader.pm
+++ b/Master/tlpkg/tlperl/lib/DynaLoader.pm
@@ -16,12 +16,9 @@ package DynaLoader;
# Tim.Bunce@ig.co.uk, August 1994
BEGIN {
- $VERSION = '1.10';
+ $VERSION = '1.13';
}
-require AutoLoader;
-*AUTOLOAD = \&AutoLoader::AUTOLOAD;
-
use Config;
# enable debug/trace messages from DynaLoader perl code
@@ -45,8 +42,6 @@ sub dl_load_flags { 0x00 }
$do_expand = 0;
-
-
@dl_require_symbols = (); # names of symbols we need
@dl_resolve_using = (); # names of files to link with
@dl_library_path = (); # path to look for files
@@ -110,9 +105,6 @@ sub bootstrap_inherit {
bootstrap(@_);
}
-# The bootstrap function cannot be autoloaded (without complications)
-# so we define it here:
-
sub bootstrap {
# use local vars to enable $module.bs script to edit values
local(@args) = @_;
@@ -151,14 +143,12 @@ sub bootstrap {
foreach (@INC) {
-
my $dir = "$_/auto/$modpname";
-
next unless -d $dir; # skip over uninteresting directories
# check for common cases to avoid autoload of dl_findfile
- my $try = "$dir/$modfname.$dl_dlext";
+ my $try = "$dir/$modfname.$dl_dlext";
last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try);
# no luck here, save dir for possible later dl_findfile search
@@ -223,19 +213,6 @@ sub bootstrap {
&$xs(@args);
}
-
-#sub _check_file { # private utility to handle dl_expandspec vs -f tests
-# my($file) = @_;
-# return $file if (!$do_expand && -f $file); # the common case
-# return $file if ( $do_expand && ($file=dl_expandspec($file)));
-# return undef;
-#}
-
-
-# Let autosplit and the autoloader deal with these functions:
-__END__
-
-
sub dl_findfile {
# Read ext/DynaLoader/DynaLoader.doc for detailed information.
# This function does not automatically consider the architecture
@@ -253,7 +230,6 @@ sub dl_findfile {
# Special fast case: full filepath requires no search
-
if (m:/: && -f $_) {
push(@found,$_);
last arg unless wantarray;
@@ -265,8 +241,6 @@ sub dl_findfile {
# Using a -L prefix is the preferred option (faster and more robust)
if (m:^-L:) { s/^-L//; push(@dirs, $_); next; }
-
-
# Otherwise we try to try to spot directories by a heuristic
# (this is a more complicated issue than it first appears)
if (m:/: && -d $_) { push(@dirs, $_); next; }
@@ -283,6 +257,7 @@ sub dl_findfile {
# these should be ordered with the most likely first
push(@names,"$_.$dl_dlext") unless m/\.$dl_dlext$/o;
push(@names,"$_.$dl_so") unless m/\.$dl_so$/o;
+
push(@names,"lib$_.$dl_so") unless m:/:;
push(@names,"$_.a") if !m/\.a$/ and $dlsrc eq "dl_dld.xs";
push(@names, $_);
@@ -315,12 +290,13 @@ sub dl_findfile {
}
+
sub dl_expandspec {
my($spec) = @_;
# Optional function invoked if DynaLoader.pm sets $do_expand.
# Most systems do not require or use this function.
# Some systems may implement it in the dl_*.xs file in which case
- # this autoload version will not be called but is harmless.
+ # this Perl version should be excluded at build time.
# This function is designed to deal with systems which treat some
# 'filenames' in a special way. For example VMS 'Logical Names'
@@ -331,9 +307,7 @@ sub dl_expandspec {
my $file = $spec; # default output to input
-
return undef unless -f $file;
-
print STDERR "dl_expandspec($spec) => $file\n" if $dl_debug;
$file;
}
@@ -349,6 +323,8 @@ sub dl_find_symbol_anywhere
return undef;
}
+__END__
+
=head1 NAME
DynaLoader - Dynamically load C libraries into Perl code
@@ -549,9 +525,8 @@ Some unusual systems, such as VMS, require special filename handling in
order to deal with symbolic names for files (i.e., VMS's Logical Names).
To support these systems a dl_expandspec() function can be implemented
-either in the F<dl_*.xs> file or code can be added to the autoloadable
-dl_expandspec() function in F<DynaLoader.pm>. See F<DynaLoader.pm> for
-more information.
+either in the F<dl_*.xs> file or code can be added to the dl_expandspec()
+function in F<DynaLoader.pm>. See F<DynaLoader_pm.PL> for more information.
=item dl_load_file()
@@ -698,7 +673,7 @@ $filename is not defined then "DynaLoader" will be used.
Syntax:
-bootstrap($module)
+bootstrap($module [...])
This is the normal entry point for automatic dynamic loading in Perl.
@@ -751,6 +726,13 @@ it uses the function reference returned by dl_install_xsub for speed)
=back
+All arguments to bootstrap() are passed to the module's bootstrap function.
+The default code generated by F<xsubpp> expects $module [, $version]
+If the optional $version argument is not given, it defaults to
+C<$XS_VERSION // $VERSION> in the module's symbol table. The default code
+compares the Perl-space version with the version of the compiled XS code,
+and croaks with an error if they do not match.
+
=back