lib/ExtUtils/MM_Cygwin.pm

filter: Statementstmt 27.2% 18 / 66 Branchbran 0.0% 0 / 28 Conditioncond 0.0% 0 / 17 MC/DCmcdc 0.0% 0 / 10 Subroutinesub 33.3% 4 / 12 Podpod 100% 8 / 8 totaltotal 21.2% 30 / 141 CC 23 SCAR 34.6
CC
23
Cov
16%
init_linker
56.0
cflags
42.0
install
42.0
CRAP 31.7
« lib/ExtUtils/MM_Any.pm ↑ Summary lib/ExtUtils/MM_OS390.pm »
1 package ExtUtils::MM_Cygwin;
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::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 require ExtUtils::MM_Unix;
10 1 require ExtUtils::MM_Win32;
11 1 our @ISA = qw( ExtUtils::MM_Unix );
12  
13 1 our $VERSION = '7.78';
14 1 $VERSION =~ tr/_//d;
15  
16  
17 =head1 NAME
18  
19 ExtUtils::MM_Cygwin - methods to override UN*X behaviour in ExtUtils::MakeMaker
20  
21 =head1 SYNOPSIS
22  
23 use ExtUtils::MM_Cygwin; # Done internally by ExtUtils::MakeMaker if needed
24  
25 =head1 DESCRIPTION
26  
27 See L<ExtUtils::MM_Unix> for a documentation of the methods provided there.
28  
29 =over 4
30  
31 =item os_flavor
32  
33 We're Unix and Cygwin.
34  
35 =cut
36  
37 0 ▶sub os_flavor {
Subroutine os_flavor: not called CC=1 SCAR=6.9
Pod documented
38 0 return('Unix', 'Cygwin');
39 }
40  
41 =item cflags
42  
43 if configured for dynamic loading, triggers #define EXT in EXTERN.h
44  
45 =cut
46  
47 0 ▶sub cflags {
Subroutine cflags: not called CC=6 SCAR=37.4
Pod documented
48 0 my($self,$libperl)=@_;
49 0 ▶ return $self->{CFLAGS} if $self->{CFLAGS};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"CFLAGS"} 0 0 0
50 0 ▶ return '' unless $self->needs_linking();
Branch: 1 branch
BranchTrueFalseTotal
unless $self->needs_linking 0 0 0
51  
52 0 my $base = $self->SUPER::cflags($libperl);
53 0 foreach (split /\n/, $base) {
54 0 ▶ /^(\S*)\s*=\s*(\S*)$/ and $self->{$1} = $2;
Branch: 1 branch
BranchTrueFalseTotal
/^(\S*)\s*=\s*(\S*)$/ and $self->{$1} = $2 0 0 0
55 };
56 0 ▶ $self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true');
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_Cygwin::Config{"useshrplib"} eq "true" 0 0 0
57  
58 0 return $self->{CFLAGS} = qq{
59 CCFLAGS = $self->{CCFLAGS}
60 OPTIMIZE = $self->{OPTIMIZE}
61 PERLTYPE = $self->{PERLTYPE}
62 };
63  
64 }
65  
66  
67 =item replace_manpage_separator
68  
69 replaces strings '::' with '.' in MAN*POD man page names
70  
71 =cut
72  
73 0 ▶sub replace_manpage_separator {
Subroutine replace_manpage_separator: not called CC=1 SCAR=6.9
Pod documented
74 0 my($self, $man) = @_;
75 0 $man =~ s{/+}{.}g;
76 0 return $man;
77 }
78  
79 =item init_linker
80  
81 points to libperl.a
82  
83 =cut
84  
85 0 ▶sub init_linker {
Subroutine init_linker: not called CC=7 SCAR=40.3
Pod documented
86 0 my $self = shift;
87  
88 0 ▶ if ($Config{useshrplib} eq 'true') {
Branch: 1 branch
BranchTrueFalseTotal
if ($ExtUtils::MM_Cygwin::Config{'useshrplib'} eq 'true') { } 0 0 0
89 0 my $libperl = '$(PERL_INC)' .'/'. "$Config{libperl}";
90 0 ▶ if( "$]" >= 5.006002 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ("$]" >= "5.006002") 0 0 0
91 0 $libperl =~ s/(dll\.)?a$/dll.a/;
92 }
93 0 $self->{PERL_ARCHIVE} = $libperl;
94 } else {
95 $self->{PERL_ARCHIVE} =
96 0 ▶ '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a");
Condition0%0/2
"$ExtUtils::MM_Cygwin::Config{'libperl'}" || 'libperl.a'
l!l
00
MC/DC0%0/1
"$ExtUtils::MM_Cygwin::Config{'libperl'}" || 'libperl.a'
"$ExtUtils::MM_Cygwin::Config{'libperl'}"
Truth table0%0/2
A
A= "$ExtUtils::MM_Cygwin::Config{'libperl'}"
Aresult
11
00
97 }
98  
99 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
100 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
101 0 ▶ $self->{EXPORT_LIST} ||= '';
Condition0%0/2
$self->{"EXPORT_LIST"} ||= ""
l!l
00
MC/DC0%0/1
$self->{"EXPORT_LIST"} ||= ""
$self->{"EXPORT_LIST"}
Truth table0%0/2
A
A= $self->{"EXPORT_LIST"}
Aresult
11
00
102 }
103  
104 0 ▶sub init_others {
Subroutine init_others: not called CC=2 SCAR=17.9
Pod documented
105 0 my $self = shift;
106  
107 0 $self->SUPER::init_others;
108  
109 0 ▶ $self->{LDLOADLIBS} ||= $Config{perllibs};
Condition0%0/3
$self->{"LDLOADLIBS"} ||= $ExtUtils::MM_Cygwin::Config{"perllibs"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"LDLOADLIBS"} ||= $ExtUtils::MM_Cygwin::Config{"perllibs"}
$self->{"LDLOADLIBS"} $ExtUtils::MM_Cygwin::Config{"perllibs"}
Truth table0%0/3
A ||= B
A= $self->{"LDLOADLIBS"}B= $ExtUtils::MM_Cygwin::Config{"perllibs"}
ABresult
1X1
011
000
110  
111 0 return;
112 }
113  
114 =item maybe_command
115  
116 Determine whether a file is native to Cygwin by checking whether it
117 resides inside the Cygwin installation (using Windows paths). If so,
118 use L<ExtUtils::MM_Unix> to determine if it may be a command.
119 Otherwise use the tests from L<ExtUtils::MM_Win32>.
120  
121 =cut
122  
123 0 ▶sub maybe_command {
Subroutine maybe_command: not called CC=2 SCAR=17.9
Pod documented
124 0 my ($self, $file) = @_;
125  
126 0 my $cygpath = Cygwin::posix_to_win_path('/', 1);
127 0 my $filepath = Cygwin::posix_to_win_path($file, 1);
128  
129 0 ▶ return (substr($filepath,0,length($cygpath)) eq $cygpath)
Branch: 1 branch
BranchTrueFalseTotal
substr($filepath, 0, length $cygpath) eq $cygpath ? : 0 0 0
130 ? $self->SUPER::maybe_command($file) # Unix
131 : ExtUtils::MM_Win32->maybe_command($file); # Win32
132 }
133  
134 =item dynamic_lib
135  
136 Use the default to produce the *.dll's.
137 But for new archdir dll's use the same rebase address if the old exists.
138  
139 =cut
140  
141 0 ▶sub dynamic_lib {
Subroutine dynamic_lib: not called CC=5 SCAR=34.0
Pod documented
142 0 my($self, %attribs) = @_;
143 0 my $s = ExtUtils::MM_Unix::dynamic_lib($self, %attribs);
144 0 ▶ return '' unless $s;
Branch: 1 branch
BranchTrueFalseTotal
unless $s 0 0 0
145 0 ▶ return $s unless %{$self->{XS}};
Branch: 1 branch
BranchTrueFalseTotal
unless %{$self->{"XS"};} 0 0 0
146  
147 # do an ephemeral rebase so the new DLL fits to the current rebase map
148 0 ▶ $s .= "\t/bin/find \$\(INST_ARCHLIB\)/auto -xdev -name \\*.$self->{DLEXT} | /bin/rebase -sOT -" if (( $Config{myarchname} eq 'i686-cygwin' ) and not ( exists $ENV{CYGPORT_PACKAGE_VERSION} ));
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin" and not exists $ENV{"CYGPORT_PACKAGE_VERSION"} 0 0 0
Condition0%0/3
$ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin" and not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
!ll&&!rl&&r
000
MC/DC0%0/2
$ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin" and not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
$ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin" not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
Truth table0%0/3
A and not(B)
A= $ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin"B= not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
ABresult
0X0
100
111
149 0 $s;
150 }
151  
152 =item install
153  
154 Rebase dll's with the global rebase database after installation.
155  
156 =cut
157  
158 0 ▶sub install {
Subroutine install: not called CC=6 SCAR=37.4
Pod documented
159 0 my($self, %attribs) = @_;
160 0 my $s = ExtUtils::MM_Unix::install($self, %attribs);
161 0 ▶ return '' unless $s;
Branch: 1 branch
BranchTrueFalseTotal
unless $s 0 0 0
162 0 ▶ return $s unless %{$self->{XS}};
Branch: 1 branch
BranchTrueFalseTotal
unless %{$self->{"XS"};} 0 0 0
163  
164 0 my $INSTALLDIRS = $self->{INSTALLDIRS};
165 0 ▶ my $INSTALLLIB = $self->{"INSTALL". ($INSTALLDIRS eq 'perl' ? 'ARCHLIB' : uc($INSTALLDIRS)."ARCH")};
Branch: 1 branch
BranchTrueFalseTotal
$INSTALLDIRS eq 'perl' ? : 0 0 0
166 0 my $dop = "\$\(DESTDIR\)$INSTALLLIB/auto/";
167 0 my $dll = "$dop/$self->{FULLEXT}/$self->{BASEEXT}.$self->{DLEXT}";
168 0 ▶ $s =~ s|^(pure_install :: pure_\$\(INSTALLDIRS\)_install\n\t)\$\(NOECHO\) \$\(NOOP\)\n|$1\$(CHMOD) \$(PERM_RWX) $dll\n\t/bin/find $dop -xdev -name \\*.$self->{DLEXT} \| /bin/rebase -sOT -\n|m if (( $Config{myarchname} eq 'i686-cygwin') and not ( exists $ENV{CYGPORT_PACKAGE_VERSION} ));
Branch: 1 branch
BranchTrueFalseTotal
if $ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin" and not exists $ENV{"CYGPORT_PACKAGE_VERSION"} 0 0 0
Condition0%0/3
$ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin" and not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
!ll&&!rl&&r
000
MC/DC0%0/2
$ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin" and not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
$ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin" not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
Truth table0%0/3
A and not(B)
A= $ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin"B= not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
ABresult
0X0
100
111
169 0 $s;
170 }
171  
172 =back
173  
174 =cut
175  
176 1 1;
« lib/ExtUtils/MM_Any.pm ↑ Summary lib/ExtUtils/MM_OS390.pm »