X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fpodselect.PL;h=3fa411846b2496e9f7e39280bb631df18c6c7d08;hb=43999f954454f106a60aa261bde57912dbef8b71;hp=7cff6915bbdc787a7a18b7054aae830602e02587;hpb=b233458bd1d5037ce4bbbb41fb513e1b68522a4d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/podselect.PL b/pod/podselect.PL index 7cff691..3fa4118 100644 --- a/pod/podselect.PL +++ b/pod/podselect.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,14 @@ use File::Basename qw(&basename &dirname); # $startperl # to ensure Configure will look for $Config{startperl}. -$file = basename($0); -$file =~ s/\.PL$//i; -$file .= '.com' if $^O eq 'VMS'; +# 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)) =~ s/\.PL$//; +$file =~ s/\.pl$// + if ($^O eq 'VMS' or $^O eq 'os2' or $^O eq 'dos'); # "case-forgiving" -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"; @@ -35,10 +39,7 @@ print OUT <<'!NO!SUBS!'; ############################################################################# # podselect -- command to invoke the podselect function in Pod::Select # -# Derived from Tom Christiansen's pod2text script. -# (with extensive modifications) -# -# Copyright (c) 1996 Bradford Appleton. All rights reserved. +# Copyright (c) 1996-1999 by Bradford Appleton. All rights reserved. # This file is part of "PodParser". PodParser is free software; # you can redistribute it and/or modify it under the same terms # as Perl itself. @@ -138,3 +139,4 @@ else { 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;