lib/ExtUtils/MM_OS2.pm

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