From: Ilya Zakharevich Date: Tue, 16 Nov 1999 01:50:31 +0000 (-0500) Subject: applied suggested patch; removed $VERSION = $VERSION hack X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9426adcd48655815b65cea5a9f1eebbe7e23a9df;hp=34baa6c30415f54e9b8c2e622de1e229cf36d781;p=p5sagit%2Fp5-mst-13.2.git applied suggested patch; removed $VERSION = $VERSION hack (change#4043 fixed the need for that) Message-Id: <199911160650.BAA18874@monk.mps.ohio-state.edu> Subject: [PATCH 5.005_62] XSLoader.pm p4raw-link: @4043 on //depot/cfgperl: 09bef84370e90d727656ea11ba5ee8be80e361d3 p4raw-id: //depot/perl@4623 --- diff --git a/MANIFEST b/MANIFEST index 02e507a..919d178 100644 --- a/MANIFEST +++ b/MANIFEST @@ -231,6 +231,7 @@ ext/Devel/Peek/Peek.xs Data debugging tool, externals ext/DynaLoader/DynaLoader_pm.PL Dynamic Loader perl module ext/DynaLoader/Makefile.PL Dynamic Loader makefile writer ext/DynaLoader/README Dynamic Loader notes and intro +ext/DynaLoader/XSLoader_pm.PL Simple XS Loader perl module ext/DynaLoader/dl_aix.xs AIX implementation ext/DynaLoader/dl_beos.xs BeOS implementation ext/DynaLoader/dl_cygwin.xs Cygwin implementation diff --git a/ext/B/B.pm b/ext/B/B.pm index 6661eba..8c46479 100644 --- a/ext/B/B.pm +++ b/ext/B/B.pm @@ -6,9 +6,9 @@ # License or the Artistic License, as specified in the README file. # package B; -require DynaLoader; +use XSLoader (); require Exporter; -@ISA = qw(Exporter DynaLoader); +@ISA = qw(Exporter); @EXPORT_OK = qw(minus_c ppname class peekop cast_I32 cstring cchar hash threadsv_names main_root main_start main_cv svref_2object opnumber amagic_generation @@ -259,7 +259,7 @@ sub walksymtable { } } -bootstrap B; +XSLoader::load 'B'; 1; diff --git a/ext/ByteLoader/ByteLoader.pm b/ext/ByteLoader/ByteLoader.pm index 4687010..286d746 100644 --- a/ext/ByteLoader/ByteLoader.pm +++ b/ext/ByteLoader/ByteLoader.pm @@ -1,12 +1,10 @@ package ByteLoader; -require DynaLoader; - -@ISA = qw(DynaLoader); +use XSLoader (); $VERSION = 0.03; -bootstrap ByteLoader $VERSION; +XSLoader::load 'ByteLoader', $VERSION; # Preloaded methods go here. diff --git a/ext/DB_File/DB_File.pm b/ext/DB_File/DB_File.pm index 44bdad6..661a523 100644 --- a/ext/DB_File/DB_File.pm +++ b/ext/DB_File/DB_File.pm @@ -155,8 +155,8 @@ $DB_RECNO = new DB_File::RECNOINFO ; require Tie::Hash; require Exporter; use AutoLoader; -require DynaLoader; -@ISA = qw(Tie::Hash Exporter DynaLoader); +use XSLoader (); +@ISA = qw(Tie::Hash Exporter); @EXPORT = qw( $DB_BTREE $DB_HASH $DB_RECNO @@ -231,7 +231,7 @@ eval { # }; #} -bootstrap DB_File $VERSION; +XSLoader::load 'DB_File', $VERSION; # Preloaded methods go here. Autoload methods go after __END__, and are # processed by the autosplit program. diff --git a/ext/Data/Dumper/Dumper.pm b/ext/Data/Dumper/Dumper.pm index 44cc613..608879c 100644 --- a/ext/Data/Dumper/Dumper.pm +++ b/ext/Data/Dumper/Dumper.pm @@ -9,22 +9,22 @@ package Data::Dumper; -$VERSION = $VERSION = '2.101'; +$VERSION = '2.101'; #$| = 1; require 5.004_02; require Exporter; -require DynaLoader; +use XSLoader (); require overload; use Carp; -@ISA = qw(Exporter DynaLoader); +@ISA = qw(Exporter); @EXPORT = qw(Dumper); @EXPORT_OK = qw(DumperX); -bootstrap Data::Dumper; +XSLoader::load 'Data::Dumper'; # module vars and their defaults $Indent = 2 unless defined $Indent; diff --git a/ext/Devel/DProf/DProf.pm b/ext/Devel/DProf/DProf.pm index 4c43f4d..6896929 100644 --- a/ext/Devel/DProf/DProf.pm +++ b/ext/Devel/DProf/DProf.pm @@ -182,11 +182,11 @@ sub DB { # print "nonXS DBDB\n"; } -require DynaLoader; -@Devel::DProf::ISA = 'DynaLoader'; +use XSLoader (); + $Devel::DProf::VERSION = '19990108'; # this version not authorized by # Dean Roehrich. See "Changes" file. -bootstrap Devel::DProf $Devel::DProf::VERSION; +XSLoader::load 'Devel::DProf', $Devel::DProf::VERSION; 1; diff --git a/ext/Devel/Peek/Peek.pm b/ext/Devel/Peek/Peek.pm index 2e990b0..4b472ad 100644 --- a/ext/Devel/Peek/Peek.pm +++ b/ext/Devel/Peek/Peek.pm @@ -3,17 +3,17 @@ package Devel::Peek; -$VERSION = $VERSION = 0.95; +$VERSION = 0.95; require Exporter; -require DynaLoader; +use XSLoader (); -@ISA = qw(Exporter DynaLoader); +@ISA = qw(Exporter); @EXPORT = qw(Dump mstat DeadCode DumpArray DumpWithOP DumpProg); @EXPORT_OK = qw(SvREFCNT SvREFCNT_inc SvREFCNT_dec); %EXPORT_TAGS = ('ALL' => [@EXPORT, @EXPORT_OK]); -bootstrap Devel::Peek; +XSLoader::load 'Devel::Peek'; sub DumpWithOP ($;$) { local($Devel::Peek::dump_ops)=1; diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL index a02f5bf..5cc5aea 100644 --- a/ext/DynaLoader/DynaLoader_pm.PL +++ b/ext/DynaLoader/DynaLoader_pm.PL @@ -28,7 +28,7 @@ package DynaLoader; # # Tim.Bunce@ig.co.uk, August 1994 -$VERSION = $VERSION = "1.03"; # avoid typo warning +$VERSION = "1.03"; # avoid typo warning require AutoLoader; *AUTOLOAD = \&AutoLoader::AUTOLOAD; @@ -129,6 +129,14 @@ if ($dl_debug) { sub croak { require Carp; Carp::croak(@_) } +sub bootstrap_inherit { + my $module = $_[0]; + local *isa = *{"$module\::ISA"}; + local @isa = (@isa, 'DynaLoader'); + # Cannot goto due to delocalization. Will report errors on a wrong line? + bootstrap(@_); +} + # The bootstrap function cannot be autoloaded (without complications) # so we define it here: diff --git a/ext/DynaLoader/Makefile.PL b/ext/DynaLoader/Makefile.PL index 2141fde..fa01c35 100644 --- a/ext/DynaLoader/Makefile.PL +++ b/ext/DynaLoader/Makefile.PL @@ -8,8 +8,10 @@ WriteMakefile( SKIP => [qw(dynamic dynamic_lib dynamic_bs)], XSPROTOARG => '-noprototypes', # XXX remove later? VERSION_FROM => 'DynaLoader_pm.PL', - PL_FILES => {'DynaLoader_pm.PL'=>'DynaLoader.pm'}, - PM => {'DynaLoader.pm' => '$(INST_LIBDIR)/DynaLoader.pm'}, + PL_FILES => {'DynaLoader_pm.PL'=>'DynaLoader.pm', + 'XSLoader_pm.PL'=>'XSLoader.pm'}, + PM => {'DynaLoader.pm' => '$(INST_LIBDIR)/DynaLoader.pm', + 'XSLoader.pm' => '$(INST_LIBDIR)/XSLoader.pm'}, clean => {FILES => 'DynaLoader.c DynaLoader.xs DynaLoader.pm'}, ); diff --git a/ext/DynaLoader/dlutils.c b/ext/DynaLoader/dlutils.c index 377d6dd..664e331 100644 --- a/ext/DynaLoader/dlutils.c +++ b/ext/DynaLoader/dlutils.c @@ -30,7 +30,8 @@ dl_generic_private_init(pTHXo) /* called by dl_*.xs dl_private_init() */ { char *perl_dl_nonlazy; #ifdef DEBUGGING - dl_debug = SvIV(get_sv("DynaLoader::dl_debug", 0x04) ); + SV *sv = get_sv("DynaLoader::dl_debug", 0); + dl_debug = sv ? SvIV(sv) : 0; #endif if ( (perl_dl_nonlazy = getenv("PERL_DL_NONLAZY")) != NULL ) dl_nonlazy = atoi(perl_dl_nonlazy); diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm index 44bb0ae..1eb14e9 100644 --- a/ext/Fcntl/Fcntl.pm +++ b/ext/Fcntl/Fcntl.pm @@ -45,8 +45,8 @@ what constants are implemented in your system. use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD); require Exporter; -require DynaLoader; -@ISA = qw(Exporter DynaLoader); +use XSLoader (); +@ISA = qw(Exporter); $VERSION = "1.03"; # Items to export into callers namespace by default # (move infrequently used names to @EXPORT_OK below) @@ -161,6 +161,6 @@ sub AUTOLOAD { goto &$AUTOLOAD; } -bootstrap Fcntl $VERSION; +XSLoader::load 'Fcntl', $VERSION; 1; diff --git a/ext/File/Glob/Glob.pm b/ext/File/Glob/Glob.pm index bac9832..6b5ff84 100644 --- a/ext/File/Glob/Glob.pm +++ b/ext/File/Glob/Glob.pm @@ -6,10 +6,10 @@ use vars qw($VERSION @ISA @EXPORT_OK @EXPORT_FAIL %EXPORT_TAGS $AUTOLOAD $DEFAULT_FLAGS); require Exporter; -require DynaLoader; +use XSLoader (); require AutoLoader; -@ISA = qw(Exporter DynaLoader AutoLoader); +@ISA = qw(Exporter AutoLoader); @EXPORT_OK = qw( csh_glob @@ -91,7 +91,7 @@ sub AUTOLOAD { goto &$AUTOLOAD; } -bootstrap File::Glob $VERSION; +XSLoader::load 'File::Glob', $VERSION; # Preloaded methods go here. diff --git a/ext/GDBM_File/GDBM_File.pm b/ext/GDBM_File/GDBM_File.pm index 99ad60b..663a679 100644 --- a/ext/GDBM_File/GDBM_File.pm +++ b/ext/GDBM_File/GDBM_File.pm @@ -46,8 +46,8 @@ require Carp; require Tie::Hash; require Exporter; use AutoLoader; -require DynaLoader; -@ISA = qw(Tie::Hash Exporter DynaLoader); +use XSLoader (); +@ISA = qw(Tie::Hash Exporter); @EXPORT = qw( GDBM_CACHESIZE GDBM_FAST @@ -78,7 +78,7 @@ sub AUTOLOAD { goto &$AUTOLOAD; } -bootstrap GDBM_File $VERSION; +XSLoader::load 'GDBM_File', $VERSION; # Preloaded methods go here. Autoload methods go after __END__, and are # processed by the autosplit program. diff --git a/ext/IO/IO.pm b/ext/IO/IO.pm index b6ce216..0087530 100644 --- a/ext/IO/IO.pm +++ b/ext/IO/IO.pm @@ -2,15 +2,11 @@ package IO; -require DynaLoader; -require Exporter; +use XSLoader (); use Carp; -use vars qw(@ISA $VERSION @EXPORT); - -@ISA = qw(DynaLoader); $VERSION = "1.20"; -bootstrap IO $VERSION; +XSLoader::load 'IO', $VERSION; sub import { shift; diff --git a/ext/NDBM_File/NDBM_File.pm b/ext/NDBM_File/NDBM_File.pm index 8db59ee..578148c 100644 --- a/ext/NDBM_File/NDBM_File.pm +++ b/ext/NDBM_File/NDBM_File.pm @@ -8,13 +8,13 @@ BEGIN { use vars qw($VERSION @ISA); require Tie::Hash; -require DynaLoader; +use DynaLoader (); -@ISA = qw(Tie::Hash DynaLoader); +@ISA = qw(Tie::Hash); $VERSION = "1.03"; -bootstrap NDBM_File $VERSION; +XSLoader::load 'NDBM_File', $VERSION; 1; diff --git a/ext/ODBM_File/ODBM_File.pm b/ext/ODBM_File/ODBM_File.pm index 0af875d..6199443 100644 --- a/ext/ODBM_File/ODBM_File.pm +++ b/ext/ODBM_File/ODBM_File.pm @@ -4,13 +4,13 @@ use strict; use vars qw($VERSION @ISA); require Tie::Hash; -require DynaLoader; +use DynaLoader (); -@ISA = qw(Tie::Hash DynaLoader); +@ISA = qw(Tie::Hash); $VERSION = "1.02"; -bootstrap ODBM_File $VERSION; +XSLoader::load 'ODBM_File', $VERSION; 1; diff --git a/ext/Opcode/Opcode.pm b/ext/Opcode/Opcode.pm index ff3899f..3915b40 100644 --- a/ext/Opcode/Opcode.pm +++ b/ext/Opcode/Opcode.pm @@ -10,8 +10,8 @@ $XS_VERSION = "1.03"; use strict; use Carp; use Exporter (); -use DynaLoader (); -@ISA = qw(Exporter DynaLoader); +use XSLoader (); +@ISA = qw(Exporter); BEGIN { @EXPORT_OK = qw( @@ -28,7 +28,7 @@ sub opset_to_hex ($); sub opdump (;$); use subs @EXPORT_OK; -bootstrap Opcode $XS_VERSION; +XSLoader::load 'Opcode', $XS_VERSION; _init_optags(); diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm index d43b8ca..a38c74d 100644 --- a/ext/POSIX/POSIX.pm +++ b/ext/POSIX/POSIX.pm @@ -9,10 +9,10 @@ require Config; use Symbol; require Exporter; -require DynaLoader; -@ISA = qw(Exporter DynaLoader); +use XSLoader (); +@ISA = qw(Exporter); -$VERSION = $VERSION = "1.03" ; +$VERSION = "1.03" ; %EXPORT_TAGS = ( @@ -195,7 +195,7 @@ sub import { } -bootstrap POSIX $VERSION; +XSLoader::load 'POSIX', $VERSION; my $EINVAL = constant("EINVAL", 0); my $EAGAIN = constant("EAGAIN", 0); diff --git a/ext/SDBM_File/SDBM_File.pm b/ext/SDBM_File/SDBM_File.pm index 34c9717..1f3b400 100644 --- a/ext/SDBM_File/SDBM_File.pm +++ b/ext/SDBM_File/SDBM_File.pm @@ -4,13 +4,13 @@ use strict; use vars qw($VERSION @ISA); require Tie::Hash; -require DynaLoader; +use XSLoader (); -@ISA = qw(Tie::Hash DynaLoader); +@ISA = qw(Tie::Hash); $VERSION = "1.02" ; -bootstrap SDBM_File $VERSION; +XSLoader::load 'SDBM_File', $VERSION; 1; diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm index a0bb95d..1fa108f 100644 --- a/ext/Socket/Socket.pm +++ b/ext/Socket/Socket.pm @@ -162,8 +162,8 @@ have AF_UNIX in the right place. use Carp; require Exporter; -require DynaLoader; -@ISA = qw(Exporter DynaLoader); +use XSLoader (); +@ISA = qw(Exporter); @EXPORT = qw( inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in pack_sockaddr_un unpack_sockaddr_un @@ -333,6 +333,6 @@ sub AUTOLOAD { goto &$AUTOLOAD; } -bootstrap Socket $VERSION; +XSLoader::load 'Socket', $VERSION; 1; diff --git a/ext/Thread/Thread.pm b/ext/Thread/Thread.pm index 7956a79..f15883e 100644 --- a/ext/Thread/Thread.pm +++ b/ext/Thread/Thread.pm @@ -1,11 +1,11 @@ package Thread; require Exporter; -require DynaLoader; +use XSLoader (); use vars qw($VERSION @ISA @EXPORT); $VERSION = "1.0"; -@ISA = qw(Exporter DynaLoader); +@ISA = qw(Exporter); @EXPORT_OK = qw(yield cond_signal cond_broadcast cond_wait async); =head1 NAME @@ -204,6 +204,6 @@ sub eval { return eval { shift->join; }; } -bootstrap Thread; +XSLoader::load 'Thread'; 1; diff --git a/ext/attrs/attrs.pm b/ext/attrs/attrs.pm index cec5ea5..f744e36 100644 --- a/ext/attrs/attrs.pm +++ b/ext/attrs/attrs.pm @@ -1,9 +1,6 @@ package attrs; -require DynaLoader; -use vars '@ISA'; -@ISA = 'DynaLoader'; +use XSLoader (); -use vars qw($VERSION); $VERSION = "1.0"; =head1 NAME @@ -56,6 +53,6 @@ subroutine is entered. =cut -bootstrap attrs $VERSION; +XSLoader::load 'attrs', $VERSION; 1; diff --git a/ext/re/re.pm b/ext/re/re.pm index 842e39a..3f142d9 100644 --- a/ext/re/re.pm +++ b/ext/re/re.pm @@ -105,9 +105,8 @@ sub bits { foreach my $s (@_){ if ($s eq 'debug' or $s eq 'debugcolor') { setcolor() if $s eq 'debugcolor'; - require DynaLoader; - @ISA = ('DynaLoader'); - bootstrap re; + require XSLoader; + XSLoader::load('re'); install() if $on; uninstall() unless $on; next; diff --git a/lib/AutoLoader.pm b/lib/AutoLoader.pm index 8e15c1f..4bbcb33 100644 --- a/lib/AutoLoader.pm +++ b/lib/AutoLoader.pm @@ -11,7 +11,7 @@ BEGIN { @EXPORT_OK = @EXPORT_OK = qw(AUTOLOAD); $is_dosish = $^O eq 'dos' || $^O eq 'os2' || $^O eq 'MSWin32'; $is_vms = $^O eq 'VMS'; - $VERSION = $VERSION = '5.57'; + $VERSION = '5.57'; } AUTOLOAD { diff --git a/lib/FindBin.pm b/lib/FindBin.pm index 9e1c0a0..9d35f6f 100644 --- a/lib/FindBin.pm +++ b/lib/FindBin.pm @@ -82,7 +82,7 @@ use File::Spec; %EXPORT_TAGS = (ALL => [qw($Bin $Script $RealBin $RealScript $Dir $RealDir)]); @ISA = qw(Exporter); -$VERSION = $VERSION = "1.42"; +$VERSION = "1.42"; BEGIN { diff --git a/lib/Getopt/Std.pm b/lib/Getopt/Std.pm index 390bf14..e027bad 100644 --- a/lib/Getopt/Std.pm +++ b/lib/Getopt/Std.pm @@ -42,7 +42,7 @@ the argument or 1 if no argument is specified. @ISA = qw(Exporter); @EXPORT = qw(getopt getopts); -$VERSION = $VERSION = '1.01'; +$VERSION = '1.01'; # Process single-character switches with switch clustering. Pass one argument # which is a string containing all switches that take an argument. For each