lib/ExtUtils/MM_VMS.pm

filter: Statementstmt 3.0% 25 / 815 Branchbran 0.2% 1 / 456 Conditioncond 0.0% 0 / 148 MC/DCmcdc 0.0% 0 / 87 Subroutinesub 8.7% 6 / 69 Podpod 98.2% 56 / 57 totaltotal 5.3% 88 / 1632 CC 324 SCAR 60.1
CC
324
Cov
2%
find_perl
1122.0
cflags
1122.0
makeaperl
1056.0
CRAP 406.1
« blib/lib/ExtUtils/MakeMaker/Locale.pm ↑ Summary lib/ExtUtils/MakeMaker/Locale.pm »
1 package ExtUtils::MM_VMS;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 4 ▶use ExtUtils::MakeMaker::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 require Exporter;
7  
8 BEGIN {
9 # so we can compile the thing on non-VMS platforms.
10 4 ▶ if( $^O eq 'VMS' ) {
Subroutine BEGIN: called CC=2 SCAR=10.5
Branch: 1 branch
BranchTrueFalseTotal
if ($^O eq "VMS") 0 4 4
11 0 require VMS::Filespec;
12 0 VMS::Filespec->import;
13 }
14 }
15  
16 4 ▶use File::Basename;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 4 our $VERSION = '7.13_01';
19 4 $VERSION = eval $VERSION;
20  
21 4 require ExtUtils::MM_Any;
22 4 require ExtUtils::MM_Unix;
23 4 our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
24  
25 4 ▶use ExtUtils::MakeMaker qw($Verbose neatvalue _sprintf562);
Subroutine BEGIN: called CC=1 SCAR=0.0
26 4 our $Revision = $ExtUtils::MakeMaker::Revision;
27  
28  
29 =head1 NAME
30  
31 ExtUtils::MM_VMS - methods to override UN*X behaviour in ExtUtils::MakeMaker
32  
33 =head1 SYNOPSIS
34  
35 Do not use this directly.
36 Instead, use ExtUtils::MM and it will figure out which MM_*
37 class to use for you.
38  
39 =head1 DESCRIPTION
40  
41 See ExtUtils::MM_Unix for a documentation of the methods provided
42 there. This package overrides the implementation of these methods, not
43 the semantics.
44  
45 =head2 Methods always loaded
46  
47 =over 4
48  
49 =item wraplist
50  
51 Converts a list into a string wrapped at approximately 80 columns.
52  
53 =cut
54  
55 sub wraplist {
56 0 ▶ my($self) = shift;
Subroutine wraplist: not called CC=5 SCAR=34.0
Pod documented
57 0 my($line,$hlen) = ('',0);
58  
59 0 foreach my $word (@_) {
60 # Perl bug -- seems to occasionally insert extra elements when
61 # traversing array (scalar(@array) doesn't show them, but
62 # foreach(@array) does) (5.00307)
63 0 ▶ next unless $word =~ /\w/;
Branch: 1 branch
BranchTrueFalseTotal
unless $word =~ /\w/ 0 0 0
64 0 ▶ $line .= ' ' if length($line);
Branch: 1 branch
BranchTrueFalseTotal
if length $line 0 0 0
65 0 ▶ if ($hlen > 80) { $line .= "\\\n\t"; $hlen = 0; }
Branch: 1 branch
BranchTrueFalseTotal
if ($hlen > 80) 0 0 0
66 0 $line .= $word;
67 0 $hlen += length($word) + 2;
68 }
69 0 $line;
70 }
71  
72  
73 # This isn't really an override. It's just here because ExtUtils::MM_VMS
74 # appears in @MM::ISA before ExtUtils::Liblist::Kid, so if there isn't an ext()
75 # in MM_VMS, then AUTOLOAD is called, and bad things happen. So, we just
76 # mimic inheritance here and hand off to ExtUtils::Liblist::Kid.
77 # XXX This hackery will die soon. --Schwern
78 sub ext {
79 0 ▶ require ExtUtils::Liblist::Kid;
Subroutine ext: not called CC=1 SCAR=6.9
Pod undocumented
80 0 goto &ExtUtils::Liblist::Kid::ext;
81 }
82  
83 =back
84  
85 =head2 Methods
86  
87 Those methods which override default MM_Unix methods are marked
88 "(override)", while methods unique to MM_VMS are marked "(specific)".
89 For overridden methods, documentation is limited to an explanation
90 of why this method overrides the MM_Unix method; see the ExtUtils::MM_Unix
91 documentation for more details.
92  
93 =over 4
94  
95 =item guess_name (override)
96  
97 Try to determine name of extension being built. We begin with the name
98 of the current directory. Since VMS filenames are case-insensitive,
99 however, we look for a F<.pm> file whose name matches that of the current
100 directory (presumably the 'main' F<.pm> file for this extension), and try
101 to find a C<package> statement from which to obtain the Mixed::Case
102 package name.
103  
104 =cut
105  
106 sub guess_name {
107 0 ▶ my($self) = @_;
Subroutine guess_name: not called CC=12 SCAR=50.5
Pod documented
108 0 my($defname,$defpm,@pm,%xs);
109 0 local *PM;
110  
111 0 $defname = basename(fileify($ENV{'DEFAULT'}));
112 0 $defname =~ s![\d\-_]*\.dir.*$!!; # Clip off .dir;1 suffix, and package version
113 0 $defpm = $defname;
114 # Fallback in case for some reason a user has copied the files for an
115 # extension into a working directory whose name doesn't reflect the
116 # extension's name. We'll use the name of a unique .pm file, or the
117 # first .pm file with a matching .xs file.
118 0 ▶ if (not -e "${defpm}.pm") {
Branch: 1 branch
BranchTrueFalseTotal
unless (-e "$defpm.pm") 0 0 0
119 0 @pm = glob('*.pm');
120 0 s/.pm$// for @pm;
121 0 ▶ if (@pm == 1) { ($defpm = $pm[0]) =~ s/.pm$//; }
Branch: 2 branches
BranchTrueFalseTotal
if (@pm == 1) { } 0 0 0
elsif (@pm) { } 0 0 0
122 elsif (@pm) {
123 0 %xs = map { s/.xs$//; ($_,1) } glob('*.xs'); ## no critic
124 0 ▶ if (keys %xs) {
Branch: 1 branch
BranchTrueFalseTotal
if (keys %xs) 0 0 0
125 0 foreach my $pm (@pm) {
126 0 ▶ $defpm = $pm, last if exists $xs{$pm};
Branch: 1 branch
BranchTrueFalseTotal
if exists $xs{$pm} 0 0 0
127 }
128 }
129 }
130 }
131 0 ▶ if (open(my $pm, '<', "${defpm}.pm")){
Branch: 1 branch
BranchTrueFalseTotal
if (open my $pm, '<', "$defpm.pm") { } 0 0 0
132 0 ▶ while (<$pm>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $pm)) 0 0 0
133 0 ▶ if (/^\s*package\s+([^;]+)/i) {
Branch: 1 branch
BranchTrueFalseTotal
if (/^\s*package\s+([^;]+)/i) 0 0 0
134 0 $defname = $1;
135 0 last;
136 }
137 }
138 0 ▶ print "Warning (non-fatal): Couldn't find package name in ${defpm}.pm;\n\t",
Branch: 1 branch
BranchTrueFalseTotal
if eof $pm 0 0 0
139 "defaulting package name to $defname\n"
140 if eof($pm);
141 0 close $pm;
142 }
143 else {
144 0 print "Warning (non-fatal): Couldn't find ${defpm}.pm;\n\t",
145 "defaulting package name to $defname\n";
146 }
147 0 $defname =~ s#[\d.\-_]+$##;
148 0 $defname;
149 }
150  
151 =item find_perl (override)
152  
153 Use VMS file specification syntax and CLI commands to find and
154 invoke Perl images.
155  
156 =cut
157  
158 sub find_perl {
159 0 ▶ my($self, $ver, $names, $dirs, $trace) = @_;
Subroutine find_perl: not called CC=33 SCAR=70.2
Pod documented
160 0 my($vmsfile,@sdirs,@snames,@cand);
161 0 my($rslt);
162 0 my($inabs) = 0;
163 0 local *TCF;
164  
165 0 ▶ if( $self->{PERL_CORE} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'PERL_CORE'}) { } 0 0 0
166 # Check in relative directories first, so we pick up the current
167 # version of Perl if we're running MakeMaker as part of the main build.
168 0 @sdirs = sort { my($absa) = $self->file_name_is_absolute($a);
169 0 my($absb) = $self->file_name_is_absolute($b);
170 0 ▶ if ($absa && $absb) { return $a cmp $b }
Branch: 1 branch
BranchTrueFalseTotal
if ($absa and $absb) { } 0 0 0
Condition0%0/3
$absa and $absb
!ll&&!rl&&r
000
MC/DC0%0/2
$absa and $absb
$absa $absb
Truth table0%0/3
A and B
A= $absaB= $absb
ABresult
0X0
100
111
171 0 ▶ else { return $absa ? 1 : ($absb ? -1 : ($a cmp $b)); }
Branch: 2 branches
BranchTrueFalseTotal
$absa ? : 0 0 0
$absb ? : 0 0 0
172 } @$dirs;
173 # Check miniperl before perl, and check names likely to contain
174 # version numbers before "generic" names, so we pick up an
175 # executable that's less likely to be from an old installation.
176 0 @snames = sort { my($ba) = $a =~ m!([^:>\]/]+)$!; # basename
177 0 my($bb) = $b =~ m!([^:>\]/]+)$!;
178 0 my($ahasdir) = (length($a) - length($ba) > 0);
179 0 my($bhasdir) = (length($b) - length($bb) > 0);
180 0 ▶ if ($ahasdir and not $bhasdir) { return 1; }
Branch: 2 branches
BranchTrueFalseTotal
if ($ahasdir and not $bhasdir) { } 0 0 0
elsif ($bhasdir and not $ahasdir) { } 0 0 0
Condition0%0/3
$ahasdir and not $bhasdir
!ll&&!rl&&r
000
MC/DC0%0/2
$ahasdir and not $bhasdir
$ahasdir not $bhasdir
Truth table0%0/3
A and not(B)
A= $ahasdirB= not $bhasdir
ABresult
0X0
100
111
181 0 ▶ elsif ($bhasdir and not $ahasdir) { return -1; }
Condition0%0/3
$bhasdir and not $ahasdir
!ll&&!rl&&r
000
MC/DC0%0/2
$bhasdir and not $ahasdir
$bhasdir not $ahasdir
Truth table0%0/3
A and not(B)
A= $bhasdirB= not $ahasdir
ABresult
0X0
100
111
182 0 ▶ else { $bb =~ /\d/ <=> $ba =~ /\d/
Branch: 1 branch
BranchTrueFalseTotal
$bb =~ /\d/ <=> $ba =~ /\d/ or substr($ba, 0, 1) cmp substr($bb, 0, 1) or length $bb <=> length $ba 0 0 0
Condition0%0/3
$bb =~ /\d/ <=> $ba =~ /\d/ or substr($ba, 0, 1) cmp substr($bb, 0, 1)
l!l&&r!l&&!r
000
MC/DC0%0/2
$bb =~ /\d/ <=> $ba =~ /\d/ or substr($ba, 0, 1) cmp substr($bb, 0, 1)
$bb =~ /\d/ <=> $ba =~ /\d/ substr($ba, 0, 1) cmp substr($bb, 0, 1)
Truth table0%0/3
A or B
A= $bb =~ /\d/ <=> $ba =~ /\d/B= substr($ba, 0, 1) cmp substr($bb, 0, 1)
ABresult
1X1
011
000
183 or substr($ba,0,1) cmp substr($bb,0,1)
184 or length($bb) <=> length($ba) } } @$names;
185 }
186 else {
187 0 @sdirs = @$dirs;
188 0 @snames = @$names;
189 }
190  
191 # Image names containing Perl version use '_' instead of '.' under VMS
192 0 s/\.(\d+)$/_$1/ for @snames;
193 0 ▶ if ($trace >= 2){
Branch: 1 branch
BranchTrueFalseTotal
if ($trace >= 2) 0 0 0
194 0 print "Looking for perl $ver by these names:\n";
195 0 print "\t@snames,\n";
196 0 print "in these dirs:\n";
197 0 print "\t@sdirs\n";
198 }
199 0 foreach my $dir (@sdirs){
200 0 ▶ next unless defined $dir; # $self->{PERL_SRC} may be undefined
Branch: 1 branch
BranchTrueFalseTotal
unless defined $dir 0 0 0
201 0 ▶ $inabs++ if $self->file_name_is_absolute($dir);
Branch: 1 branch
BranchTrueFalseTotal
if $self->file_name_is_absolute($dir) 0 0 0
202 0 ▶ if ($inabs == 1) {
Branch: 1 branch
BranchTrueFalseTotal
if ($inabs == 1) 0 0 0
203 # We've covered relative dirs; everything else is an absolute
204 # dir (probably an installed location). First, we'll try
205 # potential command names, to see whether we can avoid a long
206 # MCR expression.
207 0 foreach my $name (@snames) {
208 0 ▶ push(@cand,$name) if $name =~ /^[\w\-\$]+$/;
Branch: 1 branch
BranchTrueFalseTotal
if $name =~ /^[\w\-\$]+$/ 0 0 0
209 }
210 0 $inabs++; # Should happen above in next $dir, but just in case...
211 }
212 0 foreach my $name (@snames){
213 0 ▶ push @cand, ($name !~ m![/:>\]]!) ? $self->catfile($dir,$name)
Branch: 1 branch
BranchTrueFalseTotal
!($name =~ m([/:>\]])) ? : 0 0 0
214 : $self->fixpath($name,0);
215 }
216 }
217 0 foreach my $name (@cand) {
218 0 ▶ print "Checking $name\n" if $trace >= 2;
Branch: 1 branch
BranchTrueFalseTotal
if $trace >= 2 0 0 0
219 # If it looks like a potential command, try it without the MCR
220 0 ▶ if ($name =~ /^[\w\-\$]+$/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name =~ /^[\w\-\$]+$/) 0 0 0
221 0 ▶ open(my $tcf, ">", "temp_mmvms.com")
Branch: 1 branch
BranchTrueFalseTotal
open my $tcf, ">", "temp_mmvms.com" or die "unable to open temp file" 0 0 0
222 or die('unable to open temp file');
223 0 print $tcf "\$ set message/nofacil/nosever/noident/notext\n";
224 0 print $tcf "\$ $name -e \"require $ver; print \"\"VER_OK\\n\"\"\"\n";
225 0 close $tcf;
226 0 $rslt = `\@temp_mmvms.com` ;
227 0 unlink('temp_mmvms.com');
228 0 ▶ if ($rslt =~ /VER_OK/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($rslt =~ /VER_OK/) 0 0 0
229 0 ▶ print "Using PERL=$name\n" if $trace;
Branch: 1 branch
BranchTrueFalseTotal
if $trace 0 0 0
230 0 return $name;
231 }
232 }
233 0 ▶ next unless $vmsfile = $self->maybe_command($name);
Branch: 1 branch
BranchTrueFalseTotal
unless $vmsfile = $self->maybe_command($name) 0 0 0
234 0 $vmsfile =~ s/;[\d\-]*$//; # Clip off version number; we can use a newer version as well
235 0 ▶ print "Executing $vmsfile\n" if ($trace >= 2);
Branch: 1 branch
BranchTrueFalseTotal
if $trace >= 2 0 0 0
236 0 ▶ open(my $tcf, '>', "temp_mmvms.com")
Branch: 1 branch
BranchTrueFalseTotal
open my $tcf, ">", "temp_mmvms.com" or die "unable to open temp file" 0 0 0
237 or die('unable to open temp file');
238 0 print $tcf "\$ set message/nofacil/nosever/noident/notext\n";
239 0 print $tcf "\$ mcr $vmsfile -e \"require $ver; print \"\"VER_OK\\n\"\"\" \n";
240 0 close $tcf;
241 0 $rslt = `\@temp_mmvms.com`;
242 0 unlink('temp_mmvms.com');
243 0 ▶ if ($rslt =~ /VER_OK/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($rslt =~ /VER_OK/) 0 0 0
244 0 ▶ print "Using PERL=MCR $vmsfile\n" if $trace;
Branch: 1 branch
BranchTrueFalseTotal
if $trace 0 0 0
245 0 return "MCR $vmsfile";
246 }
247 }
248 0 print "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
249 0 0; # false and not empty
250 }
251  
252 =item _fixin_replace_shebang (override)
253  
254 Helper routine for MM->fixin(), overridden because there's no such thing as an
255 actual shebang line that will be interpreted by the shell, so we just prepend
256 $Config{startperl} and preserve the shebang line argument for any switches it
257 may contain.
258  
259 =cut
260  
261 sub _fixin_replace_shebang {
262 0 ▶ my ( $self, $file, $line ) = @_;
Subroutine _fixin_replace_shebang: not called CC=1 SCAR=6.9
263  
264 0 my ( undef, $arg ) = split ' ', $line, 2;
265  
266 0 return $Config{startperl} . "\n" . $Config{sharpbang} . "perl $arg\n";
267 }
268  
269 =item maybe_command (override)
270  
271 Follows VMS naming conventions for executable files.
272 If the name passed in doesn't exactly match an executable file,
273 appends F<.Exe> (or equivalent) to check for executable image, and F<.Com>
274 to check for DCL procedure. If this fails, checks directories in DCL$PATH
275 and finally F<Sys$System:> for an executable file having the name specified,
276 with or without the F<.Exe>-equivalent suffix.
277  
278 =cut
279  
280 sub maybe_command {
281 0 ▶ my($self,$file) = @_;
Subroutine maybe_command: not called CC=10 SCAR=47.0
Pod documented
282 0 ▶ return $file if -x $file && ! -d _;
Branch: 1 branch
BranchTrueFalseTotal
if -x $file and not -d _ 0 0 0
Condition0%0/3
-x $file and not -d _
!ll&&!rl&&r
000
MC/DC0%0/2
-x $file and not -d _
-x $file not -d _
Truth table0%0/3
A and not(B)
A= -x $fileB= not -d _
ABresult
0X0
100
111
283 0 my(@dirs) = ('');
284 0 my(@exts) = ('',$Config{'exe_ext'},'.exe','.com');
285  
286 0 ▶ if ($file !~ m![/:>\]]!) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($file =~ m([/:>\]])) 0 0 0
287 0 ▶ for (my $i = 0; defined $ENV{"DCL\$PATH;$i"}; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ENV{"DCL\$PATH;$i"}) 0 0 0
288 0 my $dir = $ENV{"DCL\$PATH;$i"};
289 0 ▶ $dir .= ':' unless $dir =~ m%[\]:]$%;
Branch: 1 branch
BranchTrueFalseTotal
unless $dir =~ /[\]:]$/ 0 0 0
290 0 push(@dirs,$dir);
291 }
292 0 push(@dirs,'Sys$System:');
293 0 foreach my $dir (@dirs) {
294 0 my $sysfile = "$dir$file";
295 0 foreach my $ext (@exts) {
296 0 ▶ return $file if -x "$sysfile$ext" && ! -d _;
Branch: 1 branch
BranchTrueFalseTotal
if -x "$sysfile$ext" and not -d _ 0 0 0
Condition0%0/3
-x "$sysfile$ext" and not -d _
!ll&&!rl&&r
000
MC/DC0%0/2
-x "$sysfile$ext" and not -d _
-x "$sysfile$ext" not -d _
Truth table0%0/3
A and not(B)
A= -x "$sysfile$ext"B= not -d _
ABresult
0X0
100
111
297 }
298 }
299 }
300 0 return 0;
301 }
302  
303  
304 =item pasthru (override)
305  
306 The list of macro definitions to be passed through must be specified using
307 the /MACRO qualifier and must not add another /DEFINE qualifier. We prepend
308 our own comma here to the contents of $(PASTHRU_DEFINE) because it is often
309 empty and a comma always present in CCFLAGS would generate a missing
310 qualifier value error.
311  
312 =cut
313  
314 sub pasthru {
315 0 ▶ my($self) = shift;
Subroutine pasthru: not called CC=1 SCAR=6.9
Pod documented
316 0 my $pasthru = $self->SUPER::pasthru;
317 0 $pasthru =~ s|(PASTHRU\s*=\s*)|$1/MACRO=(|;
318 0 $pasthru =~ s|\n\z|)\n|m;
319 0 $pasthru =~ s|/defi?n?e?=\(?([^\),]+)\)?|,$1|ig;
320  
321 0 return $pasthru;
322 }
323  
324  
325 =item pm_to_blib (override)
326  
327 VMS wants a dot in every file so we can't have one called 'pm_to_blib',
328 it becomes 'pm_to_blib.' and MMS/K isn't smart enough to know that when
329 you have a target called 'pm_to_blib' it should look for 'pm_to_blib.'.
330  
331 So in VMS its pm_to_blib.ts.
332  
333 =cut
334  
335 sub pm_to_blib {
336 0 ▶ my $self = shift;
Subroutine pm_to_blib: not called CC=1 SCAR=6.9
Pod documented
337  
338 0 my $make = $self->SUPER::pm_to_blib;
339  
340 0 $make =~ s{^pm_to_blib :}{pm_to_blib.ts :}m;
341 0 $make =~ s{\$\(TOUCH\) pm_to_blib}{\$(TOUCH) pm_to_blib.ts};
342  
343 0 $make = <<'MAKE' . $make;
344 # Dummy target to match Unix target name; we use pm_to_blib.ts as
345 # timestamp file to avoid repeated invocations under VMS
346 pm_to_blib : pm_to_blib.ts
347 $(NOECHO) $(NOOP)
348  
349 MAKE
350  
351 0 return $make;
352 }
353  
354  
355 =item perl_script (override)
356  
357 If name passed in doesn't specify a readable file, appends F<.com> or
358 F<.pl> and tries again, since it's customary to have file types on all files
359 under VMS.
360  
361 =cut
362  
363 sub perl_script {
364 0 ▶ my($self,$file) = @_;
Subroutine perl_script: not called CC=5 SCAR=34.0
Pod documented
365 0 ▶ return $file if -r $file && ! -d _;
Branch: 1 branch
BranchTrueFalseTotal
if -r $file and not -d _ 0 0 0
Condition0%0/3
-r $file and not -d _
!ll&&!rl&&r
000
MC/DC0%0/2
-r $file and not -d _
-r $file not -d _
Truth table0%0/3
A and not(B)
A= -r $fileB= not -d _
ABresult
0X0
100
111
366 0 ▶ return "$file.com" if -r "$file.com";
Branch: 1 branch
BranchTrueFalseTotal
if -r "$file.com" 0 0 0
367 0 ▶ return "$file.pl" if -r "$file.pl";
Branch: 1 branch
BranchTrueFalseTotal
if -r "$file.pl" 0 0 0
368 0 return '';
369 }
370  
371  
372 =item replace_manpage_separator
373  
374 Use as separator a character which is legal in a VMS-syntax file name.
375  
376 =cut
377  
378 sub replace_manpage_separator {
379 0 ▶ my($self,$man) = @_;
Subroutine replace_manpage_separator: not called CC=1 SCAR=6.9
Pod documented
380 0 $man = unixify($man);
381 0 $man =~ s#/+#__#g;
382 0 $man;
383 }
384  
385 =item init_DEST
386  
387 (override) Because of the difficulty concatenating VMS filepaths we
388 must pre-expand the DEST* variables.
389  
390 =cut
391  
392 sub init_DEST {
393 0 ▶ my $self = shift;
Subroutine init_DEST: not called CC=2 SCAR=17.9
Pod documented
394  
395 0 $self->SUPER::init_DEST;
396  
397 # Expand DEST variables.
398 0 foreach my $var ($self->installvars) {
399 0 my $destvar = 'DESTINSTALL'.$var;
400 0 $self->{$destvar} = $self->eliminate_macros($self->{$destvar});
401 }
402 }
403  
404  
405 =item init_DIRFILESEP
406  
407 No separator between a directory path and a filename on VMS.
408  
409 =cut
410  
411 sub init_DIRFILESEP {
412 0 ▶ my($self) = shift;
Subroutine init_DIRFILESEP: not called CC=1 SCAR=6.9
Pod documented
413  
414 0 $self->{DIRFILESEP} = '';
415 0 return 1;
416 }
417  
418  
419 =item init_main (override)
420  
421  
422 =cut
423  
424 sub init_main {
425 0 ▶ my($self) = shift;
Subroutine init_main: not called CC=10 SCAR=47.0
Pod documented
426  
427 0 $self->SUPER::init_main;
428  
429 0 ▶ $self->{DEFINE} ||= '';
Condition0%0/2
$self->{"DEFINE"} ||= ""
l!l
00
MC/DC0%0/1
$self->{"DEFINE"} ||= ""
$self->{"DEFINE"}
Truth table0%0/2
A
A= $self->{"DEFINE"}
Aresult
11
00
430 0 ▶ if ($self->{DEFINE} ne '') {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"DEFINE"} ne "") 0 0 0
431 0 my(@terms) = split(/\s+/,$self->{DEFINE});
432 0 my(@defs,@udefs);
433 0 foreach my $def (@terms) {
434 0 ▶ next unless $def;
Branch: 1 branch
BranchTrueFalseTotal
unless $def 0 0 0
435 0 my $targ = \@defs;
436 0 ▶ if ($def =~ s/^-([DU])//) { # If it was a Unix-style definition
Branch: 1 branch
BranchTrueFalseTotal
if ($def =~ s/^-([DU])//) 0 0 0
437 0 ▶ $targ = \@udefs if $1 eq 'U';
Branch: 1 branch
BranchTrueFalseTotal
if $1 eq "U" 0 0 0
438 0 $def =~ s/='(.*)'$/=$1/; # then remove shell-protection ''
439 0 $def =~ s/^'(.*)'$/$1/; # from entire term or argument
440 }
441 0 ▶ if ($def =~ /=/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($def =~ /=/) 0 0 0
442 0 $def =~ s/"/""/g; # Protect existing " from DCL
443 0 $def = qq["$def"]; # and quote to prevent parsing of =
444 }
445 0 push @$targ, $def;
446 }
447  
448 0 $self->{DEFINE} = '';
449 0 ▶ if (@defs) {
Branch: 1 branch
BranchTrueFalseTotal
if (@defs) 0 0 0
450 0 $self->{DEFINE} = '/Define=(' . join(',',@defs) . ')';
451 }
452 0 ▶ if (@udefs) {
Branch: 1 branch
BranchTrueFalseTotal
if (@udefs) 0 0 0
453 0 $self->{DEFINE} .= '/Undef=(' . join(',',@udefs) . ')';
454 }
455 }
456 }
457  
458 =item init_tools (override)
459  
460 Provide VMS-specific forms of various utility commands.
461  
462 Sets DEV_NULL to nothing because I don't know how to do it on VMS.
463  
464 Changes EQUALIZE_TIMESTAMP to set revision date of target file to
465 one second later than source file, since MMK interprets precisely
466 equal revision dates for a source and target file as a sign that the
467 target needs to be updated.
468  
469 =cut
470  
471 sub init_tools {
472 0 ▶ my($self) = @_;
Subroutine init_tools: not called CC=17 SCAR=57.2
Pod documented
473  
474 0 $self->{NOOP} = 'Continue';
475 0 ▶ $self->{NOECHO} ||= '@ ';
Condition0%0/2
$self->{"NOECHO"} ||= "\@ "
l!l
00
MC/DC0%0/1
$self->{"NOECHO"} ||= "\@ "
$self->{"NOECHO"}
Truth table0%0/2
A
A= $self->{"NOECHO"}
Aresult
11
00
476  
477 0 ▶ $self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE} || 'Descrip.MMS';
Condition0%0/5
$self->{"MAKEFILE"} ||= $self->{"FIRST_MAKEFILE"} || "Descrip.MMS"
l!l&&r!l&&!r
000
$self->{'FIRST_MAKEFILE'} || 'Descrip.MMS'
l!l
00
MC/DC0%0/2
$self->{"MAKEFILE"} ||= $self->{"FIRST_MAKEFILE"} || "Descrip.MMS"
$self->{"MAKEFILE"} $self->{'FIRST_MAKEFILE'}
Truth table0%0/3
A ||= B
A= $self->{"MAKEFILE"}B= $self->{'FIRST_MAKEFILE'}
ABresult
1X1
011
000
478 0 ▶ $self->{FIRST_MAKEFILE} ||= $self->{MAKEFILE};
Condition0%0/3
$self->{"FIRST_MAKEFILE"} ||= $self->{"MAKEFILE"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"FIRST_MAKEFILE"} ||= $self->{"MAKEFILE"}
$self->{"FIRST_MAKEFILE"} $self->{"MAKEFILE"}
Truth table0%0/3
A ||= B
A= $self->{"FIRST_MAKEFILE"}B= $self->{"MAKEFILE"}
ABresult
1X1
011
000
479 0 ▶ $self->{MAKE_APERL_FILE} ||= 'Makeaperl.MMS';
Condition0%0/2
$self->{"MAKE_APERL_FILE"} ||= "Makeaperl.MMS"
l!l
00
MC/DC0%0/1
$self->{"MAKE_APERL_FILE"} ||= "Makeaperl.MMS"
$self->{"MAKE_APERL_FILE"}
Truth table0%0/2
A
A= $self->{"MAKE_APERL_FILE"}
Aresult
11
00
480 0 ▶ $self->{MAKEFILE_OLD} ||= $self->eliminate_macros('$(FIRST_MAKEFILE)_old');
Condition0%0/3
$self->{"MAKEFILE_OLD"} ||= $self->eliminate_macros("\$(FIRST_MAKEFILE)_old")
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"MAKEFILE_OLD"} ||= $self->eliminate_macros("\$(FIRST_MAKEFILE)_old")
$self->{"MAKEFILE_OLD"} $self->eliminate_macros("\$(FIRST_MAKEFILE)_old")
Truth table0%0/3
A ||= B
A= $self->{"MAKEFILE_OLD"}B= $self->eliminate_macros("\$(FIRST_MAKEFILE)_old")
ABresult
1X1
011
000
481 #
482 # If an extension is not specified, then MMS/MMK assumes an
483 # an extension of .MMS. If there really is no extension,
484 # then a trailing "." needs to be appended to specify a
485 # a null extension.
486 #
487 0 ▶ $self->{MAKEFILE} .= '.' unless $self->{MAKEFILE} =~ m/\./;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"MAKEFILE"} =~ /\./ 0 0 0
488 0 ▶ $self->{FIRST_MAKEFILE} .= '.' unless $self->{FIRST_MAKEFILE} =~ m/\./;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"FIRST_MAKEFILE"} =~ /\./ 0 0 0
489 0 ▶ $self->{MAKE_APERL_FILE} .= '.' unless $self->{MAKE_APERL_FILE} =~ m/\./;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"MAKE_APERL_FILE"} =~ /\./ 0 0 0
490 0 ▶ $self->{MAKEFILE_OLD} .= '.' unless $self->{MAKEFILE_OLD} =~ m/\./;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"MAKEFILE_OLD"} =~ /\./ 0 0 0
491  
492 0 ▶ $self->{MACROSTART} ||= '/Macro=(';
Condition0%0/2
$self->{"MACROSTART"} ||= "/Macro=("
l!l
00
MC/DC0%0/1
$self->{"MACROSTART"} ||= "/Macro=("
$self->{"MACROSTART"}
Truth table0%0/2
A
A= $self->{"MACROSTART"}
Aresult
11
00
493 0 ▶ $self->{MACROEND} ||= ')';
Condition0%0/2
$self->{"MACROEND"} ||= ")"
l!l
00
MC/DC0%0/1
$self->{"MACROEND"} ||= ")"
$self->{"MACROEND"}
Truth table0%0/2
A
A= $self->{"MACROEND"}
Aresult
11
00
494 0 ▶ $self->{USEMAKEFILE} ||= '/Descrip=';
Condition0%0/2
$self->{"USEMAKEFILE"} ||= "/Descrip="
l!l
00
MC/DC0%0/1
$self->{"USEMAKEFILE"} ||= "/Descrip="
$self->{"USEMAKEFILE"}
Truth table0%0/2
A
A= $self->{"USEMAKEFILE"}
Aresult
11
00
495  
496 0 ▶ $self->{EQUALIZE_TIMESTAMP} ||= '$(ABSPERLRUN) -we "open F,qq{>>$ARGV[1]};close F;utime(0,(stat($ARGV[0]))[9]+1,$ARGV[1])"';
Condition0%0/2
$self->{"EQUALIZE_TIMESTAMP"} ||= "\$(ABSPERLRUN) -we \"open F,qq{>>\$ARGV[1]};close F;utime(0,(stat(\$ARGV[0]))[9]+1,\$ARGV[1])\""
l!l
00
MC/DC0%0/1
$self->{"EQUALIZE_TIMESTAMP"} ||= "\$(ABSPERLRUN) -we \"open F,qq{>>\$ARGV[1]};close F;utime(0,(stat(\$ARGV[0]))[9]+1,\$ARGV[1])\""
$self->{"EQUALIZE_TIMESTAMP"}
Truth table0%0/2
A
A= $self->{"EQUALIZE_TIMESTAMP"}
Aresult
11
00
497  
498 $self->{MOD_INSTALL} ||=
499 0 ▶ $self->oneliner(<<'CODE', ['-MExtUtils::Install']);
Condition0%0/3
$self->{"MOD_INSTALL"} ||= $self->oneliner("install([ from_to => {split('\\|', <STDIN>)}, verbose => '\$(VERBINST)', uninstall_shadows => '\$(UNINST)', dir_mode => '\$(PERM_DIR)' ]);\n", ["-MExtUtils::Install"])
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"MOD_INSTALL"} ||= $self->oneliner("install([ from_to => {split('\\|', <STDIN>)}, verbose => '\$(VERBINST)', uninstall_shadows => '\$(UNINST)', dir_mode => '\$(PERM_DIR)' ]);\n", ["-MExtUtils::Install"])
$self->{"MOD_INSTALL"} $self->oneliner("install([ from_to => {split('\\|', <STDIN>)}, verbose => '\$(VERBINST)', uninstall_shadows => '\$(UNINST)', dir_mode => '\$(PERM_DIR)' ]);\n", ["-MExtUtils::Install"])
Truth table0%0/3
A ||= B
A= $self->{"MOD_INSTALL"}B= $self->oneliner("install([ from_to => {split('\\|', <STDIN>)}, verbose => '\$(VERBINST)', uninstall_shadows => '\$(UNINST)', dir_mode => '\$(PERM_DIR)' ]);\n", ["-MExtUtils::Install"])
ABresult
1X1
011
000
500 install([ from_to => {split('\|', <STDIN>)}, verbose => '$(VERBINST)', uninstall_shadows => '$(UNINST)', dir_mode => '$(PERM_DIR)' ]);
501 CODE
502  
503 0 $self->{UMASK_NULL} = '! ';
504  
505 0 $self->SUPER::init_tools;
506  
507 # Use the default shell
508 0 ▶ $self->{SHELL} ||= 'Posix';
Condition0%0/2
$self->{"SHELL"} ||= "Posix"
l!l
00
MC/DC0%0/1
$self->{"SHELL"} ||= "Posix"
$self->{"SHELL"}
Truth table0%0/2
A
A= $self->{"SHELL"}
Aresult
11
00
509  
510 # Redirection on VMS goes before the command, not after as on Unix.
511 # $(DEV_NULL) is used once and its not worth going nuts over making
512 # it work. However, Unix's DEV_NULL is quite wrong for VMS.
513 0 $self->{DEV_NULL} = '';
514  
515 0 return;
516 }
517  
518 =item init_platform (override)
519  
520 Add PERL_VMS, MM_VMS_REVISION and MM_VMS_VERSION.
521  
522 MM_VMS_REVISION is for backwards compatibility before MM_VMS had a
523 $VERSION.
524  
525 =cut
526  
527 sub init_platform {
528 0 ▶ my($self) = shift;
Subroutine init_platform: not called CC=2 SCAR=17.9
Pod documented
529  
530 0 $self->{MM_VMS_REVISION} = $Revision;
531 0 $self->{MM_VMS_VERSION} = $VERSION;
532 $self->{PERL_VMS} = $self->catdir($self->{PERL_SRC}, 'VMS')
533 0 ▶ if $self->{PERL_SRC};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"PERL_SRC"} 0 0 0
534 }
535  
536  
537 =item platform_constants
538  
539 =cut
540  
541 sub platform_constants {
542 0 ▶ my($self) = shift;
Subroutine platform_constants: not called CC=3 SCAR=24.8
Pod documented
543 0 my $make_frag = '';
544  
545 0 foreach my $macro (qw(PERL_VMS MM_VMS_REVISION MM_VMS_VERSION))
546 {
547 0 ▶ next unless defined $self->{$macro};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{$macro} 0 0 0
548 0 $make_frag .= "$macro = $self->{$macro}\n";
549 }
550  
551 0 return $make_frag;
552 }
553  
554  
555 =item init_VERSION (override)
556  
557 Override the *DEFINE_VERSION macros with VMS semantics. Translate the
558 MAKEMAKER filepath to VMS style.
559  
560 =cut
561  
562 sub init_VERSION {
563 0 ▶ my $self = shift;
Subroutine init_VERSION: not called CC=1 SCAR=6.9
Pod documented
564  
565 0 $self->SUPER::init_VERSION;
566  
567 0 $self->{DEFINE_VERSION} = '"$(VERSION_MACRO)=""$(VERSION)"""';
568 0 $self->{XS_DEFINE_VERSION} = '"$(XS_VERSION_MACRO)=""$(XS_VERSION)"""';
569 0 $self->{MAKEMAKER} = vmsify($INC{'ExtUtils/MakeMaker.pm'});
570 }
571  
572  
573 =item constants (override)
574  
575 Fixes up numerous file and directory macros to insure VMS syntax
576 regardless of input syntax. Also makes lists of files
577 comma-separated.
578  
579 =cut
580  
581 sub constants {
582 0 ▶ my($self) = @_;
Subroutine constants: not called CC=21 SCAR=61.4
Pod documented
583  
584 # Be kind about case for pollution
585 0 ▶ for (@ARGV) { $_ = uc($_) if /POLLUTE/i; }
Branch: 1 branch
BranchTrueFalseTotal
if /POLLUTE/i 0 0 0
586  
587 # Cleanup paths for directories in MMS macros.
588 0 foreach my $macro ( qw [
589 INST_BIN INST_SCRIPT INST_LIB INST_ARCHLIB
590 PERL_LIB PERL_ARCHLIB
591 PERL_INC PERL_SRC ],
592 0 (map { 'INSTALL'.$_ } $self->installvars)
593 )
594 {
595 0 ▶ next unless defined $self->{$macro};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{$macro} 0 0 0
596 0 ▶ next if $macro =~ /MAN/ && $self->{$macro} eq 'none';
Branch: 1 branch
BranchTrueFalseTotal
if $macro =~ /MAN/ and $self->{$macro} eq "none" 0 0 0
Condition0%0/3
$macro =~ /MAN/ and $self->{$macro} eq "none"
!ll&&!rl&&r
000
MC/DC0%0/2
$macro =~ /MAN/ and $self->{$macro} eq "none"
$macro =~ /MAN/ $self->{$macro} eq "none"
Truth table0%0/3
A and B
A= $macro =~ /MAN/B= $self->{$macro} eq "none"
ABresult
0X0
100
111
597 0 $self->{$macro} = $self->fixpath($self->{$macro},1);
598 }
599  
600 # Cleanup paths for files in MMS macros.
601 0 foreach my $macro ( qw[LIBPERL_A FIRST_MAKEFILE MAKEFILE_OLD
602 MAKE_APERL_FILE MYEXTLIB] )
603 {
604 0 ▶ next unless defined $self->{$macro};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{$macro} 0 0 0
605 0 $self->{$macro} = $self->fixpath($self->{$macro},0);
606 }
607  
608 # Fixup files for MMS macros
609 # XXX is this list complete?
610 0 for my $macro (qw/
611 FULLEXT VERSION_FROM
612 / ) {
613 0 ▶ next unless defined $self->{$macro};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{$macro} 0 0 0
614 0 $self->{$macro} = $self->fixpath($self->{$macro},0);
615 }
616  
617  
618 0 for my $macro (qw/
619 OBJECT LDFROM
620 / ) {
621 0 ▶ next unless defined $self->{$macro};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{$macro} 0 0 0
622  
623 # Must expand macros before splitting on unescaped whitespace.
624 0 $self->{$macro} = $self->eliminate_macros($self->{$macro});
625 0 ▶ if ($self->{$macro} =~ /(?<!\^)\s/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{$macro} =~ /(?<!\^)\s/) { } 0 0 0
626 0 $self->{$macro} =~ s/(\\)?\n+\s+/ /g;
627 $self->{$macro} = $self->wraplist(
628 0 map $self->fixpath($_,0), split /,?(?<!\^)\s+/, $self->{$macro}
629 );
630 }
631 else {
632 0 $self->{$macro} = $self->fixpath($self->{$macro},0);
633 }
634 }
635  
636 0 for my $macro (qw/ XS MAN1PODS MAN3PODS PM /) {
637 # Where is the space coming from? --jhi
638 0 ▶ next unless $self ne " " && defined $self->{$macro};
Branch: 1 branch
BranchTrueFalseTotal
unless $self ne " " and defined $self->{$macro} 0 0 0
Condition0%0/3
$self ne " " and defined $self->{$macro}
!ll&&!rl&&r
000
MC/DC0%0/2
$self ne " " and defined $self->{$macro}
$self ne " " defined $self->{$macro}
Truth table0%0/3
A and B
A= $self ne " "B= defined $self->{$macro}
ABresult
0X0
100
111
639 0 my %tmp = ();
640 0 for my $key (keys %{$self->{$macro}}) {
641 $tmp{$self->fixpath($key,0)} =
642 0 $self->fixpath($self->{$macro}{$key},0);
643 }
644 0 $self->{$macro} = \%tmp;
645 }
646  
647 0 for my $macro (qw/ C O_FILES H /) {
648 0 ▶ next unless defined $self->{$macro};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{$macro} 0 0 0
649 0 my @tmp = ();
650 0 for my $val (@{$self->{$macro}}) {
651 0 push(@tmp,$self->fixpath($val,0));
652 }
653 0 $self->{$macro} = \@tmp;
654 }
655  
656 # mms/k does not define a $(MAKE) macro.
657 0 $self->{MAKE} = '$(MMS)$(MMSQUALIFIERS)';
658  
659 0 return $self->SUPER::constants;
660 }
661  
662  
663 =item special_targets
664  
665 Clear the default .SUFFIXES and put in our own list.
666  
667 =cut
668  
669 sub special_targets {
670 0 ▶ my $self = shift;
Subroutine special_targets: not called CC=1 SCAR=6.9
Pod documented
671  
672 0 my $make_frag .= <<'MAKE_FRAG';
673 .SUFFIXES :
674 .SUFFIXES : $(OBJ_EXT) .c .cpp .cxx .xs
675  
676 MAKE_FRAG
677  
678 0 return $make_frag;
679 }
680  
681 =item cflags (override)
682  
683 Bypass shell script and produce qualifiers for CC directly (but warn
684 user if a shell script for this extension exists). Fold multiple
685 /Defines into one, since some C compilers pay attention to only one
686 instance of this qualifier on the command line.
687  
688 =cut
689  
690 sub cflags {
691 0 ▶ my($self,$libperl) = @_;
Subroutine cflags: not called CC=33 SCAR=70.2
Pod documented
692 0 ▶ my($quals) = $self->{CCFLAGS} || $Config{'ccflags'};
Condition0%0/3
$self->{'CCFLAGS'} || $ExtUtils::MM_VMS::Config{'ccflags'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{'CCFLAGS'} || $ExtUtils::MM_VMS::Config{'ccflags'}
$self->{'CCFLAGS'} $ExtUtils::MM_VMS::Config{'ccflags'}
Truth table0%0/3
A || B
A= $self->{'CCFLAGS'}B= $ExtUtils::MM_VMS::Config{'ccflags'}
ABresult
1X1
011
000
693 0 my($definestr,$undefstr,$flagoptstr) = ('','','');
694 0 my($incstr) = '/Include=($(PERL_INC)';
695 0 my($name,$sys,@m);
696  
697 0 ( $name = $self->{NAME} . "_cflags" ) =~ s/:/_/g ;
698 print "Unix shell script ".$Config{"$self->{'BASEEXT'}_cflags"}.
699 " required to modify CC command for $self->{'BASEEXT'}\n"
700 0 ▶ if ($Config{$name});
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Config{$name} 0 0 0
701  
702 0 ▶ if ($quals =~ / -[DIUOg]/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($quals =~ / -[DIUOg]/) 0 0 0
703 0 ▶ while ($quals =~ / -([Og])(\d*)\b/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($quals =~ / -([Og])(\d*)\b/) 0 0 0
704 0 my($type,$lvl) = ($1,$2);
705 0 $quals =~ s/ -$type$lvl\b\s*//;
706 0 ▶ if ($type eq 'g') { $flagoptstr = '/NoOptimize'; }
Branch: 1 branch
BranchTrueFalseTotal
if ($type eq 'g') { } 0 0 0
707 0 ▶ else { $flagoptstr = '/Optimize' . (defined($lvl) ? "=$lvl" : ''); }
Branch: 1 branch
BranchTrueFalseTotal
defined $lvl ? : 0 0 0
708 }
709 0 ▶ while ($quals =~ / -([DIU])(\S+)/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($quals =~ / -([DIU])(\S+)/) 0 0 0
710 0 my($type,$def) = ($1,$2);
711 0 $quals =~ s/ -$type$def\s*//;
712 0 $def =~ s/"/""/g;
713 0 ▶ if ($type eq 'D') { $definestr .= qq["$def",]; }
Branch: 2 branches
BranchTrueFalseTotal
if ($type eq 'D') { } 0 0 0
elsif ($type eq 'I') { } 0 0 0
714 0 elsif ($type eq 'I') { $incstr .= ',' . $self->fixpath($def,1); }
715 0 else { $undefstr .= qq["$def",]; }
716 }
717 }
718 0 ▶ if (length $quals and $quals !~ m!/!) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $quals and not $quals =~ m[/]) 0 0 0
Condition0%0/3
length $quals and not $quals =~ m[/]
!ll&&!rl&&r
000
MC/DC0%0/2
length $quals and not $quals =~ m[/]
length $quals not $quals =~ m[/]
Truth table0%0/3
A and not(B)
A= length $qualsB= not $quals =~ m[/]
ABresult
0X0
100
111
719 0 warn "MM_VMS: Ignoring unrecognized CCFLAGS elements \"$quals\"\n";
720 0 $quals = '';
721 }
722 0 ▶ $definestr .= q["PERL_POLLUTE",] if $self->{POLLUTE};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"POLLUTE"} 0 0 0
723 0 ▶ if (length $definestr) { chop($definestr); $quals .= "/Define=($definestr)"; }
Branch: 1 branch
BranchTrueFalseTotal
if (length $definestr) 0 0 0
724 0 ▶ if (length $undefstr) { chop($undefstr); $quals .= "/Undef=($undefstr)"; }
Branch: 1 branch
BranchTrueFalseTotal
if (length $undefstr) 0 0 0
725 # Deal with $self->{DEFINE} here since some C compilers pay attention
726 # to only one /Define clause on command line, so we have to
727 # conflate the ones from $Config{'ccflags'} and $self->{DEFINE}
728 # ($self->{DEFINE} has already been VMSified in constants() above)
729 0 ▶ if ($self->{DEFINE}) { $quals .= $self->{DEFINE}; }
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"DEFINE"}) 0 0 0
730 0 for my $type (qw(Def Undef)) {
731 0 my(@terms);
732 0 ▶ while ($quals =~ m:/${type}i?n?e?=([^/]+):ig) {
Branch: 1 branch
BranchTrueFalseTotal
if ($quals =~ m[/${type}i?n?e?=([^/]+)]gi) 0 0 0
733 0 my $term = $1;
734 0 $term =~ s:^\((.+)\)$:$1:;
735 0 push @terms, $term;
736 }
737 0 ▶ if ($type eq 'Def') {
Branch: 1 branch
BranchTrueFalseTotal
if ($type eq "Def") 0 0 0
738 0 push @terms, qw[ $(DEFINE_VERSION) $(XS_DEFINE_VERSION) ];
739 }
740 0 ▶ if (@terms) {
Branch: 1 branch
BranchTrueFalseTotal
if (@terms) 0 0 0
741 0 $quals =~ s:/${type}i?n?e?=[^/]+::ig;
742 # PASTHRU_DEFINE will have its own comma
743 0 ▶ $quals .= "/${type}ine=(" . join(',',@terms) . ($type eq 'Def' ? '$(PASTHRU_DEFINE)' : '') . ')';
Branch: 1 branch
BranchTrueFalseTotal
$type eq 'Def' ? : 0 0 0
744 }
745 }
746  
747 0 ▶ $libperl or $libperl = $self->{LIBPERL_A} || "libperl.olb";
Branch: 1 branch
BranchTrueFalseTotal
$libperl or $libperl = $self->{"LIBPERL_A"} || "libperl.olb" 0 0 0
Condition0%0/2
$self->{'LIBPERL_A'} || 'libperl.olb'
l!l
00
MC/DC0%0/1
$self->{'LIBPERL_A'} || 'libperl.olb'
$self->{'LIBPERL_A'}
Truth table0%0/2
A
A= $self->{'LIBPERL_A'}
Aresult
11
00
748  
749 # Likewise with $self->{INC} and /Include
750 0 ▶ if ($self->{'INC'}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"INC"}) 0 0 0
751 0 my(@includes) = split(/\s+/,$self->{INC});
752 0 foreach (@includes) {
753 0 s/^-I//;
754 0 $incstr .= ','.$self->fixpath($_,1);
755 }
756 }
757 0 $quals .= "$incstr)";
758 # $quals =~ s/,,/,/g; $quals =~ s/\(,/(/g;
759 0 $self->{CCFLAGS} = $quals;
760  
761 0 ▶ $self->{PERLTYPE} ||= '';
Condition0%0/2
$self->{"PERLTYPE"} ||= ""
l!l
00
MC/DC0%0/1
$self->{"PERLTYPE"} ||= ""
$self->{"PERLTYPE"}
Truth table0%0/2
A
A= $self->{"PERLTYPE"}
Aresult
11
00
762  
763 0 ▶ $self->{OPTIMIZE} ||= $flagoptstr || $Config{'optimize'};
Condition0%0/6
$self->{"OPTIMIZE"} ||= $flagoptstr || $ExtUtils::MM_VMS::Config{"optimize"}
l!l&&r!l&&!r
000
$flagoptstr || $ExtUtils::MM_VMS::Config{'optimize'}
l!l&&r!l&&!r
000
MC/DC0%0/3
$self->{"OPTIMIZE"} ||= $flagoptstr || $ExtUtils::MM_VMS::Config{"optimize"}
$self->{"OPTIMIZE"} $flagoptstr $ExtUtils::MM_VMS::Config{'optimize'}
Truth table0%0/4
A ||= B || C
A= $self->{"OPTIMIZE"}B= $flagoptstrC= $ExtUtils::MM_VMS::Config{'optimize'}
ABCresult
1XX1
01X1
0011
0000
764 0 ▶ if ($self->{OPTIMIZE} !~ m!/!) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"OPTIMIZE"} =~ m[/]) 0 0 0
765 0 ▶ if ($self->{OPTIMIZE} =~ m!-g!) { $self->{OPTIMIZE} = '/Debug/NoOptimize' }
Branch: 2 branches
BranchTrueFalseTotal
if ($self->{'OPTIMIZE'} =~ /-g/) { } 0 0 0
elsif ($self->{'OPTIMIZE'} =~ /-O(\d*)/) { } 0 0 0
766 elsif ($self->{OPTIMIZE} =~ /-O(\d*)/) {
767 0 ▶ $self->{OPTIMIZE} = '/Optimize' . (defined($1) ? "=$1" : '');
Branch: 1 branch
BranchTrueFalseTotal
defined $1 ? : 0 0 0
768 }
769 else {
770 0 ▶ warn "MM_VMS: Can't parse OPTIMIZE \"$self->{OPTIMIZE}\"; using default\n" if length $self->{OPTIMIZE};
Branch: 1 branch
BranchTrueFalseTotal
if length $self->{"OPTIMIZE"} 0 0 0
771 0 $self->{OPTIMIZE} = '/Optimize';
772 }
773 }
774  
775 0 return $self->{CFLAGS} = qq{
776 CCFLAGS = $self->{CCFLAGS}
777 OPTIMIZE = $self->{OPTIMIZE}
778 PERLTYPE = $self->{PERLTYPE}
779 };
780 }
781  
782 =item const_cccmd (override)
783  
784 Adds directives to point C preprocessor to the right place when
785 handling #include E<lt>sys/foo.hE<gt> directives. Also constructs CC
786 command line a bit differently than MM_Unix method.
787  
788 =cut
789  
790 sub const_cccmd {
791 0 ▶ my($self,$libperl) = @_;
Subroutine const_cccmd: not called CC=6 SCAR=37.4
Pod documented
792 0 my(@m);
793  
794 0 ▶ return $self->{CONST_CCCMD} if $self->{CONST_CCCMD};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"CONST_CCCMD"} 0 0 0
795 0 ▶ return '' unless $self->needs_linking();
Branch: 1 branch
BranchTrueFalseTotal
unless $self->needs_linking 0 0 0
796 0 ▶ if ($Config{'vms_cc_type'} eq 'gcc') {
Branch: 2 branches
BranchTrueFalseTotal
if ($ExtUtils::MM_VMS::Config{'vms_cc_type'} eq 'gcc') { } 0 0 0
elsif ($ExtUtils::MM_VMS::Config{'vms_cc_type'} eq 'vaxc') { } 0 0 0
797 push @m,'
798 .FIRST
799 0 ',$self->{NOECHO},'If F$TrnLnm("Sys").eqs."" Then Define/NoLog SYS GNU_CC_Include:[VMS]';
800 }
801 elsif ($Config{'vms_cc_type'} eq 'vaxc') {
802 push @m,'
803 .FIRST
804 ',$self->{NOECHO},'If F$TrnLnm("Sys").eqs."" .and. F$TrnLnm("VAXC$Include").eqs."" Then Define/NoLog SYS Sys$Library
805 0 ',$self->{NOECHO},'If F$TrnLnm("Sys").eqs."" .and. F$TrnLnm("VAXC$Include").nes."" Then Define/NoLog SYS VAXC$Include';
806 }
807 else {
808 push @m,'
809 .FIRST
810 ',$self->{NOECHO},'If F$TrnLnm("Sys").eqs."" .and. F$TrnLnm("DECC$System_Include").eqs."" Then Define/NoLog SYS ',
811 ($Config{'archname'} eq 'VMS_AXP' ? 'Sys$Library' : 'DECC$Library_Include'),'
812 0 ▶ ',$self->{NOECHO},'If F$TrnLnm("Sys").eqs."" .and. F$TrnLnm("DECC$System_Include").nes."" Then Define/NoLog SYS DECC$System_Include';
Branch: 1 branch
BranchTrueFalseTotal
$ExtUtils::MM_VMS::Config{'archname'} eq 'VMS_AXP' ? : 0 0 0
813 }
814  
815 0 push(@m, "\n\nCCCMD = $Config{'cc'} \$(CCFLAGS)\$(OPTIMIZE)\n");
816  
817 0 $self->{CONST_CCCMD} = join('',@m);
818 }
819  
820  
821 =item tools_other (override)
822  
823 Throw in some dubious extra macros for Makefile args.
824  
825 Also keep around the old $(SAY) macro in case somebody's using it.
826  
827 =cut
828  
829 sub tools_other {
830 0 ▶ my($self) = @_;
Subroutine tools_other: not called CC=1 SCAR=6.9
Pod documented
831  
832 # XXX Are these necessary? Does anyone override them? They're longer
833 # than just typing the literal string.
834 0 my $extra_tools = <<'EXTRA_TOOLS';
835  
836 # Just in case anyone is using the old macro.
837 USEMACROS = $(MACROSTART)
838 SAY = $(ECHO)
839  
840 EXTRA_TOOLS
841  
842 0 return $self->SUPER::tools_other . $extra_tools;
843 }
844  
845 =item init_dist (override)
846  
847 VMSish defaults for some values.
848  
849 macro description default
850  
851 ZIPFLAGS flags to pass to ZIP -Vu
852  
853 COMPRESS compression command to gzip
854 use for tarfiles
855 SUFFIX suffix to put on -gz
856 compressed files
857  
858 SHAR shar command to use vms_share
859  
860 DIST_DEFAULT default target to use to tardist
861 create a distribution
862  
863 DISTVNAME Use VERSION_SYM instead of $(DISTNAME)-$(VERSION_SYM)
864 VERSION for the name
865  
866 =cut
867  
868 sub init_dist {
869 0 ▶ my($self) = @_;
Subroutine init_dist: not called CC=7 SCAR=40.3
Pod documented
870 0 ▶ $self->{ZIPFLAGS} ||= '-Vu';
Condition0%0/2
$self->{"ZIPFLAGS"} ||= "-Vu"
l!l
00
MC/DC0%0/1
$self->{"ZIPFLAGS"} ||= "-Vu"
$self->{"ZIPFLAGS"}
Truth table0%0/2
A
A= $self->{"ZIPFLAGS"}
Aresult
11
00
871 0 ▶ $self->{COMPRESS} ||= 'gzip';
Condition0%0/2
$self->{"COMPRESS"} ||= "gzip"
l!l
00
MC/DC0%0/1
$self->{"COMPRESS"} ||= "gzip"
$self->{"COMPRESS"}
Truth table0%0/2
A
A= $self->{"COMPRESS"}
Aresult
11
00
872 0 ▶ $self->{SUFFIX} ||= '-gz';
Condition0%0/2
$self->{"SUFFIX"} ||= "-gz"
l!l
00
MC/DC0%0/1
$self->{"SUFFIX"} ||= "-gz"
$self->{"SUFFIX"}
Truth table0%0/2
A
A= $self->{"SUFFIX"}
Aresult
11
00
873 0 ▶ $self->{SHAR} ||= 'vms_share';
Condition0%0/2
$self->{"SHAR"} ||= "vms_share"
l!l
00
MC/DC0%0/1
$self->{"SHAR"} ||= "vms_share"
$self->{"SHAR"}
Truth table0%0/2
A
A= $self->{"SHAR"}
Aresult
11
00
874 0 ▶ $self->{DIST_DEFAULT} ||= 'zipdist';
Condition0%0/2
$self->{"DIST_DEFAULT"} ||= "zipdist"
l!l
00
MC/DC0%0/1
$self->{"DIST_DEFAULT"} ||= "zipdist"
$self->{"DIST_DEFAULT"}
Truth table0%0/2
A
A= $self->{"DIST_DEFAULT"}
Aresult
11
00
875  
876 0 $self->SUPER::init_dist;
877  
878 $self->{DISTVNAME} = "$self->{DISTNAME}-$self->{VERSION_SYM}"
879 0 ▶ unless $self->{ARGS}{DISTVNAME};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"ARGS"}{"DISTVNAME"} 0 0 0
880  
881 0 return;
882 }
883  
884 =item c_o (override)
885  
886 Use VMS syntax on command line. In particular, $(DEFINE) and
887 $(PERL_INC) have been pulled into $(CCCMD). Also use MM[SK] macros.
888  
889 =cut
890  
891 sub c_o {
892 0 ▶ my($self) = @_;
Subroutine c_o: not called CC=2 SCAR=17.9
Pod documented
893 0 ▶ return '' unless $self->needs_linking();
Branch: 1 branch
BranchTrueFalseTotal
unless $self->needs_linking 0 0 0
894 0 '
895 .c$(OBJ_EXT) :
896 $(CCCMD) $(CCCDLFLAGS) $(MMS$TARGET_NAME).c /OBJECT=$(MMS$TARGET_NAME)$(OBJ_EXT)
897  
898 .cpp$(OBJ_EXT) :
899 $(CCCMD) $(CCCDLFLAGS) $(MMS$TARGET_NAME).cpp /OBJECT=$(MMS$TARGET_NAME)$(OBJ_EXT)
900  
901 .cxx$(OBJ_EXT) :
902 $(CCCMD) $(CCCDLFLAGS) $(MMS$TARGET_NAME).cxx /OBJECT=$(MMS$TARGET_NAME)$(OBJ_EXT)
903  
904 ';
905 }
906  
907 =item xs_c (override)
908  
909 Use MM[SK] macros.
910  
911 =cut
912  
913 sub xs_c {
914 0 ▶ my($self) = @_;
Subroutine xs_c: not called CC=2 SCAR=17.9
Pod documented
915 0 ▶ return '' unless $self->needs_linking();
Branch: 1 branch
BranchTrueFalseTotal
unless $self->needs_linking 0 0 0
916 0 '
917 .xs.c :
918 $(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $(MMS$TARGET_NAME).xs >$(MMS$TARGET_NAME).xsc
919 $(MV) $(MMS$TARGET_NAME).xsc $(MMS$TARGET_NAME).c
920 ';
921 }
922  
923 =item xs_o (override)
924  
925 Use MM[SK] macros, and VMS command line for C compiler.
926  
927 =cut
928  
929 sub xs_o {
930 0 ▶ my ($self) = @_;
Subroutine xs_o: not called CC=4 SCAR=30.0
Pod documented
931 0 ▶ return '' unless $self->needs_linking();
Branch: 1 branch
BranchTrueFalseTotal
unless $self->needs_linking 0 0 0
932 0 my $frag = '
933 .xs$(OBJ_EXT) :
934 $(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $(MMS$TARGET_NAME).xs >$(MMS$TARGET_NAME).xsc
935 $(MV) $(MMS$TARGET_NAME).xsc $(MMS$TARGET_NAME).c
936 $(CCCMD) $(CCCDLFLAGS) $(MMS$TARGET_NAME).c /OBJECT=$(MMS$TARGET_NAME)$(OBJ_EXT)
937 ';
938 0 ▶ if ($self->{XSMULTI}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"XSMULTI"}) 0 0 0
939 0 for my $ext ($self->_xs_list_basenames) {
940 0 my $version = $self->parse_version("$ext.pm");
941 0 my $ccflags = $self->{CCFLAGS};
942 0 $ccflags =~ s/\$\(DEFINE_VERSION\)/\"VERSION_MACRO=\\"\"$version\\"\"/;
943 0 $ccflags =~ s/\$\(XS_DEFINE_VERSION\)/\"XS_VERSION_MACRO=\\"\"$version\\"\"/;
944 0 $self->_xsbuild_replace_macro($ccflags, 'xs', $ext, 'INC');
945 0 $self->_xsbuild_replace_macro($ccflags, 'xs', $ext, 'DEFINE');
946  
947 0 $frag .= _sprintf562 <<'EOF', $ext, $ccflags;
948  
949 %1$s$(OBJ_EXT) : %1$s.xs
950 $(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $(MMS$TARGET_NAME).xs > $(MMS$TARGET_NAME).xsc
951 $(MV) $(MMS$TARGET_NAME).xsc $(MMS$TARGET_NAME).c
952 $(CC)%2$s$(OPTIMIZE) $(CCCDLFLAGS) $(MMS$TARGET_NAME).c /OBJECT=$(MMS$TARGET_NAME)$(OBJ_EXT)
953 EOF
954 }
955 }
956 0 $frag;
957 }
958  
959 =item _xsbuild_replace_macro (override)
960  
961 There is no simple replacement possible since a qualifier and all its
962 subqualifiers must be considered together, so we use our own utility
963 routine for the replacement.
964  
965 =cut
966  
967 sub _xsbuild_replace_macro {
968 0 ▶ my ($self, undef, $xstype, $ext, $varname) = @_;
Subroutine _xsbuild_replace_macro: not called CC=2 SCAR=17.9
969 0 my $value = $self->_xsbuild_value($xstype, $ext, $varname);
970 0 ▶ return unless defined $value;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $value 0 0 0
971 0 $_[1] = _vms_replace_qualifier($self, $_[1], $value, $varname);
972 }
973  
974 =item _xsbuild_value (override)
975  
976 Convert the extension spec to Unix format, as that's what will
977 match what's in the XSBUILD data structure.
978  
979 =cut
980  
981 sub _xsbuild_value {
982 0 ▶ my ($self, $xstype, $ext, $varname) = @_;
Subroutine _xsbuild_value: not called CC=1 SCAR=6.9
983 0 $ext = unixify($ext);
984 0 return $self->SUPER::_xsbuild_value($xstype, $ext, $varname);
985 }
986  
987 sub _vms_replace_qualifier {
988 0 ▶ my ($self, $flags, $newflag, $macro) = @_;
Subroutine _vms_replace_qualifier: not called CC=13 SCAR=52.0
989 0 my $qual_type;
990 my $type_suffix;
991 0 my $quote_subquals = 0;
992 0 my @subquals_new = split /\s+/, $newflag;
993  
994 0 ▶ if ($macro eq 'DEFINE') {
Branch: 2 branches
BranchTrueFalseTotal
if ($macro eq 'DEFINE') { } 0 0 0
elsif ($macro eq 'INC') { } 0 0 0
995 0 $qual_type = 'Def';
996 0 $type_suffix = 'ine';
997 0 map { $_ =~ s/^-D// } @subquals_new;
998 0 $quote_subquals = 1;
999 }
1000 elsif ($macro eq 'INC') {
1001 0 $qual_type = 'Inc';
1002 0 $type_suffix = 'lude';
1003 0 map { $_ =~ s/^-I//; $_ = $self->fixpath($_) } @subquals_new;
1004 }
1005  
1006 0 my @subquals = ();
1007 0 ▶ while ($flags =~ m:/${qual_type}\S{0,4}=([^/]+):ig) {
Branch: 1 branch
BranchTrueFalseTotal
if ($flags =~ m[/$qual_type\S{0,4}=([^/]+)]gi) 0 0 0
1008 0 my $term = $1;
1009 0 $term =~ s/\"//g;
1010 0 $term =~ s:^\((.+)\)$:$1:;
1011 0 push @subquals, split /,/, $term;
1012 }
1013 0 for my $new (@subquals_new) {
1014 0 my ($sq_new, $sqval_new) = split /=/, $new;
1015 0 my $replaced_old = 0;
1016 0 for my $old (@subquals) {
1017 0 my ($sq, $sqval) = split /=/, $old;
1018 0 ▶ if ($sq_new eq $sq) {
Branch: 1 branch
BranchTrueFalseTotal
if ($sq_new eq $sq) 0 0 0
1019 0 $old = $sq_new;
1020 0 ▶ $old .= '=' . $sqval_new if defined($sqval_new) and length($sqval_new);
Branch: 1 branch
BranchTrueFalseTotal
if defined $sqval_new and length $sqval_new 0 0 0
Condition0%0/3
defined $sqval_new and length $sqval_new
!ll&&!rl&&r
000
MC/DC0%0/2
defined $sqval_new and length $sqval_new
defined $sqval_new length $sqval_new
Truth table0%0/3
A and B
A= defined $sqval_newB= length $sqval_new
ABresult
0X0
100
111
1021 0 $replaced_old = 1;
1022 0 last;
1023 }
1024 }
1025 0 ▶ push @subquals, $new unless $replaced_old;
Branch: 1 branch
BranchTrueFalseTotal
unless $replaced_old 0 0 0
1026 }
1027  
1028 0 ▶ if (@subquals) {
Branch: 1 branch
BranchTrueFalseTotal
if (@subquals) 0 0 0
1029 0 $flags =~ s:/${qual_type}\S{0,4}=[^/]+::ig;
1030 # add quotes if requested but not for unexpanded macros
1031 0 ▶ map { $_ = qq/"$_"/ if $_ !~ m/^\$\(/ } @subquals if $quote_subquals;
Branch: 2 branches
BranchTrueFalseTotal
if $quote_subquals 0 0 0
if not $_ =~ /^\$\(/ 0 0 0
1032 0 $flags .= "/${qual_type}$type_suffix=(" . join(',',@subquals) . ')';
1033 }
1034  
1035 0 return $flags;
1036 }
1037  
1038  
1039 sub xs_dlsyms_ext {
1040 0 ▶ '.opt';
Subroutine xs_dlsyms_ext: not called CC=1 SCAR=6.9
Pod documented
1041 }
1042  
1043 =item dlsyms (override)
1044  
1045 Create VMS linker options files specifying universal symbols for this
1046 extension's shareable image(s), and listing other shareable images or
1047 libraries to which it should be linked.
1048  
1049 =cut
1050  
1051 sub dlsyms {
1052 0 ▶ my ($self, %attribs) = @_;
Subroutine dlsyms: not called CC=2 SCAR=17.9
Pod documented
1053 0 ▶ return '' unless $self->needs_linking;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->needs_linking 0 0 0
1054 0 $self->xs_dlsyms_iterator;
1055 }
1056  
1057 sub xs_make_dlsyms {
1058 0 ▶ my ($self, $attribs, $target, $dep, $name, $dlbase, $funcs, $funclist, $imports, $vars, $extra) = @_;
Subroutine xs_make_dlsyms: not called CC=21 SCAR=61.4
Pod documented
1059 0 my @m;
1060 my $instloc;
1061 0 ▶ if ($self->{XSMULTI}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'XSMULTI'}) { } 0 0 0
1062 0 my ($v, $d, $f) = File::Spec->splitpath($target);
1063 0 my @d = File::Spec->splitdir($d);
1064 0 ▶ shift @d if $d[0] eq 'lib';
Branch: 1 branch
BranchTrueFalseTotal
if $d[0] eq "lib" 0 0 0
1065 0 $instloc = $self->catfile('$(INST_ARCHLIB)', 'auto', @d, $f);
1066 push @m,"\ndynamic :: $instloc\n\t\$(NOECHO) \$(NOOP)\n"
1067 0 ▶ unless $self->{SKIPHASH}{'dynamic'};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"SKIPHASH"}{"dynamic"} 0 0 0
1068 push @m,"\nstatic :: $instloc\n\t\$(NOECHO) \$(NOOP)\n"
1069 0 ▶ unless $self->{SKIPHASH}{'static'};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"SKIPHASH"}{"static"} 0 0 0
1070 0 push @m, "\n", sprintf <<'EOF', $instloc, $target;
1071 %s : %s
1072 $(CP) $(MMS$SOURCE) $(MMS$TARGET)
1073 EOF
1074 }
1075 else {
1076 push @m,"\ndynamic :: \$(INST_ARCHAUTODIR)$self->{BASEEXT}.opt\n\t\$(NOECHO) \$(NOOP)\n"
1077 0 ▶ unless $self->{SKIPHASH}{'dynamic'};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"SKIPHASH"}{"dynamic"} 0 0 0
1078 push @m,"\nstatic :: \$(INST_ARCHAUTODIR)$self->{BASEEXT}.opt\n\t\$(NOECHO) \$(NOOP)\n"
1079 0 ▶ unless $self->{SKIPHASH}{'static'};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"SKIPHASH"}{"static"} 0 0 0
1080 0 push @m, "\n", sprintf <<'EOF', $target;
1081 $(INST_ARCHAUTODIR)$(BASEEXT).opt : %s
1082 $(CP) $(MMS$SOURCE) $(MMS$TARGET)
1083 EOF
1084 }
1085 0 push @m,
1086 "\n$target : $dep\n\t",
1087 q!$(PERLRUN) -MExtUtils::Mksymlists -e "Mksymlists('NAME'=>'!, $name,
1088 q!', 'DLBASE' => '!,$dlbase,
1089 q!', 'DL_FUNCS' => !,neatvalue($funcs),
1090 q!, 'FUNCLIST' => !,neatvalue($funclist),
1091 q!, 'IMPORTS' => !,neatvalue($imports),
1092 q!, 'DL_VARS' => !, neatvalue($vars);
1093 0 ▶ push @m, $extra if defined $extra;
Branch: 1 branch
BranchTrueFalseTotal
if defined $extra 0 0 0
1094 0 push @m, qq!);"\n\t!;
1095 # Can't use dlbase as it's been through mod2fname.
1096 0 my $olb_base = basename($target, '.opt');
1097 0 ▶ if ($self->{XSMULTI}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'XSMULTI'}) { } 0 0 0
1098 # We've been passed everything but the kitchen sink -- and the location of the
1099 # static library we're using to build the dynamic library -- so concoct that
1100 # location from what we do have.
1101 0 my $olb_dir = $self->catdir(dirname($instloc), $olb_base);
1102 0 push @m, qq!\$(PERL) -e "print ""${olb_dir}${olb_base}\$(LIB_EXT)/Include=!;
1103 0 ▶ push @m, ($Config{d_vms_case_sensitive_symbols} ? uc($olb_base) : $olb_base);
Branch: 1 branch
BranchTrueFalseTotal
$ExtUtils::MM_VMS::Config{'d_vms_case_sensitive_symbols'} ? : 0 0 0
1104 0 push @m, '\n' . $olb_dir . $olb_base . '$(LIB_EXT)/Library\n"";" >>$(MMS$TARGET)',"\n";
1105 }
1106 else {
1107 0 push @m, qq!\$(PERL) -e "print ""\$(INST_ARCHAUTODIR)${olb_base}\$(LIB_EXT)/Include=!;
1108 0 ▶ if ($self->{OBJECT} =~ /\bBASEEXT\b/ or
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'OBJECT'} =~ /\bBASEEXT\b/ or $self->{'OBJECT'} =~ /\b$self->{'BASEEXT'}\b/i) { } 0 0 0
Condition0%0/3
$self->{"OBJECT"} =~ /\bBASEEXT\b/ or $self->{"OBJECT"} =~ /\b$self->{"BASEEXT"}\b/i
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"OBJECT"} =~ /\bBASEEXT\b/ or $self->{"OBJECT"} =~ /\b$self->{"BASEEXT"}\b/i
$self->{"OBJECT"} =~ /\bBASEEXT\b/ $self->{"OBJECT"} =~ /\b$self->{"BASEEXT"}\b/i
Truth table0%0/3
A or B
A= $self->{"OBJECT"} =~ /\bBASEEXT\b/B= $self->{"OBJECT"} =~ /\b$self->{"BASEEXT"}\b/i
ABresult
1X1
011
000
1109 $self->{OBJECT} =~ /\b$self->{BASEEXT}\b/i) {
1110 push @m, ($Config{d_vms_case_sensitive_symbols}
1111 0 ▶ ? uc($self->{BASEEXT}) :'$(BASEEXT)');
Branch: 1 branch
BranchTrueFalseTotal
$ExtUtils::MM_VMS::Config{'d_vms_case_sensitive_symbols'} ? : 0 0 0
1112 }
1113 else { # We don't have a "main" object file, so pull 'em all in
1114 # Upcase module names if linker is being case-sensitive
1115 0 my($upcase) = $Config{d_vms_case_sensitive_symbols};
1116 0 my(@omods) = split ' ', $self->eliminate_macros($self->{OBJECT});
1117 0 for (@omods) {
1118 0 s/\.[^.]*$//; # Trim off file type
1119 0 s[\$\(\w+_EXT\)][]; # even as a macro
1120 0 s/.*[:>\/\]]//; # Trim off dir spec
1121 0 ▶ $_ = uc if $upcase;
Branch: 1 branch
BranchTrueFalseTotal
if $upcase 0 0 0
1122 };
1123 0 my(@lines);
1124 0 my $tmp = shift @omods;
1125 0 foreach my $elt (@omods) {
1126 0 $tmp .= ",$elt";
1127 0 ▶ if (length($tmp) > 80) { push @lines, $tmp; $tmp = ''; }
Branch: 1 branch
BranchTrueFalseTotal
if (length $tmp > 80) 0 0 0
1128 }
1129 0 push @lines, $tmp;
1130 0 push @m, '(', join( qq[, -\\n\\t"";" >>\$(MMS\$TARGET)\n\t\$(PERL) -e "print ""], @lines),')';
1131 }
1132 0 push @m, '\n$(INST_ARCHAUTODIR)' . $olb_base . '$(LIB_EXT)/Library\n"";" >>$(MMS$TARGET)',"\n";
1133 }
1134 0 ▶ if (length $self->{LDLOADLIBS}) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $self->{"LDLOADLIBS"}) 0 0 0
1135 0 my($line) = '';
1136 0 foreach my $lib (split ' ', $self->{LDLOADLIBS}) {
1137 0 $lib =~ s%\$%\\\$%g; # Escape '$' in VMS filespecs
1138 0 ▶ if (length($line) + length($lib) > 160) {
Branch: 1 branch
BranchTrueFalseTotal
if (length($line) + length($lib) > 160) { } 0 0 0
1139 0 push @m, "\t\$(PERL) -e \"print qq{$line}\" >>\$(MMS\$TARGET)\n";
1140 0 $line = $lib . '\n';
1141 }
1142 0 else { $line .= $lib . '\n'; }
1143 }
1144 0 ▶ push @m, "\t\$(PERL) -e \"print qq{$line}\" >>\$(MMS\$TARGET)\n" if $line;
Branch: 1 branch
BranchTrueFalseTotal
if $line 0 0 0
1145 }
1146 0 join '', @m;
1147 }
1148  
1149  
1150 =item xs_obj_opt
1151  
1152 Override to fixup -o flags.
1153  
1154 =cut
1155  
1156 sub xs_obj_opt {
1157 0 ▶ my ($self, $output_file) = @_;
Subroutine xs_obj_opt: not called CC=1 SCAR=6.9
Pod documented
1158 0 "/OBJECT=$output_file";
1159 }
1160  
1161 =item dynamic_lib (override)
1162  
1163 Use VMS Link command.
1164  
1165 =cut
1166  
1167 sub xs_dynamic_lib_macros {
1168 0 ▶ my ($self, $attribs) = @_;
Subroutine xs_dynamic_lib_macros: not called CC=3 SCAR=24.8
Pod documented
1169 0 ▶ my $otherldflags = $attribs->{OTHERLDFLAGS} || "";
Condition0%0/2
$attribs->{'OTHERLDFLAGS'} || ''
l!l
00
MC/DC0%0/1
$attribs->{'OTHERLDFLAGS'} || ''
$attribs->{'OTHERLDFLAGS'}
Truth table0%0/2
A
A= $attribs->{'OTHERLDFLAGS'}
Aresult
11
00
1170 0 ▶ my $inst_dynamic_dep = $attribs->{INST_DYNAMIC_DEP} || "";
Condition0%0/2
$attribs->{'INST_DYNAMIC_DEP'} || ''
l!l
00
MC/DC0%0/1
$attribs->{'INST_DYNAMIC_DEP'} || ''
$attribs->{'INST_DYNAMIC_DEP'}
Truth table0%0/2
A
A= $attribs->{'INST_DYNAMIC_DEP'}
Aresult
11
00
1171 0 sprintf <<'EOF', $otherldflags, $inst_dynamic_dep;
1172 # This section creates the dynamically loadable objects from relevant
1173 # objects and possibly $(MYEXTLIB).
1174 OTHERLDFLAGS = %s
1175 INST_DYNAMIC_DEP = %s
1176 EOF
1177 }
1178  
1179 sub xs_make_dynamic_lib {
1180 0 ▶ my ($self, $attribs, $from, $to, $todir, $ldfrom, $exportlist) = @_;
Subroutine xs_make_dynamic_lib: not called CC=1 SCAR=6.9
Pod documented
1181 0 my $shr = $Config{'dbgprefix'} . 'PerlShr';
1182 0 $exportlist =~ s/.def$/.opt/; # it's a linker options file
1183 # 1 2 3 4 5
1184 0 _sprintf562 <<'EOF', $to, $todir, $exportlist, $shr, "$shr Sys\$Share:$shr.$Config{'dlext'}";
1185 %1$s : $(INST_STATIC) $(PERL_INC)perlshr_attr.opt %2$s$(DFSEP).exists %3$s $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
1186 If F$TrnLNm("%4$s").eqs."" Then Define/NoLog/User %5$s
1187 Link $(LDFLAGS) /Shareable=$(MMS$TARGET)$(OTHERLDFLAGS) %3$s/Option,$(PERL_INC)perlshr_attr.opt/Option
1188 EOF
1189 }
1190  
1191 =item xs_make_static_lib (override)
1192  
1193 Use VMS commands to manipulate object library.
1194  
1195 =cut
1196  
1197 sub xs_make_static_lib {
1198 0 ▶ my ($self, $object, $to, $todir) = @_;
Subroutine xs_make_static_lib: not called CC=8 SCAR=42.8
Pod documented
1199  
1200 0 my @objects;
1201 0 ▶ if ($self->{XSMULTI}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'XSMULTI'}) { } 0 0 0
1202 # The extension name should be the main object file name minus file type.
1203 0 my $lib = $object;
1204 0 $lib =~ s/\$\(OBJ_EXT\)\z//;
1205 0 my $override = $self->_xsbuild_value('xs', $lib, 'OBJECT');
1206 0 ▶ $object = $override if defined $override;
Branch: 1 branch
BranchTrueFalseTotal
if defined $override 0 0 0
1207 0 @objects = map { $self->fixpath($_,0) } split /(?<!\^)\s+/, $object;
1208 }
1209 else {
1210 0 push @objects, $object;
1211 }
1212  
1213 0 my @m;
1214 0 for my $obj (@objects) {
1215 0 push(@m, sprintf "\n%s : %s\$(DFSEP).exists", $obj, $todir);
1216 }
1217 0 push(@m, sprintf "\n\n%s : %s \$(MYEXTLIB)\n", $to, (join ' ', @objects));
1218  
1219 # If this extension has its own library (eg SDBM_File)
1220 # then copy that to $(INST_STATIC) and add $(OBJECT) into it.
1221 0 ▶ push(@m, "\t",'$(CP) $(MYEXTLIB) $(MMS$TARGET)',"\n") if $self->{MYEXTLIB};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"MYEXTLIB"} 0 0 0
1222  
1223 0 push(@m,"\t",'If F$Search("$(MMS$TARGET)").eqs."" Then Library/Object/Create $(MMS$TARGET)',"\n");
1224  
1225 # if there was a library to copy, then we can't use MMS$SOURCE_LIST,
1226 # 'cause it's a library and you can't stick them in other libraries.
1227 # In that case, we use $OBJECT instead and hope for the best
1228 0 ▶ if ($self->{MYEXTLIB}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'MYEXTLIB'}) { } 0 0 0
1229 0 for my $obj (@objects) {
1230 0 push(@m,"\t",'Library/Object/Replace $(MMS$TARGET) ' . $obj,"\n");
1231 }
1232 }
1233 else {
1234 0 push(@m,"\t",'Library/Object/Replace $(MMS$TARGET) $(MMS$SOURCE_LIST)',"\n");
1235 }
1236  
1237 0 push @m, "\t\$(NOECHO) \$(PERL) -e 1 >\$(INST_ARCHAUTODIR)extralibs.ld\n";
1238 0 foreach my $lib (split ' ', $self->{EXTRALIBS}) {
1239 0 push(@m,"\t",'$(NOECHO) $(PERL) -e "print qq{',$lib,'\n}" >>$(INST_ARCHAUTODIR)extralibs.ld',"\n");
1240 }
1241 0 join('',@m);
1242 }
1243  
1244  
1245 =item extra_clean_files
1246  
1247 Clean up some OS specific files. Plus the temp file used to shorten
1248 a lot of commands. And the name mangler database.
1249  
1250 =cut
1251  
1252 sub extra_clean_files {
1253 0 ▶ return qw(
Subroutine extra_clean_files: not called CC=1 SCAR=6.9
Pod documented
1254 *.Map *.Dmp *.Lis *.cpp *.$(DLEXT) *.Opt $(BASEEXT).bso
1255 .MM_Tmp cxx_repository
1256 );
1257 }
1258  
1259  
1260 =item zipfile_target
1261  
1262 =item tarfile_target
1263  
1264 =item shdist_target
1265  
1266 Syntax for invoking shar, tar and zip differs from that for Unix.
1267  
1268 =cut
1269  
1270 sub zipfile_target {
1271 0 ▶ my($self) = shift;
Subroutine zipfile_target: not called CC=1 SCAR=6.9
Pod documented
1272  
1273 0 return <<'MAKE_FRAG';
1274 $(DISTVNAME).zip : distdir
1275 $(PREOP)
1276 $(ZIP) "$(ZIPFLAGS)" $(MMS$TARGET) [.$(DISTVNAME)...]*.*;
1277 $(RM_RF) $(DISTVNAME)
1278 $(POSTOP)
1279 MAKE_FRAG
1280 }
1281  
1282 sub tarfile_target {
1283 0 ▶ my($self) = shift;
Subroutine tarfile_target: not called CC=1 SCAR=6.9
Pod documented
1284  
1285 0 return <<'MAKE_FRAG';
1286 $(DISTVNAME).tar$(SUFFIX) : distdir
1287 $(PREOP)
1288 $(TO_UNIX)
1289 $(TAR) "$(TARFLAGS)" $(DISTVNAME).tar [.$(DISTVNAME)...]
1290 $(RM_RF) $(DISTVNAME)
1291 $(COMPRESS) $(DISTVNAME).tar
1292 $(POSTOP)
1293 MAKE_FRAG
1294 }
1295  
1296 sub shdist_target {
1297 0 ▶ my($self) = shift;
Subroutine shdist_target: not called CC=1 SCAR=6.9
Pod documented
1298  
1299 0 return <<'MAKE_FRAG';
1300 shdist : distdir
1301 $(PREOP)
1302 $(SHAR) [.$(DISTVNAME)...]*.*; $(DISTVNAME).share
1303 $(RM_RF) $(DISTVNAME)
1304 $(POSTOP)
1305 MAKE_FRAG
1306 }
1307  
1308  
1309 # --- Test and Installation Sections ---
1310  
1311 =item install (override)
1312  
1313 Work around DCL's 255 character limit several times,and use
1314 VMS-style command line quoting in a few cases.
1315  
1316 =cut
1317  
1318 sub install {
1319 0 ▶ my($self, %attribs) = @_;
Subroutine install: not called CC=6 SCAR=37.4
Pod documented
1320 0 my(@m);
1321  
1322 0 push @m, q[
1323 install :: all pure_install doc_install
1324 $(NOECHO) $(NOOP)
1325  
1326 install_perl :: all pure_perl_install doc_perl_install
1327 $(NOECHO) $(NOOP)
1328  
1329 install_site :: all pure_site_install doc_site_install
1330 $(NOECHO) $(NOOP)
1331  
1332 install_vendor :: all pure_vendor_install doc_vendor_install
1333 $(NOECHO) $(NOOP)
1334  
1335 pure_install :: pure_$(INSTALLDIRS)_install
1336 $(NOECHO) $(NOOP)
1337  
1338 doc_install :: doc_$(INSTALLDIRS)_install
1339 $(NOECHO) $(NOOP)
1340  
1341 pure__install : pure_site_install
1342 $(NOECHO) $(ECHO) "INSTALLDIRS not defined, defaulting to INSTALLDIRS=site"
1343  
1344 doc__install : doc_site_install
1345 $(NOECHO) $(ECHO) "INSTALLDIRS not defined, defaulting to INSTALLDIRS=site"
1346  
1347 # This hack brought to you by DCL's 255-character command line limit
1348 pure_perl_install ::
1349 ];
1350 push @m,
1351 q[ $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'read|'.File::Spec->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').'|'" >.MM_tmp
1352 $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'write|'.File::Spec->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').'|'" >>.MM_tmp
1353 0 ▶] unless $self->{NO_PACKLIST};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"NO_PACKLIST"} 0 0 0
1354  
1355 push @m,
1356 q[ $(NOECHO) $(ECHO_N) "$(INST_LIB)|$(DESTINSTALLPRIVLIB)|" >>.MM_tmp
1357 $(NOECHO) $(ECHO_N) "$(INST_ARCHLIB)|$(DESTINSTALLARCHLIB)|" >>.MM_tmp
1358 $(NOECHO) $(ECHO_N) "$(INST_BIN)|$(DESTINSTALLBIN)|" >>.MM_tmp
1359 $(NOECHO) $(ECHO_N) "$(INST_SCRIPT)|$(DESTINSTALLSCRIPT)|" >>.MM_tmp
1360 $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) " >>.MM_tmp
1361 $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR)|$(DESTINSTALLMAN3DIR)" >>.MM_tmp
1362 $(NOECHO) $(MOD_INSTALL) <.MM_tmp
1363 $(NOECHO) $(RM_F) .MM_tmp
1364 0 $(NOECHO) $(WARN_IF_OLD_PACKLIST) "].$self->catfile($self->{SITEARCHEXP},'auto',$self->{FULLEXT},'.packlist').q["
1365  
1366 # Likewise
1367 pure_site_install ::
1368 ];
1369 push @m,
1370 q[ $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'read|'.File::Spec->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').'|'" >.MM_tmp
1371 $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'write|'.File::Spec->catfile('$(DESTINSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').'|'" >>.MM_tmp
1372 0 ▶] unless $self->{NO_PACKLIST};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"NO_PACKLIST"} 0 0 0
1373  
1374 push @m,
1375 q[ $(NOECHO) $(ECHO_N) "$(INST_LIB)|$(DESTINSTALLSITELIB)|" >>.MM_tmp
1376 $(NOECHO) $(ECHO_N) "$(INST_ARCHLIB)|$(DESTINSTALLSITEARCH)|" >>.MM_tmp
1377 $(NOECHO) $(ECHO_N) "$(INST_BIN)|$(DESTINSTALLSITEBIN)|" >>.MM_tmp
1378 $(NOECHO) $(ECHO_N) "$(INST_SCRIPT)|$(DESTINSTALLSCRIPT)|" >>.MM_tmp
1379 $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR)|$(DESTINSTALLSITEMAN1DIR)|" >>.MM_tmp
1380 $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR)|$(DESTINSTALLSITEMAN3DIR)" >>.MM_tmp
1381 $(NOECHO) $(MOD_INSTALL) <.MM_tmp
1382 $(NOECHO) $(RM_F) .MM_tmp
1383 0 $(NOECHO) $(WARN_IF_OLD_PACKLIST) "].$self->catfile($self->{PERL_ARCHLIB},'auto',$self->{FULLEXT},'.packlist').q["
1384  
1385 pure_vendor_install ::
1386 ];
1387 push @m,
1388 q[ $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'read|'.File::Spec->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').'|'" >.MM_tmp
1389 $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'write|'.File::Spec->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').'|'" >>.MM_tmp
1390 0 ▶] unless $self->{NO_PACKLIST};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"NO_PACKLIST"} 0 0 0
1391  
1392 0 push @m,
1393 q[ $(NOECHO) $(ECHO_N) "$(INST_LIB)|$(DESTINSTALLVENDORLIB)|" >>.MM_tmp
1394 $(NOECHO) $(ECHO_N) "$(INST_ARCHLIB)|$(DESTINSTALLVENDORARCH)|" >>.MM_tmp
1395 $(NOECHO) $(ECHO_N) "$(INST_BIN)|$(DESTINSTALLVENDORBIN)|" >>.MM_tmp
1396 $(NOECHO) $(ECHO_N) "$(INST_SCRIPT)|$(DESTINSTALLSCRIPT)|" >>.MM_tmp
1397 $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR)|$(DESTINSTALLVENDORMAN1DIR)|" >>.MM_tmp
1398 $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR)|$(DESTINSTALLVENDORMAN3DIR)" >>.MM_tmp
1399 $(NOECHO) $(MOD_INSTALL) <.MM_tmp
1400 $(NOECHO) $(RM_F) .MM_tmp
1401  
1402 ];
1403  
1404 push @m, q[
1405 # Ditto
1406 doc_perl_install ::
1407 $(NOECHO) $(NOOP)
1408  
1409 # And again
1410 doc_site_install ::
1411 $(NOECHO) $(NOOP)
1412  
1413 doc_vendor_install ::
1414 $(NOECHO) $(NOOP)
1415  
1416 0 ▶] if $self->{NO_PERLLOCAL};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"NO_PERLLOCAL"} 0 0 0
1417  
1418 push @m, q[
1419 # Ditto
1420 doc_perl_install ::
1421 $(NOECHO) $(ECHO) "Appending installation info to ].$self->catfile($self->{DESTINSTALLARCHLIB}, 'perllocal.pod').q["
1422 $(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
1423 $(NOECHO) $(ECHO_N) "installed into|$(INSTALLPRIVLIB)|" >.MM_tmp
1424 $(NOECHO) $(ECHO_N) "LINKTYPE|$(LINKTYPE)|VERSION|$(VERSION)|EXE_FILES|$(EXE_FILES) " >>.MM_tmp
1425 $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].$self->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[
1426 $(NOECHO) $(RM_F) .MM_tmp
1427  
1428 # And again
1429 doc_site_install ::
1430 $(NOECHO) $(ECHO) "Appending installation info to ].$self->catfile($self->{DESTINSTALLARCHLIB}, 'perllocal.pod').q["
1431 $(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
1432 $(NOECHO) $(ECHO_N) "installed into|$(INSTALLSITELIB)|" >.MM_tmp
1433 $(NOECHO) $(ECHO_N) "LINKTYPE|$(LINKTYPE)|VERSION|$(VERSION)|EXE_FILES|$(EXE_FILES) " >>.MM_tmp
1434 $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].$self->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[
1435 $(NOECHO) $(RM_F) .MM_tmp
1436  
1437 doc_vendor_install ::
1438 $(NOECHO) $(ECHO) "Appending installation info to ].$self->catfile($self->{DESTINSTALLARCHLIB}, 'perllocal.pod').q["
1439 $(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
1440 $(NOECHO) $(ECHO_N) "installed into|$(INSTALLVENDORLIB)|" >.MM_tmp
1441 $(NOECHO) $(ECHO_N) "LINKTYPE|$(LINKTYPE)|VERSION|$(VERSION)|EXE_FILES|$(EXE_FILES) " >>.MM_tmp
1442 $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].$self->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[
1443 $(NOECHO) $(RM_F) .MM_tmp
1444  
1445 0 ▶] unless $self->{NO_PERLLOCAL};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"NO_PERLLOCAL"} 0 0 0
1446  
1447 push @m, q[
1448 uninstall :: uninstall_from_$(INSTALLDIRS)dirs
1449 $(NOECHO) $(NOOP)
1450  
1451 uninstall_from_perldirs ::
1452 $(NOECHO) $(UNINSTALL) ].$self->catfile($self->{PERL_ARCHLIB},'auto',$self->{FULLEXT},'.packlist').q[
1453  
1454 uninstall_from_sitedirs ::
1455 $(NOECHO) $(UNINSTALL) ].$self->catfile($self->{SITEARCHEXP},'auto',$self->{FULLEXT},'.packlist').q[
1456  
1457 uninstall_from_vendordirs ::
1458 0 $(NOECHO) $(UNINSTALL) ].$self->catfile($self->{VENDORARCHEXP},'auto',$self->{FULLEXT},'.packlist').q[
1459 ];
1460  
1461 0 join('',@m);
1462 }
1463  
1464 =item perldepend (override)
1465  
1466 Use VMS-style syntax for files; it's cheaper to just do it directly here
1467 than to have the MM_Unix method call C<catfile> repeatedly. Also, if
1468 we have to rebuild Config.pm, use MM[SK] to do it.
1469  
1470 =cut
1471  
1472 sub perldepend {
1473 0 ▶ my($self) = @_;
Subroutine perldepend: not called CC=12 SCAR=50.5
Pod documented
1474 0 my(@m);
1475  
1476 0 ▶ if ($self->{OBJECT}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"OBJECT"}) 0 0 0
1477 # Need to add an object file dependency on the perl headers.
1478 # this is very important for XS modules in perl.git development.
1479  
1480 0 push @m, $self->_perl_header_files_fragment(""); # empty separator on VMS as its in the $(PERL_INC)
1481 }
1482  
1483 0 ▶ if ($self->{PERL_SRC}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"PERL_SRC"}) 0 0 0
1484 0 my(@macros);
1485 0 my($mmsquals) = '$(USEMAKEFILE)[.vms]$(FIRST_MAKEFILE)';
1486 0 ▶ push(@macros,'__AXP__=1') if $Config{'archname'} eq 'VMS_AXP';
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Config{"archname"} eq "VMS_AXP" 0 0 0
1487 0 ▶ push(@macros,'DECC=1') if $Config{'vms_cc_type'} eq 'decc';
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Config{"vms_cc_type"} eq "decc" 0 0 0
1488 0 ▶ push(@macros,'GNUC=1') if $Config{'vms_cc_type'} eq 'gcc';
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Config{"vms_cc_type"} eq "gcc" 0 0 0
1489 0 ▶ push(@macros,'SOCKET=1') if $Config{'d_has_sockets'};
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Config{"d_has_sockets"} 0 0 0
1490 0 ▶ push(@macros,qq["CC=$Config{'cc'}"]) if $Config{'cc'} =~ m!/!;
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Config{"cc"} =~ m[/] 0 0 0
1491 0 ▶ $mmsquals .= '$(USEMACROS)' . join(',',@macros) . '$(MACROEND)' if @macros;
Branch: 1 branch
BranchTrueFalseTotal
if @macros 0 0 0
1492 0 push(@m,q[
1493 # Check for unpropagated config.sh changes. Should never happen.
1494 # We do NOT just update config.h because that is not sufficient.
1495 # An out of date config.h is not fatal but complains loudly!
1496 $(PERL_INC)config.h : $(PERL_SRC)config.sh
1497 $(NOOP)
1498  
1499 $(PERL_ARCHLIB)Config.pm : $(PERL_SRC)config.sh
1500 $(NOECHO) Write Sys$Error "$(PERL_ARCHLIB)Config.pm may be out of date with config.h or genconfig.pl"
1501 olddef = F$Environment("Default")
1502 Set Default $(PERL_SRC)
1503 $(MMS)],$mmsquals,);
1504 0 ▶ if ($self->{PERL_ARCHLIB} =~ m|\[-| && $self->{PERL_SRC} =~ m|(\[-+)|) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'PERL_ARCHLIB'} =~ /\[-/ and $self->{'PERL_SRC'} =~ /(\[-+)/) { } 0 0 0
Condition0%0/3
$self->{"PERL_ARCHLIB"} =~ /\[-/ and $self->{"PERL_SRC"} =~ /(\[-+)/
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{"PERL_ARCHLIB"} =~ /\[-/ and $self->{"PERL_SRC"} =~ /(\[-+)/
$self->{"PERL_ARCHLIB"} =~ /\[-/ $self->{"PERL_SRC"} =~ /(\[-+)/
Truth table0%0/3
A and B
A= $self->{"PERL_ARCHLIB"} =~ /\[-/B= $self->{"PERL_SRC"} =~ /(\[-+)/
ABresult
0X0
100
111
1505 0 my($prefix,$target) = ($1,$self->fixpath('$(PERL_ARCHLIB)Config.pm',0));
1506 0 $target =~ s/\Q$prefix/[/;
1507 0 push(@m," $target");
1508 }
1509 0 else { push(@m,' $(MMS$TARGET)'); }
1510 0 push(@m,q[
1511 Set Default 'olddef'
1512 ]);
1513 }
1514  
1515 0 push(@m, join(" ", map($self->fixpath($_,0),sort values %{$self->{XS}}))." : \$(XSUBPPDEPS)\n")
1516 0 ▶ if %{$self->{XS}};
Branch: 1 branch
BranchTrueFalseTotal
if %{$self->{"XS"};} 0 0 0
1517  
1518 0 join('',@m);
1519 }
1520  
1521  
1522 =item makeaperl (override)
1523  
1524 Undertake to build a new set of Perl images using VMS commands. Since
1525 VMS does dynamic loading, it's not necessary to statically link each
1526 extension into the Perl image, so this isn't the normal build path.
1527 Consequently, it hasn't really been tested, and may well be incomplete.
1528  
1529 =cut
1530  
1531 4 our %olbs; # needs to be localized
1532  
1533 sub makeaperl {
1534 0 ▶ my($self, %attribs) = @_;
Subroutine makeaperl: not called CC=32 SCAR=69.6
Pod documented
1535 my($makefilename, $searchdirs, $static, $extra, $perlinc, $target, $tmpdir, $libperl) =
1536 0 @attribs{qw(MAKE DIRS STAT EXTRA INCL TARGET TMP LIBPERL)};
1537 0 my(@m);
1538 0 push @m, "
1539 # --- MakeMaker makeaperl section ---
1540 MAP_TARGET = $target
1541 ";
1542 0 ▶ return join '', @m if $self->{PARENT};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"PARENT"} 0 0 0
1543  
1544 0 my($dir) = join ":", @{$self->{DIR}};
1545  
1546 0 ▶ unless ($self->{MAKEAPERL}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"MAKEAPERL"}) 0 0 0
1547 0 push @m, q{
1548 $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE)
1549 $(NOECHO) $(ECHO) "Writing ""$(MMS$TARGET)"" for this $(MAP_TARGET)"
1550 $(NOECHO) $(PERLRUNINST) \
1551 Makefile.PL DIR=}, $dir, q{ \
1552 FIRST_MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
1553 MAKEAPERL=1 NORECURS=1 };
1554  
1555 0 push @m, map(q[ \\\n\t\t"$_"], @ARGV),q{
1556  
1557 $(MAP_TARGET) :: $(MAKE_APERL_FILE)
1558 $(MAKE)$(USEMAKEFILE)$(MAKE_APERL_FILE) static $(MMS$TARGET)
1559 };
1560 0 push @m, "\n";
1561  
1562 0 return join '', @m;
1563 }
1564  
1565  
1566 0 my($linkcmd,@optlibs,@staticpkgs,$extralist,$targdir,$libperldir,%libseen);
1567 0 local($_);
1568  
1569 # The front matter of the linkcommand...
1570 $linkcmd = join ' ', $Config{'ld'},
1571 0 grep($_, @Config{qw(large split ldflags ccdlflags)});
1572 0 $linkcmd =~ s/\s+/ /g;
1573  
1574 # Which *.olb files could we make use of...
1575 0 local(%olbs); # XXX can this be lexical?
1576 0 $olbs{$self->{INST_ARCHAUTODIR}} = "$self->{BASEEXT}\$(LIB_EXT)";
1577 0 require File::Find;
1578 File::Find::find(sub {
1579 0 ▶ return unless m/\Q$self->{LIB_EXT}\E$/;
Subroutine __ANON__: not called CC=10 SCAR=47.0
Branch: 1 branch
BranchTrueFalseTotal
unless /\Q$self->{"LIB_EXT"}\E$/ 0 0 0
1580 0 ▶ return if m/^libperl/;
Branch: 1 branch
BranchTrueFalseTotal
if /^libperl/ 0 0 0
1581  
1582 0 ▶ if( exists $self->{INCLUDE_EXT} ){
Branch: 2 branches
BranchTrueFalseTotal
if (exists $self->{'INCLUDE_EXT'}) { } 0 0 0
elsif (exists $self->{'EXCLUDE_EXT'}) { } 0 0 0
1583 0 my $found = 0;
1584  
1585 0 (my $xx = $File::Find::name) =~ s,.*?/auto/,,;
1586 0 $xx =~ s,/?$_,,;
1587 0 $xx =~ s,/,::,g;
1588  
1589 # Throw away anything not explicitly marked for inclusion.
1590 # DynaLoader is implied.
1591 0 foreach my $incl ((@{$self->{INCLUDE_EXT}},'DynaLoader')){
1592 0 ▶ if( $xx eq $incl ){
Branch: 1 branch
BranchTrueFalseTotal
if ($xx eq $incl) 0 0 0
1593 0 $found++;
1594 0 last;
1595 }
1596 }
1597 0 ▶ return unless $found;
Branch: 1 branch
BranchTrueFalseTotal
unless $found 0 0 0
1598 }
1599 elsif( exists $self->{EXCLUDE_EXT} ){
1600 0 (my $xx = $File::Find::name) =~ s,.*?/auto/,,;
1601 0 $xx =~ s,/?$_,,;
1602 0 $xx =~ s,/,::,g;
1603  
1604 # Throw away anything explicitly marked for exclusion
1605 0 foreach my $excl (@{$self->{EXCLUDE_EXT}}){
1606 0 ▶ return if( $xx eq $excl );
Branch: 1 branch
BranchTrueFalseTotal
if $xx eq $excl 0 0 0
1607 }
1608 }
1609  
1610 0 $olbs{$ENV{DEFAULT}} = $_;
1611 0 ▶ }, grep( -d $_, @{$searchdirs || []}));
Branch: 1 branch
BranchTrueFalseTotal
$searchdirs or [] 0 0 0
1612  
1613 # We trust that what has been handed in as argument will be buildable
1614 0 ▶ $static = [] unless $static;
Branch: 1 branch
BranchTrueFalseTotal
unless $static 0 0 0
1615 0 @olbs{@{$static}} = (1) x @{$static};
1616  
1617 0 ▶ $extra = [] unless $extra && ref $extra eq 'ARRAY';
Branch: 1 branch
BranchTrueFalseTotal
unless $extra and ref $extra eq "ARRAY" 0 0 0
Condition0%0/3
$extra and ref $extra eq "ARRAY"
!ll&&!rl&&r
000
MC/DC0%0/2
$extra and ref $extra eq "ARRAY"
$extra ref $extra eq "ARRAY"
Truth table0%0/3
A and B
A= $extraB= ref $extra eq "ARRAY"
ABresult
0X0
100
111
1618 # Sort the object libraries in inverse order of
1619 # filespec length to try to insure that dependent extensions
1620 # will appear before their parents, so the linker will
1621 # search the parent library to resolve references.
1622 # (e.g. Intuit::DWIM will precede Intuit, so unresolved
1623 # references from [.intuit.dwim]dwim.obj can be found
1624 # in [.intuit]intuit.olb).
1625 0 ▶ for (sort { length($a) <=> length($b) || $a cmp $b } keys %olbs) {
Branch: 1 branch
BranchTrueFalseTotal
length $a <=> length $b or $a cmp $b 0 0 0
1626 0 ▶ next unless $olbs{$_} =~ /\Q$self->{LIB_EXT}\E$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $ExtUtils::MM_VMS::olbs{$_} =~ /\Q$self->{"LIB_EXT"}\E$/ 0 0 0
1627 0 my($dir) = $self->fixpath($_,1);
1628 0 my($extralibs) = $dir . "extralibs.ld";
1629 0 my($extopt) = $dir . $olbs{$_};
1630 0 $extopt =~ s/$self->{LIB_EXT}$/.opt/;
1631 0 push @optlibs, "$dir$olbs{$_}";
1632 # Get external libraries this extension will need
1633 0 ▶ if (-f $extralibs ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-f $extralibs) 0 0 0
1634 0 my %seenthis;
1635 0 ▶ open my $list, "<", $extralibs or warn $!,next;
Branch: 1 branch
BranchTrueFalseTotal
open my $list, "<", $extralibs or warn $!, next 0 0 0
1636 0 ▶ while (<$list>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $list)) 0 0 0
1637 0 chomp;
1638 # Include a library in the link only once, unless it's mentioned
1639 # multiple times within a single extension's options file, in which
1640 # case we assume the builder needed to search it again later in the
1641 # link.
1642 0 ▶ my $skip = exists($libseen{$_}) && !exists($seenthis{$_});
Condition0%0/3
exists $libseen{$_} && !exists $seenthis{$_}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $libseen{$_} && !exists $seenthis{$_}
exists $libseen{$_} !exists $seenthis{$_}
Truth table0%0/3
A && not(B)
A= exists $libseen{$_}B= !exists $seenthis{$_}
ABresult
0X0
100
111
1643 0 $libseen{$_}++; $seenthis{$_}++;
1644 0 ▶ next if $skip;
Branch: 1 branch
BranchTrueFalseTotal
if $skip 0 0 0
1645 0 push @$extra,$_;
1646 }
1647 }
1648 # Get full name of extension for ExtUtils::Miniperl
1649 0 ▶ if (-f $extopt) {
Branch: 1 branch
BranchTrueFalseTotal
if (-f $extopt) 0 0 0
1650 0 ▶ open my $opt, '<', $extopt or die $!;
Branch: 1 branch
BranchTrueFalseTotal
open my $opt, "<", $extopt or die $! 0 0 0
1651 0 ▶ while (<$opt>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $opt)) 0 0 0
1652 0 ▶ next unless /(?:UNIVERSAL|VECTOR)=boot_([\w_]+)/;
Branch: 1 branch
BranchTrueFalseTotal
unless /(?:UNIVERSAL|VECTOR)=boot_([\w_]+)/ 0 0 0
1653 0 my $pkg = $1;
1654 0 $pkg =~ s#__*#::#g;
1655 0 push @staticpkgs,$pkg;
1656 }
1657 }
1658 }
1659 # Place all of the external libraries after all of the Perl extension
1660 # libraries in the final link, in order to maximize the opportunity
1661 # for XS code from multiple extensions to resolve symbols against the
1662 # same external library while only including that library once.
1663 0 push @optlibs, @$extra;
1664  
1665 0 ▶ $target = "Perl$Config{'exe_ext'}" unless $target;
Branch: 1 branch
BranchTrueFalseTotal
unless $target 0 0 0
1666 0 my $shrtarget;
1667 0 ($shrtarget,$targdir) = fileparse($target);
1668 0 $shrtarget =~ s/^([^.]*)/$1Shr/;
1669 0 $shrtarget = $targdir . $shrtarget;
1670 0 ▶ $target = "Perlshr.$Config{'dlext'}" unless $target;
Branch: 1 branch
BranchTrueFalseTotal
unless $target 0 0 0
1671 0 ▶ $tmpdir = "[]" unless $tmpdir;
Branch: 1 branch
BranchTrueFalseTotal
unless $tmpdir 0 0 0
1672 0 $tmpdir = $self->fixpath($tmpdir,1);
1673 0 ▶ if (@optlibs) { $extralist = join(' ',@optlibs); }
Branch: 1 branch
BranchTrueFalseTotal
if (@optlibs) { } 0 0 0
1674 0 else { $extralist = ''; }
1675 # Let ExtUtils::Liblist find the necessary libs for us (but skip PerlShr)
1676 # that's what we're building here).
1677 0 push @optlibs, grep { !/PerlShr/i } split ' ', +($self->ext())[2];
1678 0 ▶ if ($libperl) {
Branch: 1 branch
BranchTrueFalseTotal
if ($libperl) 0 0 0
1679 0 ▶ unless (-f $libperl || -f ($libperl = $self->catfile($Config{'installarchlib'},'CORE',$libperl))) {
Branch: 1 branch
BranchTrueFalseTotal
unless (-f $libperl or -f ($libperl = $self->catfile($ExtUtils::MM_VMS::Config{"installarchlib"}, "CORE", $libperl))) 0 0 0
Condition0%0/3
-f $libperl or -f ($libperl = $self->catfile($ExtUtils::MM_VMS::Config{"installarchlib"}, "CORE", $libperl))
l!l&&r!l&&!r
000
MC/DC0%0/2
-f $libperl or -f ($libperl = $self->catfile($ExtUtils::MM_VMS::Config{"installarchlib"}, "CORE", $libperl))
-f $libperl -f ($libperl = $self->catfile($ExtUtils::MM_VMS::Config{"installarchlib"}, "CORE", $libperl))
Truth table0%0/3
A or B
A= -f $libperlB= -f ($libperl = $self->catfile($ExtUtils::MM_VMS::Config{"installarchlib"}, "CORE", $libperl))
ABresult
1X1
011
000
1680 0 print "Warning: $libperl not found\n";
1681 0 undef $libperl;
1682 }
1683 }
1684 0 ▶ unless ($libperl) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($libperl) 0 0 0
1685 0 ▶ if (defined $self->{PERL_SRC}) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $self->{'PERL_SRC'}) { } 0 0 0
elsif (-f ($libperl = $self->catfile($ExtUtils::MM_VMS::Config{'installarchlib'}, 'CORE', "libperl$self->{'LIB_EXT'}"))) { } 0 0 0
1686 0 $libperl = $self->catfile($self->{PERL_SRC},"libperl$self->{LIB_EXT}");
1687 } elsif (-f ($libperl = $self->catfile($Config{'installarchlib'},'CORE',"libperl$self->{LIB_EXT}")) ) {
1688 } else {
1689 0 print "Warning: $libperl not found
1690 If you're going to build a static perl binary, make sure perl is installed
1691 otherwise ignore this warning\n";
1692 }
1693 }
1694 0 $libperldir = $self->fixpath((fileparse($libperl))[1],1);
1695  
1696 push @m, '
1697 # Fill in the target you want to produce if it\'s not perl
1698 MAP_TARGET = ',$self->fixpath($target,0),'
1699 MAP_SHRTARGET = ',$self->fixpath($shrtarget,0),"
1700 MAP_LINKCMD = $linkcmd
1701 0 ▶MAP_PERLINC = ", $perlinc ? map('"$_" ',@{$perlinc}) : '',"
Branch: 1 branch
BranchTrueFalseTotal
$perlinc ? : 0 0 0
1702 MAP_EXTRA = $extralist
1703 MAP_LIBPERL = ",$self->fixpath($libperl,0),'
1704 ';
1705  
1706  
1707 0 push @m,"\n${tmpdir}Makeaperl.Opt : \$(MAP_EXTRA)\n";
1708 0 foreach (@optlibs) {
1709 0 push @m,' $(NOECHO) $(PERL) -e "print q{',$_,'}" >>$(MMS$TARGET)',"\n";
1710 }
1711 0 push @m,"\n${tmpdir}PerlShr.Opt :\n\t";
1712 0 push @m,'$(NOECHO) $(PERL) -e "print q{$(MAP_SHRTARGET)}" >$(MMS$TARGET)',"\n";
1713  
1714 0 push @m,'
1715 $(MAP_SHRTARGET) : $(MAP_LIBPERL) Makeaperl.Opt ',"${libperldir}Perlshr_Attr.Opt",'
1716 $(MAP_LINKCMD)/Shareable=$(MMS$TARGET) $(MAP_LIBPERL), Makeaperl.Opt/Option ',"${libperldir}Perlshr_Attr.Opt/Option",'
1717 $(MAP_TARGET) : $(MAP_SHRTARGET) ',"${tmpdir}perlmain\$(OBJ_EXT) ${tmpdir}PerlShr.Opt",'
1718 $(MAP_LINKCMD) ',"${tmpdir}perlmain\$(OBJ_EXT)",', PerlShr.Opt/Option
1719 $(NOECHO) $(ECHO) "To install the new ""$(MAP_TARGET)"" binary, say"
1720 $(NOECHO) $(ECHO) " $(MAKE)$(USEMAKEFILE)$(FIRST_MAKEFILE) inst_perl $(USEMACROS)MAP_TARGET=$(MAP_TARGET)$(ENDMACRO)"
1721 $(NOECHO) $(ECHO) "To remove the intermediate files, say
1722 $(NOECHO) $(ECHO) " $(MAKE)$(USEMAKEFILE)$(FIRST_MAKEFILE) map_clean"
1723 ';
1724 0 push @m,"\n${tmpdir}perlmain.c : \$(FIRST_MAKEFILE)\n\t\$(NOECHO) \$(PERL) -e 1 >${tmpdir}Writemain.tmp\n";
1725 0 push @m, "# More from the 255-char line length limit\n";
1726 0 foreach (@staticpkgs) {
1727 0 push @m,' $(NOECHO) $(PERL) -e "print q{',$_,qq[}" >>${tmpdir}Writemain.tmp\n];
1728 }
1729  
1730 0 push @m, sprintf <<'MAKE_FRAG', $tmpdir, $tmpdir;
1731 $(NOECHO) $(PERL) $(MAP_PERLINC) -ane "use ExtUtils::Miniperl; writemain(@F)" %sWritemain.tmp >$(MMS$TARGET)
1732 $(NOECHO) $(RM_F) %sWritemain.tmp
1733 MAKE_FRAG
1734  
1735 0 push @m, q[
1736 # Still more from the 255-char line length limit
1737 doc_inst_perl :
1738 $(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
1739 $(NOECHO) $(ECHO) "Perl binary $(MAP_TARGET)|" >.MM_tmp
1740 $(NOECHO) $(ECHO) "MAP_STATIC|$(MAP_STATIC)|" >>.MM_tmp
1741 $(NOECHO) $(PERL) -pl040 -e " " ].$self->catfile('$(INST_ARCHAUTODIR)','extralibs.all'),q[ >>.MM_tmp
1742 $(NOECHO) $(ECHO) -e "MAP_LIBPERL|$(MAP_LIBPERL)|" >>.MM_tmp
1743 $(NOECHO) $(DOC_INSTALL) <.MM_tmp >>].$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q[
1744 $(NOECHO) $(RM_F) .MM_tmp
1745 ];
1746  
1747 push @m, "
1748 inst_perl : pure_inst_perl doc_inst_perl
1749 \$(NOECHO) \$(NOOP)
1750  
1751 pure_inst_perl : \$(MAP_TARGET)
1752 $self->{CP} \$(MAP_SHRTARGET) ",$self->fixpath($Config{'installbin'},1),"
1753 0 $self->{CP} \$(MAP_TARGET) ",$self->fixpath($Config{'installbin'},1),"
1754  
1755 clean :: map_clean
1756 \$(NOECHO) \$(NOOP)
1757  
1758 map_clean :
1759 \$(RM_F) ${tmpdir}perlmain\$(OBJ_EXT) ${tmpdir}perlmain.c \$(FIRST_MAKEFILE)
1760 \$(RM_F) ${tmpdir}Makeaperl.Opt ${tmpdir}PerlShr.Opt \$(MAP_TARGET)
1761 ";
1762  
1763 0 join '', @m;
1764 }
1765  
1766  
1767 # --- Output postprocessing section ---
1768  
1769 =item maketext_filter (override)
1770  
1771 Ensure that colons marking targets are preceded by space, in order
1772 to distinguish the target delimiter from a colon appearing as
1773 part of a filespec.
1774  
1775 =cut
1776  
1777 sub maketext_filter {
1778 3 ▶ my($self, $text) = @_;
Subroutine maketext_filter: called CC=1 SCAR=0.0
Pod documented
1779  
1780 3 $text =~ s/^([^\s:=]+)(:+\s)/$1 $2/mg;
1781 3 return $text;
1782 }
1783  
1784 =item prefixify (override)
1785  
1786 prefixifying on VMS is simple. Each should simply be:
1787  
1788 perl_root:[some.dir]
1789  
1790 which can just be converted to:
1791  
1792 volume:[your.prefix.some.dir]
1793  
1794 otherwise you get the default layout.
1795  
1796 In effect, your search prefix is ignored and $Config{vms_prefix} is
1797 used instead.
1798  
1799 =cut
1800  
1801 sub prefixify {
1802 0 ▶ my($self, $var, $sprefix, $rprefix, $default) = @_;
Subroutine prefixify: not called CC=19 SCAR=59.4
Pod documented
1803  
1804 # Translate $(PERLPREFIX) to a real path.
1805 0 $rprefix = $self->eliminate_macros($rprefix);
1806 0 ▶ $rprefix = vmspath($rprefix) if $rprefix;
Branch: 1 branch
BranchTrueFalseTotal
if $rprefix 0 0 0
1807 0 ▶ $sprefix = vmspath($sprefix) if $sprefix;
Branch: 1 branch
BranchTrueFalseTotal
if $sprefix 0 0 0
1808  
1809 0 ▶ $default = vmsify($default)
Branch: 1 branch
BranchTrueFalseTotal
unless $default =~ /\[.*\]/ 0 0 0
1810 unless $default =~ /\[.*\]/;
1811  
1812 0 (my $var_no_install = $var) =~ s/^install//;
1813 my $path = $self->{uc $var} ||
1814 $ExtUtils::MM_Unix::Config_Override{lc $var} ||
1815 0 ▶ $Config{lc $var} || $Config{lc $var_no_install};
Condition0%0/9
$$self{uc $var} || $ExtUtils::MM_Unix::Config_Override{lc $var} || $ExtUtils::MM_VMS::Config{lc $var} || $ExtUtils::MM_VMS::Config{lc $var_no_install}
l!l&&r!l&&!r
000
$$self{uc $var} or $ExtUtils::MM_Unix::Config_Override{lc $var} or $ExtUtils::MM_VMS::Config{lc $var}
l!l&&r!l&&!r
000
$$self{uc $var} or $ExtUtils::MM_Unix::Config_Override{lc $var}
l!l&&r!l&&!r
000
MC/DC0%0/4
$$self{uc $var} || $ExtUtils::MM_Unix::Config_Override{lc $var} || $ExtUtils::MM_VMS::Config{lc $var} || $ExtUtils::MM_VMS::Config{lc $var_no_install}
$$self{uc $var} $ExtUtils::MM_Unix::Config_Override{lc $var} $ExtUtils::MM_VMS::Config{lc $var} $ExtUtils::MM_VMS::Config{lc $var_no_install}
Truth table0%0/5
A or B or C || D
A= $$self{uc $var}B= $ExtUtils::MM_Unix::Config_Override{lc $var}C= $ExtUtils::MM_VMS::Config{lc $var}D= $ExtUtils::MM_VMS::Config{lc $var_no_install}
ABCDresult
1XXX1
01XX1
001X1
00011
00000
1816  
1817 0 ▶ if( !$path ) {
Branch: 3 branches
BranchTrueFalseTotal
if (not $path) { } 0 0 0
elsif (not $self->{'ARGS'}{'PREFIX'} && $self->file_name_is_absolute($path)) { } 0 0 0
elsif ($sprefix eq $rprefix) { } 0 0 0
1818 0 ▶ warn " no Config found for $var.\n" if $Verbose >= 2;
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Verbose >= 2 0 0 0
1819 0 $path = $self->_prefixify_default($rprefix, $default);
1820 }
1821 ▶ elsif( !$self->{ARGS}{PREFIX} || !$self->file_name_is_absolute($path) ) {
Condition0%0/3
$self->{'ARGS'}{'PREFIX'} && $self->file_name_is_absolute($path)
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{'ARGS'}{'PREFIX'} && $self->file_name_is_absolute($path)
$self->{'ARGS'}{'PREFIX'} $self->file_name_is_absolute($path)
Truth table0%0/3
A && B
A= $self->{'ARGS'}{'PREFIX'}B= $self->file_name_is_absolute($path)
ABresult
0X0
100
111
1822 # do nothing if there's no prefix or if its relative
1823 }
1824 elsif( $sprefix eq $rprefix ) {
1825 0 ▶ warn " no new prefix.\n" if $Verbose >= 2;
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Verbose >= 2 0 0 0
1826 }
1827 else {
1828  
1829 0 ▶ warn " prefixify $var => $path\n" if $Verbose >= 2;
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Verbose >= 2 0 0 0
1830 0 ▶ warn " from $sprefix to $rprefix\n" if $Verbose >= 2;
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Verbose >= 2 0 0 0
1831  
1832 0 my($path_vol, $path_dirs) = $self->splitpath( $path );
1833 0 ▶ if( $path_vol eq $Config{vms_prefix}.':' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($path_vol eq $ExtUtils::MM_VMS::Config{'vms_prefix'} . ':') { } 0 0 0
1834 0 ▶ warn " $Config{vms_prefix}: seen\n" if $Verbose >= 2;
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Verbose >= 2 0 0 0
1835  
1836 0 ▶ $path_dirs =~ s{^\[}{\[.} unless $path_dirs =~ m{^\[\.};
Branch: 1 branch
BranchTrueFalseTotal
unless $path_dirs =~ /^\[\./ 0 0 0
1837 0 $path = $self->_catprefix($rprefix, $path_dirs);
1838 }
1839 else {
1840 0 $path = $self->_prefixify_default($rprefix, $default);
1841 }
1842 }
1843  
1844 0 ▶ print " now $path\n" if $Verbose >= 2;
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Verbose >= 2 0 0 0
1845 0 return $self->{uc $var} = $path;
1846 }
1847  
1848  
1849 sub _prefixify_default {
1850 0 ▶ my($self, $rprefix, $default) = @_;
Subroutine _prefixify_default: not called CC=6 SCAR=37.4
1851  
1852 0 ▶ warn " cannot prefix, using default.\n" if $Verbose >= 2;
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Verbose >= 2 0 0 0
1853  
1854 0 ▶ if( !$default ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($default) 0 0 0
1855 0 ▶ warn "No default!\n" if $Verbose >= 1;
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Verbose >= 1 0 0 0
1856 0 return;
1857 }
1858 0 ▶ if( !$rprefix ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($rprefix) 0 0 0
1859 0 ▶ warn "No replacement prefix!\n" if $Verbose >= 1;
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_VMS::Verbose >= 1 0 0 0
1860 0 return '';
1861 }
1862  
1863 0 return $self->_catprefix($rprefix, $default);
1864 }
1865  
1866 sub _catprefix {
1867 0 ▶ my($self, $rprefix, $default) = @_;
Subroutine _catprefix: not called CC=2 SCAR=17.9
1868  
1869 0 my($rvol, $rdirs) = $self->splitpath($rprefix);
1870 0 ▶ if( $rvol ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($rvol) { } 0 0 0
1871 0 return $self->catpath($rvol,
1872 $self->catdir($rdirs, $default),
1873 ''
1874 )
1875 }
1876 else {
1877 0 return $self->catdir($rdirs, $default);
1878 }
1879 }
1880  
1881  
1882 =item cd
1883  
1884 =cut
1885  
1886 sub cd {
1887 0 ▶ my($self, $dir, @cmds) = @_;
Subroutine cd: not called CC=1 SCAR=6.9
Pod documented
1888  
1889 0 $dir = vmspath($dir);
1890  
1891 0 my $cmd = join "\n\t", map "$_", @cmds;
1892  
1893 # No leading tab makes it look right when embedded
1894 0 my $make_frag = sprintf <<'MAKE_FRAG', $dir, $cmd;
1895 startdir = F$Environment("Default")
1896 Set Default %s
1897 %s
1898 Set Default 'startdir'
1899 MAKE_FRAG
1900  
1901 # No trailing newline makes this easier to embed
1902 0 chomp $make_frag;
1903  
1904 0 return $make_frag;
1905 }
1906  
1907  
1908 =item oneliner
1909  
1910 =cut
1911  
1912 sub oneliner {
1913 0 ▶ my($self, $cmd, $switches) = @_;
Subroutine oneliner: not called CC=2 SCAR=17.9
Pod documented
1914 0 ▶ $switches = [] unless defined $switches;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $switches 0 0 0
1915  
1916 # Strip leading and trailing newlines
1917 0 $cmd =~ s{^\n+}{};
1918 0 $cmd =~ s{\n+$}{};
1919  
1920 0 my @cmds = split /\n/, $cmd;
1921 0 $cmd = join " \n\t -e ", map $self->quote_literal($_), @cmds;
1922 0 $cmd = $self->escape_newlines($cmd);
1923  
1924 # Switches must be quoted else they will be lowercased.
1925 0 $switches = join ' ', map { qq{"$_"} } @$switches;
1926  
1927 0 return qq{\$(ABSPERLRUN) $switches -e $cmd "--"};
1928 }
1929  
1930  
1931 =item B<echo>
1932  
1933 perl trips up on "<foo>" thinking it's an input redirect. So we use the
1934 native Write command instead. Besides, it's faster.
1935  
1936 =cut
1937  
1938 sub echo {
1939 0 ▶ my($self, $text, $file, $opts) = @_;
Subroutine echo: not called CC=5 SCAR=34.0
Pod documented
1940  
1941 # Compatibility with old options
1942 0 ▶ if( !ref $opts ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $opts) 0 0 0
1943 0 my $append = $opts;
1944 0 ▶ $opts = { append => $append || 0 };
Condition0%0/2
$append || 0
l!l
00
MC/DC0%0/1
$append || 0
$append
Truth table0%0/2
A
A= $append
Aresult
11
00
1945 }
1946 0 ▶ my $opencmd = $opts->{append} ? 'Open/Append' : 'Open/Write';
Branch: 1 branch
BranchTrueFalseTotal
$opts->{'append'} ? : 0 0 0
1947  
1948 0 ▶ $opts->{allow_variables} = 0 unless defined $opts->{allow_variables};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $opts->{"allow_variables"} 0 0 0
1949  
1950 0 my $ql_opts = { allow_variables => $opts->{allow_variables} };
1951  
1952 0 my @cmds = ("\$(NOECHO) $opencmd MMECHOFILE $file ");
1953 0 push @cmds, map { '$(NOECHO) Write MMECHOFILE '.$self->quote_literal($_, $ql_opts) }
1954 split /\n/, $text;
1955 0 push @cmds, '$(NOECHO) Close MMECHOFILE';
1956 0 return @cmds;
1957 }
1958  
1959  
1960 =item quote_literal
1961  
1962 =cut
1963  
1964 sub quote_literal {
1965 0 ▶ my($self, $text, $opts) = @_;
Subroutine quote_literal: not called CC=3 SCAR=24.8
Pod documented
1966 0 ▶ $opts->{allow_variables} = 1 unless defined $opts->{allow_variables};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $opts->{"allow_variables"} 0 0 0
1967  
1968 # I believe this is all we should need.
1969 0 $text =~ s{"}{""}g;
1970  
1971 $text = $opts->{allow_variables}
1972 0 ▶ ? $self->escape_dollarsigns($text) : $self->escape_all_dollarsigns($text);
Branch: 1 branch
BranchTrueFalseTotal
$opts->{'allow_variables'} ? : 0 0 0
1973  
1974 0 return qq{"$text"};
1975 }
1976  
1977 =item escape_dollarsigns
1978  
1979 Quote, don't escape.
1980  
1981 =cut
1982  
1983 sub escape_dollarsigns {
1984 0 ▶ my($self, $text) = @_;
Subroutine escape_dollarsigns: not called CC=1 SCAR=6.9
Pod documented
1985  
1986 # Quote dollar signs which are not starting a variable
1987 0 $text =~ s{\$ (?!\() }{"\$"}gx;
1988  
1989 0 return $text;
1990 }
1991  
1992  
1993 =item escape_all_dollarsigns
1994  
1995 Quote, don't escape.
1996  
1997 =cut
1998  
1999 sub escape_all_dollarsigns {
2000 0 ▶ my($self, $text) = @_;
Subroutine escape_all_dollarsigns: not called CC=1 SCAR=6.9
Pod documented
2001  
2002 # Quote dollar signs
2003 0 $text =~ s{\$}{"\$\"}gx;
2004  
2005 0 return $text;
2006 }
2007  
2008 =item escape_newlines
2009  
2010 =cut
2011  
2012 sub escape_newlines {
2013 0 ▶ my($self, $text) = @_;
Subroutine escape_newlines: not called CC=1 SCAR=6.9
Pod documented
2014  
2015 0 $text =~ s{\n}{-\n}g;
2016  
2017 0 return $text;
2018 }
2019  
2020 =item max_exec_len
2021  
2022 256 characters.
2023  
2024 =cut
2025  
2026 sub max_exec_len {
2027 0 ▶ my $self = shift;
Subroutine max_exec_len: not called CC=2 SCAR=17.9
Pod documented
2028  
2029 0 ▶ return $self->{_MAX_EXEC_LEN} ||= 256;
Condition0%0/2
$self->{"_MAX_EXEC_LEN"} ||= 256
l!l
00
MC/DC0%0/1
$self->{"_MAX_EXEC_LEN"} ||= 256
$self->{"_MAX_EXEC_LEN"}
Truth table0%0/2
A
A= $self->{"_MAX_EXEC_LEN"}
Aresult
11
00
2030 }
2031  
2032 =item init_linker
2033  
2034 =cut
2035  
2036 sub init_linker {
2037 0 ▶ my $self = shift;
Subroutine init_linker: not called CC=8 SCAR=42.8
Pod documented
2038 0 ▶ $self->{EXPORT_LIST} ||= '$(BASEEXT).opt';
Condition0%0/2
$self->{"EXPORT_LIST"} ||= "\$(BASEEXT).opt"
l!l
00
MC/DC0%0/1
$self->{"EXPORT_LIST"} ||= "\$(BASEEXT).opt"
$self->{"EXPORT_LIST"}
Truth table0%0/2
A
A= $self->{"EXPORT_LIST"}
Aresult
11
00
2039  
2040 0 my $shr = $Config{dbgprefix} . 'PERLSHR';
2041 0 ▶ if ($self->{PERL_SRC}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'PERL_SRC'}) { } 0 0 0
2042 $self->{PERL_ARCHIVE} ||=
2043 0 ▶ $self->catfile($self->{PERL_SRC}, "$shr.$Config{'dlext'}");
Condition0%0/3
$self->{"PERL_ARCHIVE"} ||= $self->catfile($self->{"PERL_SRC"}, qq[$shr.$ExtUtils::MM_VMS::Config{"dlext"}])
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"PERL_ARCHIVE"} ||= $self->catfile($self->{"PERL_SRC"}, qq[$shr.$ExtUtils::MM_VMS::Config{"dlext"}])
$self->{"PERL_ARCHIVE"} $self->catfile($self->{"PERL_SRC"}, qq[$shr.$ExtUtils::MM_VMS::Config{"dlext"}])
Truth table0%0/3
A ||= B
A= $self->{"PERL_ARCHIVE"}B= $self->catfile($self->{"PERL_SRC"}, qq[$shr.$ExtUtils::MM_VMS::Config{"dlext"}])
ABresult
1X1
011
000
2044 }
2045 else {
2046 $self->{PERL_ARCHIVE} ||=
2047 0 ▶ $ENV{$shr} ? $ENV{$shr} : "Sys\$Share:$shr.$Config{'dlext'}";
Branch: 1 branch
BranchTrueFalseTotal
$ENV{$shr} ? : 0 0 0
Condition0%0/3
$self->{"PERL_ARCHIVE"} ||= $ENV{$shr} ? $ENV{$shr} : qq[Sys\$Share:$shr.$ExtUtils::MM_VMS::Config{"dlext"}]
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"PERL_ARCHIVE"} ||= $ENV{$shr} ? $ENV{$shr} : qq[Sys\$Share:$shr.$ExtUtils::MM_VMS::Config{"dlext"}]
$self->{"PERL_ARCHIVE"} $ENV{$shr} ? $ENV{$shr} : qq[Sys\$Share:$shr.$ExtUtils::MM_VMS::Config{"dlext"}]
Truth table0%0/3
A ||= B
A= $self->{"PERL_ARCHIVE"}B= $ENV{$shr} ? $ENV{$shr} : qq[Sys\$Share:$shr.$ExtUtils::MM_VMS::Config{"dlext"}]
ABresult
1X1
011
000
2048 }
2049  
2050 0 ▶ $self->{PERL_ARCHIVEDEP} ||= '';
Condition0%0/2
$self->{"PERL_ARCHIVEDEP"} ||= ""
l!l
00
MC/DC0%0/1
$self->{"PERL_ARCHIVEDEP"} ||= ""
$self->{"PERL_ARCHIVEDEP"}
Truth table0%0/2
A
A= $self->{"PERL_ARCHIVEDEP"}
Aresult
11
00
2051 0 ▶ $self->{PERL_ARCHIVE_AFTER} ||= '';
Condition0%0/2
$self->{"PERL_ARCHIVE_AFTER"} ||= ""
l!l
00
MC/DC0%0/1
$self->{"PERL_ARCHIVE_AFTER"} ||= ""
$self->{"PERL_ARCHIVE_AFTER"}
Truth table0%0/2
A
A= $self->{"PERL_ARCHIVE_AFTER"}
Aresult
11
00
2052 }
2053  
2054  
2055 =item catdir (override)
2056  
2057 =item catfile (override)
2058  
2059 Eliminate the macros in the output to the MMS/MMK file.
2060  
2061 (File::Spec::VMS used to do this for us, but it's being removed)
2062  
2063 =cut
2064  
2065 sub catdir {
2066 0 ▶ my $self = shift;
Subroutine catdir: not called CC=2 SCAR=17.9
Pod documented
2067  
2068 # Process the macros on VMS MMS/MMK
2069 0 ▶ my @args = map { m{\$\(} ? $self->eliminate_macros($_) : $_ } @_;
Branch: 1 branch
BranchTrueFalseTotal
/\$\(/ ? : 0 0 0
2070  
2071 0 my $dir = $self->SUPER::catdir(@args);
2072  
2073 # Fix up the directory and force it to VMS format.
2074 0 $dir = $self->fixpath($dir, 1);
2075  
2076 0 return $dir;
2077 }
2078  
2079 sub catfile {
2080 0 ▶ my $self = shift;
Subroutine catfile: not called CC=2 SCAR=17.9
Pod documented
2081  
2082 # Process the macros on VMS MMS/MMK
2083 0 ▶ my @args = map { m{\$\(} ? $self->eliminate_macros($_) : $_ } @_;
Branch: 1 branch
BranchTrueFalseTotal
/\$\(/ ? : 0 0 0
2084  
2085 0 my $file = $self->SUPER::catfile(@args);
2086  
2087 0 $file = vmsify($file);
2088  
2089 0 return $file
2090 }
2091  
2092  
2093 =item eliminate_macros
2094  
2095 Expands MM[KS]/Make macros in a text string, using the contents of
2096 identically named elements of C<%$self>, and returns the result
2097 as a file specification in Unix syntax.
2098  
2099 NOTE: This is the canonical version of the method. The version in
2100 File::Spec::VMS is deprecated.
2101  
2102 =cut
2103  
2104 sub eliminate_macros {
2105 0 ▶ my($self,$path) = @_;
Subroutine eliminate_macros: not called CC=9 SCAR=45.0
Pod documented
2106 0 ▶ return '' unless $path;
Branch: 1 branch
BranchTrueFalseTotal
unless $path 0 0 0
2107 0 ▶ $self = {} unless ref $self;
Branch: 1 branch
BranchTrueFalseTotal
unless ref $self 0 0 0
2108  
2109 0 my($npath) = unixify($path);
2110 # sometimes unixify will return a string with an off-by-one trailing null
2111 0 $npath =~ s{\0$}{};
2112  
2113 0 my($complex) = 0;
2114 0 my($head,$macro,$tail);
2115  
2116 # perform m##g in scalar context so it acts as an iterator
2117 0 ▶ while ($npath =~ m#(.*?)\$\((\S+?)\)(.*)#gs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($npath =~ /(.*?)\$\((\S+?)\)(.*)/gs) 0 0 0
2118 0 ▶ if (defined $self->{$2}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{$2}) 0 0 0
2119 0 ($head,$macro,$tail) = ($1,$2,$3);
2120 0 ▶ if (ref $self->{$macro}) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $self->{$macro}) { } 0 0 0
2121 0 ▶ if (ref $self->{$macro} eq 'ARRAY') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $self->{$macro} eq 'ARRAY') { } 0 0 0
2122 0 $macro = join ' ', @{$self->{$macro}};
2123 }
2124 else {
2125 0 print "Note: can't expand macro \$($macro) containing ",ref($self->{$macro}),
2126 "\n\t(using MMK-specific deferred substitutuon; MMS will break)\n";
2127 0 $macro = "\cB$macro\cB";
2128 0 $complex = 1;
2129 }
2130 }
2131 else {
2132 0 $macro = $self->{$macro};
2133 # Don't unixify if there is unescaped whitespace
2134 0 ▶ $macro = unixify($macro) unless ($macro =~ /(?<!\^)\s/);
Branch: 1 branch
BranchTrueFalseTotal
unless $macro =~ /(?<!\^)\s/ 0 0 0
2135 0 $macro =~ s#/\Z(?!\n)##;
2136 }
2137 0 $npath = "$head$macro$tail";
2138 }
2139 }
2140 0 ▶ if ($complex) { $npath =~ s#\cB(.*?)\cB#\${$1}#gs; }
Branch: 1 branch
BranchTrueFalseTotal
if ($complex) 0 0 0
2141 0 $npath;
2142 }
2143  
2144 =item fixpath
2145  
2146 my $path = $mm->fixpath($path);
2147 my $path = $mm->fixpath($path, $is_dir);
2148  
2149 Catchall routine to clean up problem MM[SK]/Make macros. Expands macros
2150 in any directory specification, in order to avoid juxtaposing two
2151 VMS-syntax directories when MM[SK] is run. Also expands expressions which
2152 are all macro, so that we can tell how long the expansion is, and avoid
2153 overrunning DCL's command buffer when MM[KS] is running.
2154  
2155 fixpath() checks to see whether the result matches the name of a
2156 directory in the current default directory and returns a directory or
2157 file specification accordingly. C<$is_dir> can be set to true to
2158 force fixpath() to consider the path to be a directory or false to force
2159 it to be a file.
2160  
2161 NOTE: This is the canonical version of the method. The version in
2162 File::Spec::VMS is deprecated.
2163  
2164 =cut
2165  
2166 sub fixpath {
2167 0 ▶ my($self,$path,$force_path) = @_;
Subroutine fixpath: not called CC=18 SCAR=58.3
Pod documented
2168 0 ▶ return '' unless $path;
Branch: 1 branch
BranchTrueFalseTotal
unless $path 0 0 0
2169 0 ▶ $self = bless {}, $self unless ref $self;
Branch: 1 branch
BranchTrueFalseTotal
unless ref $self 0 0 0
2170 0 my($fixedpath,$prefix,$name);
2171  
2172 0 ▶ if ($path =~ m#^\$\([^\)]+\)\Z(?!\n)#s || $path =~ m#[/:>\]]#) {
Branch: 2 branches
BranchTrueFalseTotal
if ($path =~ /^\$\([^\)]+\)\Z(?!\n)/s or $path =~ m([/:>\]])) { } 0 0 0
elsif (() = $path =~ /^\$\(([^\)]+)\)(.+)/s and $self->{$prefix}) { } 0 0 0
Condition0%0/3
$path =~ /^\$\([^\)]+\)\Z(?!\n)/s or $path =~ m([/:>\]])
l!l&&r!l&&!r
000
MC/DC0%0/2
$path =~ /^\$\([^\)]+\)\Z(?!\n)/s or $path =~ m([/:>\]])
$path =~ /^\$\([^\)]+\)\Z(?!\n)/s $path =~ m([/:>\]])
Truth table0%0/3
A or B
A= $path =~ /^\$\([^\)]+\)\Z(?!\n)/sB= $path =~ m([/:>\]])
ABresult
1X1
011
000
2173 0 ▶ if ($force_path or $path =~ /(?:DIR\)|\])\Z(?!\n)/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($force_path or $path =~ /(?:DIR\)|\])\Z(?!\n)/) { } 0 0 0
Condition0%0/3
$force_path or $path =~ /(?:DIR\)|\])\Z(?!\n)/
l!l&&r!l&&!r
000
MC/DC0%0/2
$force_path or $path =~ /(?:DIR\)|\])\Z(?!\n)/
$force_path $path =~ /(?:DIR\)|\])\Z(?!\n)/
Truth table0%0/3
A or B
A= $force_pathB= $path =~ /(?:DIR\)|\])\Z(?!\n)/
ABresult
1X1
011
000
2174 0 $fixedpath = vmspath($self->eliminate_macros($path));
2175 }
2176 else {
2177 0 $fixedpath = vmsify($self->eliminate_macros($path));
2178 }
2179 }
2180 ▶ elsif ((($prefix,$name) = ($path =~ m#^\$\(([^\)]+)\)(.+)#s)) && $self->{$prefix}) {
Condition0%0/3
() = $path =~ /^\$\(([^\)]+)\)(.+)/s and $self->{$prefix}
!ll&&!rl&&r
000
MC/DC0%0/2
() = $path =~ /^\$\(([^\)]+)\)(.+)/s and $self->{$prefix}
() = $path =~ /^\$\(([^\)]+)\)(.+)/s $self->{$prefix}
Truth table0%0/3
A and B
A= () = $path =~ /^\$\(([^\)]+)\)(.+)/sB= $self->{$prefix}
ABresult
0X0
100
111
2181 0 my($vmspre) = $self->eliminate_macros("\$($prefix)");
2182 # is it a dir or just a name?
2183 0 ▶ $vmspre = ($vmspre =~ m|/| or $prefix =~ /DIR\Z(?!\n)/) ? vmspath($vmspre) : '';
Branch: 1 branch
BranchTrueFalseTotal
$vmspre =~ m[/] || $prefix =~ /DIR\Z(?!\n)/ ? : 0 0 0
Condition0%0/3
$vmspre =~ m[/] or $prefix =~ /DIR\Z(?!\n)/
l!l&&r!l&&!r
000
MC/DC0%0/2
$vmspre =~ m[/] or $prefix =~ /DIR\Z(?!\n)/
$vmspre =~ m[/] $prefix =~ /DIR\Z(?!\n)/
Truth table0%0/3
A or B
A= $vmspre =~ m[/]B= $prefix =~ /DIR\Z(?!\n)/
ABresult
1X1
011
000
2184 0 ▶ $fixedpath = ($vmspre ? $vmspre : $self->{$prefix}) . $name;
Branch: 1 branch
BranchTrueFalseTotal
$vmspre ? : 0 0 0
2185 0 ▶ $fixedpath = vmspath($fixedpath) if $force_path;
Branch: 1 branch
BranchTrueFalseTotal
if $force_path 0 0 0
2186 }
2187 else {
2188 0 $fixedpath = $path;
2189 0 ▶ $fixedpath = vmspath($fixedpath) if $force_path;
Branch: 1 branch
BranchTrueFalseTotal
if $force_path 0 0 0
2190 }
2191 # No hints, so we try to guess
2192 0 ▶ if (!defined($force_path) and $fixedpath !~ /[:>(.\]]/) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $force_path or $fixedpath =~ /[:>(.\]]/) 0 0 0
Condition0%0/3
defined $force_path or $fixedpath =~ /[:>(.\]]/
l!l&&r!l&&!r
000
MC/DC0%0/2
defined $force_path or $fixedpath =~ /[:>(.\]]/
defined $force_path $fixedpath =~ /[:>(.\]]/
Truth table0%0/3
A or B
A= defined $force_pathB= $fixedpath =~ /[:>(.\]]/
ABresult
1X1
011
000
2193 0 ▶ $fixedpath = vmspath($fixedpath) if -d $fixedpath;
Branch: 1 branch
BranchTrueFalseTotal
if -d $fixedpath 0 0 0
2194 }
2195  
2196 # Trim off root dirname if it's had other dirs inserted in front of it.
2197 0 $fixedpath =~ s/\.000000([\]>])/$1/;
2198 # Special case for VMS absolute directory specs: these will have had device
2199 # prepended during trip through Unix syntax in eliminate_macros(), since
2200 # Unix syntax has no way to express "absolute from the top of this device's
2201 # directory tree".
2202 0 ▶ if ($path =~ /^[\[>][^.\-]/) { $fixedpath =~ s/^[^\[<]+//; }
Branch: 1 branch
BranchTrueFalseTotal
if ($path =~ /^[\[>][^.\-]/) 0 0 0
2203  
2204 0 return $fixedpath;
2205 }
2206  
2207  
2208 =item os_flavor
2209  
2210 VMS is VMS.
2211  
2212 =cut
2213  
2214 sub os_flavor {
2215 0 ▶ return('VMS');
Subroutine os_flavor: not called CC=1 SCAR=6.9
Pod documented
2216 }
2217  
2218  
2219 =item is_make_type (override)
2220  
2221 None of the make types being checked for is viable on VMS,
2222 plus our $self->{MAKE} is an unexpanded (and unexpandable)
2223 macro whose value is known only to the make utility itself.
2224  
2225 =cut
2226  
2227 sub is_make_type {
2228 0 ▶ my($self, $type) = @_;
Subroutine is_make_type: not called CC=1 SCAR=6.9
Pod documented
2229 0 return 0;
2230 }
2231  
2232  
2233 =item make_type (override)
2234  
2235 Returns a suitable string describing the type of makefile being written.
2236  
2237 =cut
2238  
2239 0 ▶sub make_type { "$Config{make}-style"; }
Subroutine make_type: not called CC=1 SCAR=6.9
Pod documented
2240  
2241  
2242 =back
2243  
2244  
2245 =head1 AUTHOR
2246  
2247 Original author Charles Bailey F<bailey@newman.upenn.edu>
2248  
2249 Maintained by Michael G Schwern F<schwern@pobox.com>
2250  
2251 See L<ExtUtils::MakeMaker> for patching and contact information.
2252  
2253  
2254 =cut
2255  
2256 4 1;
2257  
« blib/lib/ExtUtils/MakeMaker/Locale.pm ↑ Summary lib/ExtUtils/MakeMaker/Locale.pm »