1b39c5158Smillertuse strict;
2b39c5158Smillertuse Config;
36fb12b70Safresh1# We require DynaLoader to make sure that mod2fname is loaded
46fb12b70Safresh1eval { require DynaLoader };
5b39c5158Smillert
6b39c5158Smillert1 while unlink "XSLoader.pm";
7*9f11ffb7Safresh1open OUT, '>', 'XSLoader.pm' or die $!;
8b39c5158Smillertprint OUT <<'EOT';
9*9f11ffb7Safresh1# Generated from XSLoader_pm.PL (resolved %Config::Config value)
10b8851fccSafresh1# This file is unique for every OS
11b39c5158Smillert
12b39c5158Smillertpackage XSLoader;
13b39c5158Smillert
14*9f11ffb7Safresh1$VERSION = "0.30"; # remember to update version in POD!
15b39c5158Smillert
16b39c5158Smillert#use strict;
17b39c5158Smillert
18898184e3Ssthenpackage DynaLoader;
19b39c5158Smillert
20b39c5158SmillertEOT
21b39c5158Smillert
22898184e3Ssthen# dlutils.c before 5.006 has this:
23898184e3Ssthen#
24898184e3Ssthen#    #ifdef DEBUGGING
25898184e3Ssthen#        dl_debug = SvIV( perl_get_sv("DynaLoader::dl_debug", 0x04) );
26898184e3Ssthen#    #endif
27898184e3Ssthen#
28898184e3Ssthen# where 0x04 is GV_ADDWARN, which causes a warning to be issued by the call
29898184e3Ssthen# into XS below, if DynaLoader.pm hasn't been loaded.
30898184e3Ssthen# It was changed to 0 in the commit(s) that added XSLoader to the core
31898184e3Ssthen# (9cf41c4d23a47c8b and its parent 9426adcd48655815)
32898184e3Ssthen# Hence to backport XSLoader to work silently with earlier DynaLoaders we need
33898184e3Ssthen# to ensure that the variable exists:
34898184e3Ssthen
35898184e3Ssthenprint OUT <<'EOT' if $] < 5.006;
36898184e3Ssthen
37898184e3Ssthen# enable debug/trace messages from DynaLoader perl code
38898184e3Ssthen$dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug;
39898184e3Ssthen
40898184e3SsthenEOT
41b39c5158Smillert
42b39c5158Smillertprint OUT <<'EOT';
43b39c5158Smillert# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
44b39c5158Smillert# NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB
45b39c5158Smillertboot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
46b39c5158Smillert                                !defined(&dl_error);
47b39c5158Smillertpackage XSLoader;
48b39c5158Smillert
49b39c5158Smillertsub load {
50b39c5158Smillert    package DynaLoader;
51b39c5158Smillert
52b8851fccSafresh1    my ($caller, $modlibname) = caller();
53b8851fccSafresh1    my $module = $caller;
54b39c5158Smillert
55898184e3Ssthen    if (@_) {
56898184e3Ssthen        $module = $_[0];
57898184e3Ssthen    } else {
58898184e3Ssthen        $_[0] = $module;
59898184e3Ssthen    }
60b39c5158Smillert
61b39c5158Smillert    # work with static linking too
62b39c5158Smillert    my $boots = "$module\::bootstrap";
63b39c5158Smillert    goto &$boots if defined &$boots;
64b39c5158Smillert
65898184e3Ssthen    goto \&XSLoader::bootstrap_inherit unless $module and defined &dl_load_file;
66b39c5158Smillert
67b39c5158Smillert    my @modparts = split(/::/,$module);
68b39c5158Smillert    my $modfname = $modparts[-1];
69*9f11ffb7Safresh1    my $modfname_orig = $modfname; # For .bs file search
70b39c5158Smillert
71b39c5158SmillertEOT
72b39c5158Smillert
73b8851fccSafresh1# defined &DynaLoader::mod2fname catches most cases, except when
74b8851fccSafresh1# cross-compiling to a system that defines mod2fname. Using
75b8851fccSafresh1# $Config{d_libname_unique} is a best attempt at catching those cases.
76b8851fccSafresh1print OUT <<'EOT' if defined &DynaLoader::mod2fname || $Config{d_libname_unique};
77b39c5158Smillert    # Some systems have restrictions on files names for DLL's etc.
78b39c5158Smillert    # mod2fname returns appropriate file base name (typically truncated)
79b39c5158Smillert    # It may also edit @modparts if required.
80b8851fccSafresh1    $modfname = &DynaLoader::mod2fname(\@modparts) if defined &DynaLoader::mod2fname;
81b39c5158Smillert
82b39c5158SmillertEOT
83b39c5158Smillert
84b39c5158Smillertprint OUT <<'EOT' if $^O eq 'os2';
85b39c5158Smillert
86b39c5158Smillert    # os2 static build can dynaload, but cannot dynaload Perl modules...
87b39c5158Smillert    die 'Dynaloaded Perl modules are not available in this build of Perl' if $OS2::is_static;
88b39c5158Smillert
89b39c5158SmillertEOT
90b39c5158Smillert
91b39c5158Smillertprint OUT <<'EOT';
92b39c5158Smillert    my $modpname = join('/',@modparts);
93b8851fccSafresh1    my $c = () = split(/::/,$caller,-1);
94b39c5158Smillert    $modlibname =~ s,[\\/][^\\/]+$,, while $c--;    # Q&D basename
95b8851fccSafresh1EOT
96b8851fccSafresh1
97b8851fccSafresh1my $to_print = <<'EOT';
98ce05b150Smillert    # Does this look like a relative path?
99b8851fccSafresh1    if ($modlibname !~ m{regexp}) {
100b8851fccSafresh1EOT
101b8851fccSafresh1
102b8851fccSafresh1$to_print =~ s~regexp~
103b8851fccSafresh1    $^O eq 'MSWin32' || $^O eq 'os2' || $^O eq 'cygwin' || $^O eq 'amigaos'
104b8851fccSafresh1        ? '^(?:[A-Za-z]:)?[\\\/]' # Optional drive letter
105b8851fccSafresh1        : '^/'
106b8851fccSafresh1~e;
107b8851fccSafresh1
108b8851fccSafresh1print OUT $to_print, <<'EOT';
109ce05b150Smillert        # Someone may have a #line directive that changes the file name, or
110ce05b150Smillert        # may be calling XSLoader::load from inside a string eval.  We cer-
111ce05b150Smillert        # tainly do not want to go loading some code that is not in @INC,
112ce05b150Smillert        # as it could be untrusted.
113ce05b150Smillert        #
114ce05b150Smillert        # We could just fall back to DynaLoader here, but then the rest of
115ce05b150Smillert        # this function would go untested in the perl core, since all @INC
116ce05b150Smillert        # paths are relative during testing.  That would be a time bomb
117ce05b150Smillert        # waiting to happen, since bugs could be introduced into the code.
118ce05b150Smillert        #
119ce05b150Smillert        # So look through @INC to see if $modlibname is in it.  A rela-
120ce05b150Smillert        # tive $modlibname is not a common occurrence, so this block is
121ce05b150Smillert        # not hot code.
122ce05b150Smillert        FOUND: {
123ce05b150Smillert            for (@INC) {
124ce05b150Smillert                if ($_ eq $modlibname) {
125ce05b150Smillert                    last FOUND;
126ce05b150Smillert                }
127ce05b150Smillert            }
128ce05b150Smillert            # Not found.  Fall back to DynaLoader.
129ce05b150Smillert            goto \&XSLoader::bootstrap_inherit;
130ce05b150Smillert        }
131ce05b150Smillert    }
132898184e3SsthenEOT
133898184e3Ssthen
134898184e3Ssthenmy $dl_dlext = quotemeta($Config::Config{'dlext'});
135898184e3Ssthen
136898184e3Ssthenprint OUT <<"EOT";
137898184e3Ssthen    my \$file = "\$modlibname/auto/\$modpname/\$modfname.$dl_dlext";
138898184e3SsthenEOT
139898184e3Ssthen
140898184e3Ssthenprint OUT <<'EOT';
141b39c5158Smillert
142b39c5158Smillert#   print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug;
143b39c5158Smillert
144*9f11ffb7Safresh1    # N.B. The .bs file does not following the naming convention used
145*9f11ffb7Safresh1    # by mod2fname, so use the unedited version of the name.
146b39c5158Smillert
147*9f11ffb7Safresh1    my $bs = "$modlibname/auto/$modpname/$modfname_orig.bs";
148b39c5158Smillert
149*9f11ffb7Safresh1    # This calls DynaLoader::bootstrap, which will load the .bs file if present
150*9f11ffb7Safresh1    goto \&XSLoader::bootstrap_inherit if not -f $file or -s $bs;
151b39c5158Smillert
152b39c5158Smillert    my $bootname = "boot_$module";
153b39c5158Smillert    $bootname =~ s/\W/_/g;
154b39c5158Smillert    @DynaLoader::dl_require_symbols = ($bootname);
155b39c5158Smillert
156b39c5158Smillert    my $boot_symbol_ref;
157b39c5158Smillert
158b39c5158SmillertEOT
159b39c5158Smillert
160b39c5158Smillert    if ($^O eq 'darwin') {
161b8851fccSafresh1      my $extra_arg = ', 1 ' if $DynaLoader::VERSION ge '1.37';
162b8851fccSafresh1print OUT <<"EOT";
163b8851fccSafresh1    if (\$boot_symbol_ref = dl_find_symbol( 0, \$bootname $extra_arg)) {
164b39c5158Smillert        goto boot; #extension library has already been loaded, e.g. darwin
165b39c5158Smillert    }
166b39c5158SmillertEOT
167b39c5158Smillert    }
168b39c5158Smillert
169b39c5158Smillertprint OUT <<'EOT';
170b39c5158Smillert    # Many dynamic extension loading problems will appear to come from
171b39c5158Smillert    # this section of code: XYZ failed at line 123 of DynaLoader.pm.
172b39c5158Smillert    # Often these errors are actually occurring in the initialisation
173b39c5158Smillert    # C code of the extension XS file. Perl reports the error as being
174b39c5158Smillert    # in this perl code simply because this was the last perl code
175b39c5158Smillert    # it executed.
176b39c5158Smillert
177b39c5158Smillert    my $libref = dl_load_file($file, 0) or do {
178b39c5158Smillert        require Carp;
179b39c5158Smillert        Carp::croak("Can't load '$file' for module $module: " . dl_error());
180b39c5158Smillert    };
181b39c5158Smillert    push(@DynaLoader::dl_librefs,$libref);  # record loaded object
182b39c5158Smillert
183b8851fccSafresh1EOT
184b8851fccSafresh1my $dlsrc = $Config{dlsrc};
185b8851fccSafresh1if ($dlsrc eq 'dl_freemint.xs' || $dlsrc eq 'dl_dld.xs') {
186b8851fccSafresh1    print OUT <<'EOT';
187b39c5158Smillert    my @unresolved = dl_undef_symbols();
188b39c5158Smillert    if (@unresolved) {
189b39c5158Smillert        require Carp;
190b39c5158Smillert        Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
191b39c5158Smillert    }
192b39c5158Smillert
193b8851fccSafresh1EOT
194b8851fccSafresh1}
195b8851fccSafresh1
196b8851fccSafresh1print OUT <<'EOT';
197b39c5158Smillert    $boot_symbol_ref = dl_find_symbol($libref, $bootname) or do {
198b39c5158Smillert        require Carp;
199b39c5158Smillert        Carp::croak("Can't find '$bootname' symbol in $file\n");
200b39c5158Smillert    };
201b39c5158Smillert
202b39c5158Smillert    push(@DynaLoader::dl_modules, $module); # record loaded module
203b39c5158Smillert
204b39c5158Smillert  boot:
205b39c5158Smillert    my $xs = dl_install_xsub($boots, $boot_symbol_ref, $file);
206b39c5158Smillert
207b39c5158Smillert    # See comment block above
208b39c5158Smillert    push(@DynaLoader::dl_shared_objects, $file); # record files loaded
209b39c5158Smillert    return &$xs(@_);
210898184e3Ssthen}
211898184e3SsthenEOT
212b39c5158Smillert
213898184e3Ssthen# Can't test with DynaLoader->can('bootstrap_inherit') when building in the
214898184e3Ssthen# core, as XSLoader gets built before DynaLoader.
215898184e3Ssthen
216898184e3Ssthenif ($] >= 5.006) {
217898184e3Ssthen    print OUT <<'EOT';
218898184e3Ssthen
219898184e3Ssthensub bootstrap_inherit {
220898184e3Ssthen    require DynaLoader;
221898184e3Ssthen    goto \&DynaLoader::bootstrap_inherit;
222b39c5158Smillert}
223b39c5158Smillert
224898184e3SsthenEOT
225898184e3Ssthen} else {
226898184e3Ssthen    print OUT <<'EOT';
227898184e3Ssthen
228b39c5158Smillertsub bootstrap_inherit {
229898184e3Ssthen    # Versions of DynaLoader prior to 5.6.0 don't have bootstrap_inherit.
230b39c5158Smillert    package DynaLoader;
231b39c5158Smillert
232b39c5158Smillert    my $module = $_[0];
233b39c5158Smillert    local *DynaLoader::isa = *{"$module\::ISA"};
234b39c5158Smillert    local @DynaLoader::isa = (@DynaLoader::isa, 'DynaLoader');
235b39c5158Smillert    # Cannot goto due to delocalization.  Will report errors on a wrong line?
236b39c5158Smillert    require DynaLoader;
237b39c5158Smillert    DynaLoader::bootstrap(@_);
238b39c5158Smillert}
239b39c5158Smillert
240898184e3SsthenEOT
241898184e3Ssthen}
242898184e3Ssthen
243898184e3Ssthenprint OUT <<'EOT';
244b39c5158Smillert1;
245b39c5158Smillert
246b39c5158Smillert
247b39c5158Smillert__END__
248b39c5158Smillert
249b39c5158Smillert=head1 NAME
250b39c5158Smillert
251b39c5158SmillertXSLoader - Dynamically load C libraries into Perl code
252b39c5158Smillert
253b39c5158Smillert=head1 VERSION
254b39c5158Smillert
255*9f11ffb7Safresh1Version 0.30
256b39c5158Smillert
257b39c5158Smillert=head1 SYNOPSIS
258b39c5158Smillert
259b39c5158Smillert    package YourPackage;
260898184e3Ssthen    require XSLoader;
261b39c5158Smillert
262*9f11ffb7Safresh1    XSLoader::load(__PACKAGE__, $VERSION);
263b39c5158Smillert
264b39c5158Smillert=head1 DESCRIPTION
265b39c5158Smillert
266b39c5158SmillertThis module defines a standard I<simplified> interface to the dynamic
267b39c5158Smillertlinking mechanisms available on many platforms.  Its primary purpose is
268b39c5158Smillertto implement cheap automatic dynamic loading of Perl modules.
269b39c5158Smillert
270b39c5158SmillertFor a more complicated interface, see L<DynaLoader>.  Many (most)
271b39c5158Smillertfeatures of C<DynaLoader> are not implemented in C<XSLoader>, like for
272b39c5158Smillertexample the C<dl_load_flags>, not honored by C<XSLoader>.
273b39c5158Smillert
274b39c5158Smillert=head2 Migration from C<DynaLoader>
275b39c5158Smillert
276b39c5158SmillertA typical module using L<DynaLoader|DynaLoader> starts like this:
277b39c5158Smillert
278b39c5158Smillert    package YourPackage;
279b39c5158Smillert    require DynaLoader;
280b39c5158Smillert
281b39c5158Smillert    our @ISA = qw( OnePackage OtherPackage DynaLoader );
282b39c5158Smillert    our $VERSION = '0.01';
283*9f11ffb7Safresh1    __PACKAGE__->bootstrap($VERSION);
284b39c5158Smillert
285b39c5158SmillertChange this to
286b39c5158Smillert
287b39c5158Smillert    package YourPackage;
288b39c5158Smillert    use XSLoader;
289b39c5158Smillert
290b39c5158Smillert    our @ISA = qw( OnePackage OtherPackage );
291b39c5158Smillert    our $VERSION = '0.01';
292*9f11ffb7Safresh1    XSLoader::load(__PACKAGE__, $VERSION);
293b39c5158Smillert
294b39c5158SmillertIn other words: replace C<require DynaLoader> by C<use XSLoader>, remove
295b39c5158SmillertC<DynaLoader> from C<@ISA>, change C<bootstrap> by C<XSLoader::load>.  Do not
296b39c5158Smillertforget to quote the name of your package on the C<XSLoader::load> line,
297b39c5158Smillertand add comma (C<,>) before the arguments (C<$VERSION> above).
298b39c5158Smillert
299b39c5158SmillertOf course, if C<@ISA> contained only C<DynaLoader>, there is no need to have
300b39c5158Smillertthe C<@ISA> assignment at all; moreover, if instead of C<our> one uses the
301b39c5158Smillertmore backward-compatible
302b39c5158Smillert
303b39c5158Smillert    use vars qw($VERSION @ISA);
304b39c5158Smillert
305b39c5158Smillertone can remove this reference to C<@ISA> together with the C<@ISA> assignment.
306b39c5158Smillert
307b39c5158SmillertIf no C<$VERSION> was specified on the C<bootstrap> line, the last line becomes
308b39c5158Smillert
309*9f11ffb7Safresh1    XSLoader::load(__PACKAGE__);
310b39c5158Smillert
311*9f11ffb7Safresh1in which case it can be further simplified to
312898184e3Ssthen
313898184e3Ssthen    XSLoader::load();
314898184e3Ssthen
315898184e3Ssthenas C<load> will use C<caller> to determine the package.
316898184e3Ssthen
317b39c5158Smillert=head2 Backward compatible boilerplate
318b39c5158Smillert
319b39c5158SmillertIf you want to have your cake and eat it too, you need a more complicated
320b39c5158Smillertboilerplate.
321b39c5158Smillert
322b39c5158Smillert    package YourPackage;
323b39c5158Smillert
324*9f11ffb7Safresh1    our @ISA = qw( OnePackage OtherPackage );
325*9f11ffb7Safresh1    our $VERSION = '0.01';
326b39c5158Smillert    eval {
327b39c5158Smillert       require XSLoader;
328*9f11ffb7Safresh1	XSLoader::load(__PACKAGE__, $VERSION);
329b39c5158Smillert       1;
330b39c5158Smillert    } or do {
331b39c5158Smillert       require DynaLoader;
332b39c5158Smillert       push @ISA, 'DynaLoader';
333*9f11ffb7Safresh1       __PACKAGE__->bootstrap($VERSION);
334b39c5158Smillert    };
335b39c5158Smillert
336b39c5158SmillertThe parentheses about C<XSLoader::load()> arguments are needed since we replaced
337b39c5158SmillertC<use XSLoader> by C<require>, so the compiler does not know that a function
338b39c5158SmillertC<XSLoader::load()> is present.
339b39c5158Smillert
340b39c5158SmillertThis boilerplate uses the low-overhead C<XSLoader> if present; if used with
34191f110e0Safresh1an antique Perl which has no C<XSLoader>, it falls back to using C<DynaLoader>.
342b39c5158Smillert
343b39c5158Smillert=head1 Order of initialization: early load()
344b39c5158Smillert
345b39c5158SmillertI<Skip this section if the XSUB functions are supposed to be called from other
346b39c5158Smillertmodules only; read it only if you call your XSUBs from the code in your module,
347b39c5158Smillertor have a C<BOOT:> section in your XS file (see L<perlxs/"The BOOT: Keyword">).
348b39c5158SmillertWhat is described here is equally applicable to the L<DynaLoader|DynaLoader>
349b39c5158Smillertinterface.>
350b39c5158Smillert
351b39c5158SmillertA sufficiently complicated module using XS would have both Perl code (defined
352b39c5158Smillertin F<YourPackage.pm>) and XS code (defined in F<YourPackage.xs>).  If this
353b39c5158SmillertPerl code makes calls into this XS code, and/or this XS code makes calls to
354b39c5158Smillertthe Perl code, one should be careful with the order of initialization.
355b39c5158Smillert
356898184e3SsthenThe call to C<XSLoader::load()> (or C<bootstrap()>) calls the module's
357898184e3Ssthenbootstrap code. For modules build by F<xsubpp> (nearly all modules) this
358898184e3Ssthenhas three side effects:
359b39c5158Smillert
360b39c5158Smillert=over
361b39c5158Smillert
362b39c5158Smillert=item *
363b39c5158Smillert
364898184e3SsthenA sanity check is done to ensure that the versions of the F<.pm> and the
365898184e3Ssthen(compiled) F<.xs> parts are compatible. If C<$VERSION> was specified, this
366898184e3Ssthenis used for the check. If not specified, it defaults to
367898184e3SsthenC<$XS_VERSION // $VERSION> (in the module's namespace)
368b39c5158Smillert
369b39c5158Smillert=item *
370b39c5158Smillert
371898184e3Ssthenthe XSUBs are made accessible from Perl
372b39c5158Smillert
373b39c5158Smillert=item *
374b39c5158Smillert
375b39c5158Smillertif a C<BOOT:> section was present in the F<.xs> file, the code there is called.
376b39c5158Smillert
377b39c5158Smillert=back
378b39c5158Smillert
379b39c5158SmillertConsequently, if the code in the F<.pm> file makes calls to these XSUBs, it is
380b39c5158Smillertconvenient to have XSUBs installed before the Perl code is defined; for
381b39c5158Smillertexample, this makes prototypes for XSUBs visible to this Perl code.
382b39c5158SmillertAlternatively, if the C<BOOT:> section makes calls to Perl functions (or
383b39c5158Smillertuses Perl variables) defined in the F<.pm> file, they must be defined prior to
384b39c5158Smillertthe call to C<XSLoader::load()> (or C<bootstrap()>).
385b39c5158Smillert
386b39c5158SmillertThe first situation being much more frequent, it makes sense to rewrite the
387b39c5158Smillertboilerplate as
388b39c5158Smillert
389b39c5158Smillert    package YourPackage;
390b39c5158Smillert    use XSLoader;
391*9f11ffb7Safresh1    our ($VERSION, @ISA);
392b39c5158Smillert
393b39c5158Smillert    BEGIN {
394b39c5158Smillert       @ISA = qw( OnePackage OtherPackage );
395b39c5158Smillert       $VERSION = '0.01';
396b39c5158Smillert
397b39c5158Smillert       # Put Perl code used in the BOOT: section here
398b39c5158Smillert
399*9f11ffb7Safresh1       XSLoader::load(__PACKAGE__, $VERSION);
400b39c5158Smillert    }
401b39c5158Smillert
402b39c5158Smillert    # Put Perl code making calls into XSUBs here
403b39c5158Smillert
404b39c5158Smillert=head2 The most hairy case
405b39c5158Smillert
406b39c5158SmillertIf the interdependence of your C<BOOT:> section and Perl code is
407b39c5158Smillertmore complicated than this (e.g., the C<BOOT:> section makes calls to Perl
408b39c5158Smillertfunctions which make calls to XSUBs with prototypes), get rid of the C<BOOT:>
409b39c5158Smillertsection altogether.  Replace it with a function C<onBOOT()>, and call it like
410b39c5158Smillertthis:
411b39c5158Smillert
412b39c5158Smillert    package YourPackage;
413b39c5158Smillert    use XSLoader;
414*9f11ffb7Safresh1    our ($VERSION, @ISA);
415b39c5158Smillert
416b39c5158Smillert    BEGIN {
417b39c5158Smillert       @ISA = qw( OnePackage OtherPackage );
418b39c5158Smillert       $VERSION = '0.01';
419*9f11ffb7Safresh1       XSLoader::load(__PACKAGE__, $VERSION);
420b39c5158Smillert    }
421b39c5158Smillert
422b39c5158Smillert    # Put Perl code used in onBOOT() function here; calls to XSUBs are
423b39c5158Smillert    # prototype-checked.
424b39c5158Smillert
425b39c5158Smillert    onBOOT;
426b39c5158Smillert
427b39c5158Smillert    # Put Perl initialization code assuming that XS is initialized here
428b39c5158Smillert
429b39c5158Smillert
430b39c5158Smillert=head1 DIAGNOSTICS
431b39c5158Smillert
432b39c5158Smillert=over
433b39c5158Smillert
434b39c5158Smillert=item C<Can't find '%s' symbol in %s>
435b39c5158Smillert
436b39c5158SmillertB<(F)> The bootstrap symbol could not be found in the extension module.
437b39c5158Smillert
438b39c5158Smillert=item C<Can't load '%s' for module %s: %s>
439b39c5158Smillert
440b39c5158SmillertB<(F)> The loading or initialisation of the extension module failed.
441b39c5158SmillertThe detailed error follows.
442b39c5158Smillert
443b39c5158Smillert=item C<Undefined symbols present after loading %s: %s>
444b39c5158Smillert
445b39c5158SmillertB<(W)> As the message says, some symbols stay undefined although the
446b39c5158Smillertextension module was correctly loaded and initialised. The list of undefined
447b39c5158Smillertsymbols follows.
448b39c5158Smillert
449b39c5158Smillert=back
450b39c5158Smillert
451b39c5158Smillert=head1 LIMITATIONS
452b39c5158Smillert
453b39c5158SmillertTo reduce the overhead as much as possible, only one possible location
454b39c5158Smillertis checked to find the extension DLL (this location is where C<make install>
455b39c5158Smillertwould put the DLL).  If not found, the search for the DLL is transparently
456b39c5158Smillertdelegated to C<DynaLoader>, which looks for the DLL along the C<@INC> list.
457b39c5158Smillert
458b39c5158SmillertIn particular, this is applicable to the structure of C<@INC> used for testing
459b39c5158Smillertnot-yet-installed extensions.  This means that running uninstalled extensions
460b39c5158Smillertmay have much more overhead than running the same extensions after
461b39c5158SmillertC<make install>.
462b39c5158Smillert
463b39c5158Smillert
464898184e3Ssthen=head1 KNOWN BUGS
465898184e3Ssthen
466898184e3SsthenThe new simpler way to call C<XSLoader::load()> with no arguments at all
467898184e3Ssthendoes not work on Perl 5.8.4 and 5.8.5.
468898184e3Ssthen
469898184e3Ssthen
470b39c5158Smillert=head1 BUGS
471b39c5158Smillert
472b39c5158SmillertPlease report any bugs or feature requests via the perlbug(1) utility.
473b39c5158Smillert
474b39c5158Smillert
475b39c5158Smillert=head1 SEE ALSO
476b39c5158Smillert
477b39c5158SmillertL<DynaLoader>
478b39c5158Smillert
479b39c5158Smillert
480b39c5158Smillert=head1 AUTHORS
481b39c5158Smillert
482b39c5158SmillertIlya Zakharevich originally extracted C<XSLoader> from C<DynaLoader>.
483b39c5158Smillert
484b39c5158SmillertCPAN version is currently maintained by SE<eacute>bastien Aperghis-Tramoni
485b39c5158SmillertE<lt>sebastien@aperghis.netE<gt>.
486b39c5158Smillert
487b39c5158SmillertPrevious maintainer was Michael G Schwern <schwern@pobox.com>.
488b39c5158Smillert
489b39c5158Smillert
490b39c5158Smillert=head1 COPYRIGHT & LICENSE
491b39c5158Smillert
492898184e3SsthenCopyright (C) 1990-2011 by Larry Wall and others.
493b39c5158Smillert
494b39c5158SmillertThis program is free software; you can redistribute it and/or modify
495b39c5158Smillertit under the same terms as Perl itself.
496b39c5158Smillert
497b39c5158Smillert=cut
498b39c5158SmillertEOT
499b39c5158Smillert
500b39c5158Smillertclose OUT or die $!;
501