lib/ExtUtils/MM_OS2.pm

filter: Statementstmt 28.5% 18 / 63 Branchbran 0.0% 0 / 28 Conditioncond 0.0% 0 / 22 MC/DCmcdc 0.0% 0 / 14 Subroutinesub 28.5% 4 / 14 Podpod 100% 10 / 10 totaltotal 21.1% 32 / 151 CC 24 SCAR 43.5
CC
24
Cov
16%
dlsyms
182.0
maybe_command
56.0
static_lib_pure_cmd
12.0
CRAP 77.2
« lib/ExtUtils/Mksymlists.pm ↑ Summary lib/ExtUtils/MM_Unix.pm »
1 package ExtUtils::MM_OS2;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use ExtUtils::MakeMaker qw(neatvalue);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 our $VERSION = '7.78';
10 1 $VERSION =~ tr/_//d;
11  
12 1 require ExtUtils::MM_Any;
13 1 require ExtUtils::MM_Unix;
14 1 our @ISA = qw(ExtUtils::MM_Any ExtUtils::MM_Unix);
15  
16 =pod
17  
18 =head1 NAME
19  
20 ExtUtils::MM_OS2 - methods to override UN*X behaviour in ExtUtils::MakeMaker
21  
22 =head1 SYNOPSIS
23  
24 use ExtUtils::MM_OS2; # Done internally by ExtUtils::MakeMaker if needed
25  
26 =head1 DESCRIPTION
27  
28 See L<ExtUtils::MM_Unix> for a documentation of the methods provided
29 there. This package overrides the implementation of these methods, not
30 the semantics.
31  
32 =head1 METHODS
33  
34 =over 4
35  
36 =item init_dist
37  
38 Define TO_UNIX to convert OS2 linefeeds to Unix style.
39  
40 =cut
41  
42 0 ▶sub init_dist {
Subroutine init_dist: not called CC=2 SCAR=17.9
Pod documented
43 0 my($self) = @_;
44  
45 0 ▶ $self->{TO_UNIX} ||= <<'MAKE_TEXT';
Condition0%0/2
$self->{"TO_UNIX"} ||= "\$(NOECHO) \$(TEST_F) tmp.zip && \$(RM_F) tmp.zip; \$(ZIP) -ll -mr tmp.zip \$(DISTVNAME) && unzip -o tmp.zip && \$(RM_F) tmp.zip\n"
l!l
00
MC/DC0%0/1
$self->{"TO_UNIX"} ||= "\$(NOECHO) \$(TEST_F) tmp.zip && \$(RM_F) tmp.zip; \$(ZIP) -ll -mr tmp.zip \$(DISTVNAME) && unzip -o tmp.zip && \$(RM_F) tmp.zip\n"
$self->{"TO_UNIX"}
Truth table0%0/2
A
A= $self->{"TO_UNIX"}
Aresult
11
00
46 $(NOECHO) $(TEST_F) tmp.zip && $(RM_F) tmp.zip; $(ZIP) -ll -mr tmp.zip $(DISTVNAME) && unzip -o tmp.zip && $(RM_F) tmp.zip
47 MAKE_TEXT
48  
49 0 $self->SUPER::init_dist;
50 }
51  
52 0 ▶sub dlsyms {
Subroutine dlsyms: not called CC=13 SCAR=52.0
Pod documented
53 0 my($self,%attribs) = @_;
54 0 ▶ if ($self->{IMPORTS} && %{$self->{IMPORTS}}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"IMPORTS"} and %{$self->{"IMPORTS"};}) 0 0 0
Condition0%0/3
$self->{"IMPORTS"} and %{$self->{"IMPORTS"};}
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{"IMPORTS"} and %{$self->{"IMPORTS"};}
$self->{"IMPORTS"} %{$self->{"IMPORTS"};}
Truth table0%0/3
A and B
A= $self->{"IMPORTS"}B= %{$self->{"IMPORTS"};}
ABresult
0X0
100
111
55 # Make import files (needed for static build)
56 0 ▶ -d 'tmp_imp' or mkdir 'tmp_imp', 0777 or die "Can't mkdir tmp_imp";
Branch: 1 branch
BranchTrueFalseTotal
-d "tmp_imp" or mkdir "tmp_imp", 511 or die "Can't mkdir tmp_imp" 0 0 0
Condition0%0/3
-d "tmp_imp" or mkdir "tmp_imp", 511
l!l&&r!l&&!r
000
MC/DC0%0/2
-d "tmp_imp" or mkdir "tmp_imp", 511
-d "tmp_imp" mkdir "tmp_imp", 511
Truth table0%0/3
A or B
A= -d "tmp_imp"B= mkdir "tmp_imp", 511
ABresult
1X1
011
000
57 0 ▶ open my $imp, '>', 'tmpimp.imp' or die "Can't open tmpimp.imp";
Branch: 1 branch
BranchTrueFalseTotal
open my $imp, ">", "tmpimp.imp" or die "Can't open tmpimp.imp" 0 0 0
58 0 foreach my $name (sort keys %{$self->{IMPORTS}}) {
59 0 my $exp = $self->{IMPORTS}->{$name};
60 0 ▶ my ($lib, $id) = ($exp =~ /(.*)\.(.*)/) or die "Malformed IMPORT `$exp'";
Branch: 1 branch
BranchTrueFalseTotal
() = $exp =~ /(.*)\.(.*)/ or die "Malformed IMPORT `${exp}'" 0 0 0
61 0 print $imp "$name $lib $id ?\n";
62 }
63 0 ▶ close $imp or die "Can't close tmpimp.imp";
Branch: 1 branch
BranchTrueFalseTotal
close $imp or die "Can't close tmpimp.imp" 0 0 0
64 # print "emximp -o tmpimp$Config::Config{lib_ext} tmpimp.imp\n";
65 0 ▶ system "emximp -o tmpimp$Config::Config{lib_ext} tmpimp.imp"
Branch: 1 branch
BranchTrueFalseTotal
system qq[emximp -o tmpimp$Config::Config{"lib_ext"} tmpimp.imp] and die "Cannot make import library: $!, \$?=$?" 0 0 0
66 and die "Cannot make import library: $!, \$?=$?";
67 # May be running under miniperl, so have no glob...
68 0 ▶ eval { unlink <tmp_imp/*>; 1 } or system "rm tmp_imp/*";
Branch: 1 branch
BranchTrueFalseTotal
eval { do { unlink glob("tmp_imp/*"); 1 } } or system "rm tmp_imp/*" 0 0 0
69 0 ▶ system "cd tmp_imp; $Config::Config{ar} x ../tmpimp$Config::Config{lib_ext}"
Branch: 1 branch
BranchTrueFalseTotal
system qq[cd tmp_imp; $Config::Config{"ar"} x ../tmpimp$Config::Config{"lib_ext"}] and die "Cannot extract import objects: $!, \$?=$?" 0 0 0
70 and die "Cannot extract import objects: $!, \$?=$?";
71 }
72 0 ▶ return '' if $self->{SKIPHASH}{'dynamic'};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"SKIPHASH"}{"dynamic"} 0 0 0
73 0 $self->xs_dlsyms_iterator(\%attribs);
74 }
75  
76 0 ▶sub xs_dlsyms_ext {
Subroutine xs_dlsyms_ext: not called CC=1 SCAR=6.9
Pod documented
77 0 '.def';
78 }
79  
80 0 ▶sub xs_dlsyms_extra {
Subroutine xs_dlsyms_extra: not called CC=1 SCAR=6.9
Pod documented
81 0 join '', map { qq{, "$_" => "\$($_)"} } qw(VERSION DISTNAME INSTALLDIRS);
82 }
83  
84 0 ▶sub static_lib_pure_cmd {
Subroutine static_lib_pure_cmd: not called CC=3 SCAR=24.8
Pod documented
85 0 my($self) = @_;
86 0 my $old = $self->SUPER::static_lib_pure_cmd;
87 0 ▶ return $old unless $self->{IMPORTS} && %{$self->{IMPORTS}};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"IMPORTS"} and %{$self->{"IMPORTS"};} 0 0 0
Condition0%0/3
$self->{"IMPORTS"} and %{$self->{"IMPORTS"};}
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{"IMPORTS"} and %{$self->{"IMPORTS"};}
$self->{"IMPORTS"} %{$self->{"IMPORTS"};}
Truth table0%0/3
A and B
A= $self->{"IMPORTS"}B= %{$self->{"IMPORTS"};}
ABresult
0X0
100
111
88 0 $old . <<'EOC';
89 $(AR) $(AR_STATIC_ARGS) "$@" tmp_imp/*
90 $(RANLIB) "$@"
91 EOC
92 }
93  
94 0 ▶sub replace_manpage_separator {
Subroutine replace_manpage_separator: not called CC=1 SCAR=6.9
Pod documented
95 0 my($self,$man) = @_;
96 0 $man =~ s,/+,.,g;
97 0 $man;
98 }
99  
100 0 ▶sub maybe_command {
Subroutine maybe_command: not called CC=7 SCAR=40.3
Pod documented
101 0 my($self,$file) = @_;
102 0 $file =~ s,[/\\]+,/,g;
103 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
104 0 ▶ return "$file.exe" if -x "$file.exe" && ! -d _;
Branch: 1 branch
BranchTrueFalseTotal
if -x "$file.exe" and not -d _ 0 0 0
Condition0%0/3
-x "$file.exe" and not -d _
!ll&&!rl&&r
000
MC/DC0%0/2
-x "$file.exe" and not -d _
-x "$file.exe" not -d _
Truth table0%0/3
A and not(B)
A= -x "$file.exe"B= not -d _
ABresult
0X0
100
111
105 0 ▶ return "$file.cmd" if -x "$file.cmd" && ! -d _;
Branch: 1 branch
BranchTrueFalseTotal
if -x "$file.cmd" and not -d _ 0 0 0
Condition0%0/3
-x "$file.cmd" and not -d _
!ll&&!rl&&r
000
MC/DC0%0/2
-x "$file.cmd" and not -d _
-x "$file.cmd" not -d _
Truth table0%0/3
A and not(B)
A= -x "$file.cmd"B= not -d _
ABresult
0X0
100
111
106 0 return;
107 }
108  
109 =item init_linker
110  
111 =cut
112  
113 0 ▶sub init_linker {
Subroutine init_linker: not called CC=3 SCAR=24.8
Pod documented
114 0 my $self = shift;
115  
116 0 $self->{PERL_ARCHIVE} = "\$(PERL_INC)/libperl\$(LIB_EXT)";
117  
118 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
119 0 ▶ $self->{PERL_ARCHIVE_AFTER} = $OS2::is_aout
Branch: 1 branch
BranchTrueFalseTotal
$OS2::is_aout ? : 0 0 0
120 ? ''
121 : '$(PERL_INC)/libperl_override$(LIB_EXT)';
122 0 $self->{EXPORT_LIST} = '$(BASEEXT).def';
123 }
124  
125 =item os_flavor
126  
127 OS/2 is OS/2
128  
129 =cut
130  
131 0 ▶sub os_flavor {
Subroutine os_flavor: not called CC=1 SCAR=6.9
Pod documented
132 0 return('OS/2');
133 }
134  
135 =item xs_static_lib_is_xs
136  
137 =cut
138  
139 0 ▶sub xs_static_lib_is_xs {
Subroutine xs_static_lib_is_xs: not called CC=1 SCAR=6.9
Pod documented
140 0 return 1;
141 }
142  
143 =back
144  
145 =cut
146  
147 1 1;
« lib/ExtUtils/Mksymlists.pm ↑ Summary lib/ExtUtils/MM_Unix.pm »