summaryrefslogtreecommitdiff
path: root/pod/pod2text.PL
diff options
context:
space:
mode:
Diffstat (limited to 'pod/pod2text.PL')
-rw-r--r--pod/pod2text.PL8
1 files changed, 6 insertions, 2 deletions
diff --git a/pod/pod2text.PL b/pod/pod2text.PL
index a1a38751b8..94516c3997 100644
--- a/pod/pod2text.PL
+++ b/pod/pod2text.PL
@@ -2,6 +2,7 @@
use Config;
use File::Basename qw(&basename &dirname);
+use Cwd;
# List explicitly here the variables you want Configure to
# generate. Metaconfig only looks for shell variables, so you
@@ -10,11 +11,13 @@ use File::Basename qw(&basename &dirname);
# $startperl
# to ensure Configure will look for $Config{startperl}.
-$file = basename($0);
+# This forces PL files to create target in same directory as PL file.
+# This is so that make depend always knows where to find PL derivatives.
+$origdir = cwd;
+chdir dirname($0);
$file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-chdir("pod") or die "Can't chdir to pod: $!";
open OUT,">$file" or die "Can't create $file: $!";
print "Extracting $file (with variable substitutions)\n";
@@ -45,3 +48,4 @@ if(@ARGV) {
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
+chdir $origdir;