From: Gurusamy Sarathy Date: Thu, 14 May 1998 05:51:19 +0000 (+0000) Subject: [win32] merge change#745 from maintbranch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=03c9e98c6c70e5eea837fb8c7958e5a8e04b9ad4;p=p5sagit%2Fp5-mst-13.2.git [win32] merge change#745 from maintbranch p4raw-link: @745 on //depot/maint-5.004/perl: a6633e7c0d38d0d4cb8b725c41c792bcb33df5a7 p4raw-id: //depot/win32/perl@931 --- diff --git a/MANIFEST b/MANIFEST index 483803e..082a2f3 100644 --- a/MANIFEST +++ b/MANIFEST @@ -169,7 +169,7 @@ ext/DB_File/DB_File.xs Berkeley DB extension external subroutines ext/DB_File/DB_File_BS Berkeley DB extension mkbootstrap fodder ext/DB_File/Makefile.PL Berkeley DB extension makefile writer ext/DB_File/typemap Berkeley DB extension interface types -ext/DynaLoader/DynaLoader.pm Dynamic Loader perl module +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/dl_aix.xs AIX implementation diff --git a/ext/DynaLoader/DynaLoader.pm b/ext/DynaLoader/DynaLoader.pm.PL similarity index 95% rename from ext/DynaLoader/DynaLoader.pm rename to ext/DynaLoader/DynaLoader.pm.PL index 712d575..4c41559 100644 --- a/ext/DynaLoader/DynaLoader.pm +++ b/ext/DynaLoader/DynaLoader.pm.PL @@ -1,3 +1,19 @@ + +use Config; + +sub to_string { + my ($value) = @_; + $value =~ s/\\/\\\\'/g; + $value =~ s/'/\\'/g; + return "'$value'"; +} + +unlink "DynaLoader.pm" if -f "DynaLoader.pm"; +open OUT, ">DynaLoader.pm" or die $!; +print OUT <<'EOT'; + +# Generated from DynaLoader.pm.PL (resolved %Config::Config values) + package DynaLoader; # And Gandalf said: 'Many folk like to know beforehand what is to @@ -14,8 +30,6 @@ package DynaLoader; $VERSION = $VERSION = "1.03"; # avoid typo warning -require Config; - require AutoLoader; *AUTOLOAD = \&AutoLoader::AUTOLOAD; @@ -43,10 +57,15 @@ $dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug; sub dl_load_flags { 0x00 } -# +# ($dl_dlext, $dlsrc) +# = @Config::Config{'dlext', 'dlsrc'}; +EOT + +print OUT " (\$dl_dlext, \$dlsrc) = (", + to_string($Config::Config{'dlext'}), ",", + to_string($Config::Config{'dlsrc'}), ")\n;" ; -($dl_dlext, $dlsrc) - = @Config::Config{'dlext', 'dlsrc'}; +print OUT <<'EOT'; # Some systems need special handling to expand file specifications # (VMS support by Charles Bailey ) @@ -65,7 +84,14 @@ $do_expand = $Is_VMS = $^O eq 'VMS'; # Initialise @dl_library_path with the 'standard' library path # for this platform as determined by Configure -push(@dl_library_path, split(' ',$Config::Config{'libpth'})); + +# push(@dl_library_path, split(' ', $Config::Config{'libpth'}); +EOT + +print OUT "push(\@dl_library_path, split(' ', ", + to_string($Config::Config{'libpth'}), "));\n"; + +print OUT <<'EOT'; # Add to @dl_library_path any extra directories we can gather from # environment variables. So far LD_LIBRARY_PATH is the only known @@ -205,8 +231,14 @@ sub dl_findfile { my (@args) = @_; my (@dirs, $dir); # which directories to search my (@found); # full paths to real files we have found - my $dl_ext= $Config::Config{'dlext'}; # suffix for perl extensions - my $dl_so = $Config::Config{'so'}; # suffix for shared libraries +EOT + +print OUT ' my $dl_ext= ' . to_string($Config::Config{'dlext'}) . + "; # \$Config::Config{'dlext'} suffix for perl extensions\n"; +print OUT ' my $dl_so = ' . to_string($Config::Config{'so'}) . + "; # \$Config::Config{'so'} suffix for shared libraries\n"; + +print OUT <<'EOT'; print STDERR "dl_findfile(@args)\n" if $dl_debug; @@ -350,7 +382,7 @@ etc and also allow pseudo-dynamic linking (using C at runtime). It must be stressed that the DynaLoader, by itself, is practically useless for accessing non-Perl libraries because it provides almost no Perl-to-C 'glue'. There is, for example, no mechanism for calling a C -library function or supplying arguments. A ExtUtils::DynaLib module +library function or supplying arguments. A C::DynaLib module is available from CPAN sites which performs that function for some common system types. @@ -691,3 +723,7 @@ Solaris global loading added by Nick Ing-Simmons with design/coding assistance from Tim Bunce, January 1996. =cut +EOT + +close OUT or die $!; + diff --git a/ext/DynaLoader/Makefile.PL b/ext/DynaLoader/Makefile.PL index 9323935..2c86abf 100644 --- a/ext/DynaLoader/Makefile.PL +++ b/ext/DynaLoader/Makefile.PL @@ -7,11 +7,12 @@ WriteMakefile( MAN3PODS => ' ', # Pods will be built by installman. SKIP => [qw(dynamic dynamic_lib dynamic_bs)], XSPROTOARG => '-noprototypes', # XXX remove later? - VERSION_FROM => 'DynaLoader.pm', - clean => {FILES => 'DynaLoader.c DynaLoader.xs'}, + VERSION_FROM => 'DynaLoader.pm.PL', + PL_FILES => {'DynaLoader.pm.PL'=>'DynaLoader.pm'}, + PM => {'DynaLoader.pm' => '$(INST_LIBDIR)/DynaLoader.pm'}, + clean => {FILES => 'DynaLoader.c DynaLoader.xs DynaLoader.pm'}, ); - sub MY::postamble { ' DynaLoader.xs: $(DLSRC)