+
+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
$VERSION = $VERSION = "1.03"; # avoid typo warning
-require Config;
-
require AutoLoader;
*AUTOLOAD = \&AutoLoader::AUTOLOAD;
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>)
# 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
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;
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.
assistance from Tim Bunce, January 1996.
=cut
+EOT
+
+close OUT or die $!;
+
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)