line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Generated from XSLoader.pm.PL (resolved %Config::Config value) |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package XSLoader; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
$VERSION = "0.20"; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#use strict; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package DynaLoader; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here. |
12
|
|
|
|
|
|
|
# NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB |
13
|
|
|
|
|
|
|
boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) && |
14
|
|
|
|
|
|
|
!defined(&dl_error); |
15
|
|
|
|
|
|
|
package XSLoader; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub load { |
18
|
|
|
|
|
|
|
package DynaLoader; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
0
|
1
|
|
my ($caller, $modlibname) = caller(); |
21
|
0
|
|
|
|
|
|
my $module = $caller; |
22
|
|
|
|
|
|
|
|
23
|
0
|
0
|
|
|
|
|
if (@_) { |
24
|
0
|
|
|
|
|
|
$module = $_[0]; |
25
|
|
|
|
|
|
|
} else { |
26
|
0
|
|
|
|
|
|
$_[0] = $module; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# work with static linking too |
30
|
0
|
|
|
|
|
|
my $boots = "$module\::bootstrap"; |
31
|
0
|
0
|
|
|
|
|
goto &$boots if defined &$boots; |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
0
|
|
|
|
goto \&XSLoader::bootstrap_inherit unless $module and defined &dl_load_file; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
my @modparts = split(/::/,$module); |
36
|
0
|
|
|
|
|
|
my $modfname = $modparts[-1]; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $modpname = join('/',@modparts); |
39
|
0
|
|
|
|
|
|
my $c = () = split(/::/,$caller,-1); |
40
|
0
|
|
|
|
|
|
$modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename |
41
|
0
|
|
|
|
|
|
my $file = "$modlibname/auto/$modpname/$modfname.so"; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug; |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
my $bs = $file; |
46
|
0
|
|
|
|
|
|
$bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
if (-s $bs) { # only read file if it's not empty |
49
|
|
|
|
|
|
|
# print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug; |
50
|
0
|
|
|
|
|
|
eval { do $bs; }; |
|
0
|
|
|
|
|
|
|
51
|
0
|
0
|
|
|
|
|
warn "$bs: $@\n" if $@; |
52
|
0
|
|
|
|
|
|
goto \&XSLoader::bootstrap_inherit; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
0
|
0
|
|
|
|
|
goto \&XSLoader::bootstrap_inherit if not -f $file; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
my $bootname = "boot_$module"; |
58
|
0
|
|
|
|
|
|
$bootname =~ s/\W/_/g; |
59
|
0
|
|
|
|
|
|
@DynaLoader::dl_require_symbols = ($bootname); |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
my $boot_symbol_ref; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# Many dynamic extension loading problems will appear to come from |
64
|
|
|
|
|
|
|
# this section of code: XYZ failed at line 123 of DynaLoader.pm. |
65
|
|
|
|
|
|
|
# Often these errors are actually occurring in the initialisation |
66
|
|
|
|
|
|
|
# C code of the extension XS file. Perl reports the error as being |
67
|
|
|
|
|
|
|
# in this perl code simply because this was the last perl code |
68
|
|
|
|
|
|
|
# it executed. |
69
|
|
|
|
|
|
|
|
70
|
0
|
0
|
|
|
|
|
my $libref = dl_load_file($file, 0) or do { |
71
|
0
|
|
|
|
|
|
require Carp; |
72
|
0
|
|
|
|
|
|
Carp::croak("Can't load '$file' for module $module: " . dl_error()); |
73
|
|
|
|
|
|
|
}; |
74
|
0
|
|
|
|
|
|
push(@DynaLoader::dl_librefs,$libref); # record loaded object |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
my @unresolved = dl_undef_symbols(); |
77
|
0
|
0
|
|
|
|
|
if (@unresolved) { |
78
|
0
|
|
|
|
|
|
require Carp; |
79
|
0
|
|
|
|
|
|
Carp::carp("Undefined symbols present after loading $file: @unresolved\n"); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
0
|
0
|
|
|
|
|
$boot_symbol_ref = dl_find_symbol($libref, $bootname) or do { |
83
|
0
|
|
|
|
|
|
require Carp; |
84
|
0
|
|
|
|
|
|
Carp::croak("Can't find '$bootname' symbol in $file\n"); |
85
|
|
|
|
|
|
|
}; |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
|
push(@DynaLoader::dl_modules, $module); # record loaded module |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
boot: |
90
|
|
|
|
|
|
|
my $xs = dl_install_xsub($boots, $boot_symbol_ref, $file); |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
# See comment block above |
93
|
0
|
|
|
|
|
|
push(@DynaLoader::dl_shared_objects, $file); # record files loaded |
94
|
0
|
|
|
|
|
|
return &$xs(@_); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
sub bootstrap_inherit { |
98
|
0
|
|
|
0
|
0
|
|
require DynaLoader; |
99
|
0
|
|
|
|
|
|
goto \&DynaLoader::bootstrap_inherit; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
1; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
__END__ |