summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-05-14 05:51:19 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-05-14 05:51:19 +0000
commit03c9e98c6c70e5eea837fb8c7958e5a8e04b9ad4 (patch)
tree0f0b9bdcfcb104a247fc847f147295bb22091c97
parent8bf3b0160d4c1eb438fae06bde281bc41041cd88 (diff)
downloadperl-03c9e98c6c70e5eea837fb8c7958e5a8e04b9ad4.tar.gz
[win32] merge change#745 from maintbranch
p4raw-link: @745 on //depot/maint-5.004/perl: a6633e7c0d38d0d4cb8b725c41c792bcb33df5a7 p4raw-id: //depot/win32/perl@931
-rw-r--r--MANIFEST2
-rw-r--r--ext/DynaLoader/DynaLoader.pm.PL (renamed from ext/DynaLoader/DynaLoader.pm)54
-rw-r--r--ext/DynaLoader/Makefile.PL7
3 files changed, 50 insertions, 13 deletions
diff --git a/MANIFEST b/MANIFEST
index 483803e02e..082a2f3828 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
index 712d575e38..4c4155985d 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 <bailey@HMIVAX.HUMGEN.UPENN.EDU>)
@@ -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<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
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 9323935880..2c86abfc41 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)