diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/DynaLoader/DynaLoader.pm | 47 | ||||
-rw-r--r-- | ext/NDBM_File/hints/solaris.pl | 3 | ||||
-rw-r--r-- | ext/ODBM_File/Makefile.PL | 2 | ||||
-rw-r--r-- | ext/ODBM_File/hints/sco.pl | 4 | ||||
-rw-r--r-- | ext/ODBM_File/hints/solaris.pl | 3 | ||||
-rw-r--r-- | ext/ODBM_File/hints/svr4.pl | 4 |
6 files changed, 41 insertions, 22 deletions
diff --git a/ext/DynaLoader/DynaLoader.pm b/ext/DynaLoader/DynaLoader.pm index 82721d1936..00466c3f2a 100644 --- a/ext/DynaLoader/DynaLoader.pm +++ b/ext/DynaLoader/DynaLoader.pm @@ -9,25 +9,25 @@ dl_error(), dl_findfile(), dl_expandspec(), dl_load_file(), dl_find_symbol(), dl =head1 SYNOPSIS require DynaLoader; - push (@ISA, 'DynaLoader'); + @ISA = qw(... DynaLoader ...); =head1 DESCRIPTION -This specification defines a standard generic interface to the dynamic +This document defines a standard generic interface to the dynamic linking mechanisms available on many platforms. Its primary purpose is to implement automatic dynamic loading of Perl modules. +This document serves as both a specification for anyone wishing to +implement the DynaLoader for a new platform and as a guide for +anyone wishing to use the DynaLoader directly in an application. + The DynaLoader is designed to be a very simple high-level interface that is sufficiently general to cover the requirements of SunOS, HP-UX, NeXT, Linux, VMS and other platforms. -It is also hoped that the interface will cover the needs of OS/2, -NT etc and allow pseudo-dynamic linking (using C<ld -A> at runtime). - -This document serves as both a specification for anyone wishing to -implement the DynaLoader for a new platform and as a guide for -anyone wishing to use the DynaLoader directly in an application. +It is also hoped that the interface will cover the needs of OS/2, NT +etc and also allow pseudo-dynamic linking (using C<ld -A> at runtime). It must be stressed that the DynaLoader, by itself, is practically useless for accessing non-Perl libraries because it provides almost no @@ -153,8 +153,8 @@ prefix and suffix appropriate to the platform: "$name.o", "lib$name.*" and "$name". If any directories are included in @names they are searched before -@dl_library_path. Directories may be specified as B<-Ldir>. Any other names -are treated as filenames to be searched for. +@dl_library_path. Directories may be specified as B<-Ldir>. Any other +names are treated as filenames to be searched for. Using arguments of the form C<-Ldir> and C<-lname> is recommended. @@ -174,8 +174,8 @@ 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(0 function in F<DynaLoader.pm>). See F<DynaLoader.pm> for more -information. +dl_expandspec() function in F<DynaLoader.pm>. See F<DynaLoader.pm> for +more information. =item dl_load_file() @@ -232,7 +232,8 @@ Example Return a list of symbol names which remain undefined after load_file(). Returns C<()> if not known. Don't worry if your platform does not provide -a mechanism for this. Most do not need it and hence do not provide it. +a mechanism for this. Most do not need it and hence do not provide it, +they just return an empty list. =item dl_install_xsub() @@ -308,15 +309,15 @@ calls &{"${module}::bootstrap"} to bootstrap the module =head1 AUTHOR +Tim Bunce, 11 August 1994. + This interface is based on the work and comments of (in no particular order): Larry Wall, Robert Sanders, Dean Roehrich, Jeff Okamoto, Anno -Siegel, Thomas Neumann, Paul Marquess, Charles Bailey, and others. +Siegel, Thomas Neumann, Paul Marquess, Charles Bailey, myself and others. Larry Wall designed the elegant inherited bootstrap mechanism and implemented the first Perl 5 dynamic loader using it. -Tim Bunce, 11 August 1994. - =cut # @@ -328,8 +329,7 @@ Tim Bunce, 11 August 1994. # Quote from Tolkien sugested by Anno Siegel. # -# Read ext/DynaLoader/README and DynaLoader.doc for -# detailed information. +# Read ext/DynaLoader/README for detailed information. # # Tim.Bunce@ig.co.uk, August 1994 @@ -394,10 +394,13 @@ sub bootstrap { local($module) = $args[0]; local(@dirs, $file); - croak "Usage: DynaLoader::bootstrap(module)" - unless ($module); + confess "Usage: DynaLoader::bootstrap(module)" unless $module; - croak "Can't load module $module, dynamic loading not available in this perl" + # A common error on platforms which don't support dynamic loading. + # Since it's fatal and potentially confusing we give a detailed message. + croak("Can't load module $module, dynamic loading not available in this perl.\n". + " (You may need to build a new perl executable which either supports\n". + " dynamic loading or has the $module module statically linked into it.)\n") unless defined(&dl_load_file); print STDERR "DynaLoader::bootstrap($module)\n" if $dl_debug; @@ -496,9 +499,11 @@ sub dl_findfile { # Deal with directories first: # 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; } + # VMS: we may be using native VMS directry syntax instead of # Unix emulation, so check this as well if ($vms && /[:>\]]/ && -d $_){ push(@dirs, $_); next; } diff --git a/ext/NDBM_File/hints/solaris.pl b/ext/NDBM_File/hints/solaris.pl new file mode 100644 index 0000000000..8d2fe1289e --- /dev/null +++ b/ext/NDBM_File/hints/solaris.pl @@ -0,0 +1,3 @@ +# -lucb has been reported to be fatal for perl5 on Solaris. +# Thus we deliberately don't include it here. +$att{LIBS} = ["-L/usr/local/lib -lndbm", "-ldbm"]; diff --git a/ext/ODBM_File/Makefile.PL b/ext/ODBM_File/Makefile.PL index 7a80882863..10eef6faf4 100644 --- a/ext/ODBM_File/Makefile.PL +++ b/ext/ODBM_File/Makefile.PL @@ -1,2 +1,2 @@ use ExtUtils::MakeMaker; -WriteMakefile(LIBS => ["-ldbm.nfs", "-ldbm -lucb"]); +WriteMakefile(LIBS => ["-ldbm -lucb"]); diff --git a/ext/ODBM_File/hints/sco.pl b/ext/ODBM_File/hints/sco.pl new file mode 100644 index 0000000000..42a4d99171 --- /dev/null +++ b/ext/ODBM_File/hints/sco.pl @@ -0,0 +1,4 @@ +# Some versions of SCO contain a broken -ldbm library that is missing +# dbmclose. Some of those might have a fixed library installed as +# -ldbm.nfs. +$att{LIBS} = ['-ldbm.nfs', '-ldbm']; diff --git a/ext/ODBM_File/hints/solaris.pl b/ext/ODBM_File/hints/solaris.pl new file mode 100644 index 0000000000..0dd124021f --- /dev/null +++ b/ext/ODBM_File/hints/solaris.pl @@ -0,0 +1,3 @@ +# -lucb has been reported to be fatal for perl5 on Solaris. +# Thus we deliberately don't include it here. +$att{LIBS} = ['-ldbm']; diff --git a/ext/ODBM_File/hints/svr4.pl b/ext/ODBM_File/hints/svr4.pl new file mode 100644 index 0000000000..04d40e045a --- /dev/null +++ b/ext/ODBM_File/hints/svr4.pl @@ -0,0 +1,4 @@ +# Some SVR4 systems may need to link against routines in -lucb for +# odbm. Some may also need to link against -lc to pick up things like +# ecvt. +$att{LIBS} = ['-ldbm -lucb -lc']; |