X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=utils%2Fc2ph.PL;h=38b259f0db187aa81fdbc574a31b177eed18ea8a;hb=fcbfa962e80dc16f8db1afaeb5287e8a393d3942;hp=5f4523aa8449cd34091ce4290e043d4b6c79f584;hpb=5f05dabc4054964aa3b10f44f8468547f051cdf8;p=p5sagit%2Fp5-mst-13.2.git diff --git a/utils/c2ph.PL b/utils/c2ph.PL index 5f4523a..38b259f 100644 --- a/utils/c2ph.PL +++ b/utils/c2ph.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 @@ -12,10 +13,10 @@ use File::Basename qw(&basename &dirname); # 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. -chdir(dirname($0)); -($file = basename($0)) =~ s/\.PL$//; -$file =~ s/\.pl$// - if ($^O eq 'VMS' or $^O eq 'os2'); # "case-forgiving" +$origdir = cwd; +chdir dirname($0); +$file = basename($0, '.PL'); +$file .= '.com' if $^O eq 'VMS'; open OUT,">$file" or die "Can't create $file: $!"; @@ -1252,7 +1253,7 @@ main() { EOF for $type (@intrinsics) { - next if !type || $type eq 'void' || $type =~ /complex/; # sun stuff + next if !$type || $type eq 'void' || $type =~ /complex/; # sun stuff print <<"EOF"; printf(mask,sizeof($type), "$type"); EOF @@ -1399,3 +1400,4 @@ if (defined $Config{d_link}) { File::Copy::syscopy('c2ph', 'pstruct'); } exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':'; +chdir $origdir;