blib/lib/ExtUtils/CBuilder/Platform/Unix.pm

filter: Statementstmt 91.3% 21 / 23 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 79.4% 27 / 34 CC 3 SCAR 7.6
CC
3
Cov
81%
link
3.7
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« blib/lib/ExtUtils/CBuilder/Platform/cygwin.pm ↑ Summary blib/lib/ExtUtils/CBuilder/Platform/aix.pm »
1 package ExtUtils::CBuilder::Platform::Unix;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use ExtUtils::CBuilder::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use vars qw($VERSION @ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 $VERSION = '0.24_01';
8 2 @ISA = qw(ExtUtils::CBuilder::Base);
9  
10 sub link_executable {
11 1 ▶ my $self = shift;
Subroutine link_executable: called CC=1 SCAR=0.0
Pod undocumented
12  
13 # On some platforms (which ones??) $Config{cc} seems to be a better
14 # bet for linking executables than $Config{ld}. Cygwin is a notable
15 # exception.
16 local $self->{config}{ld} =
17 1 $self->{config}{cc} . " " . $self->{config}{ldflags};
18 1 return $self->SUPER::link_executable(@_);
19 }
20  
21 sub link {
22 2 ▶ my $self = shift;
Subroutine link: called CC=3 SCAR=13.0
Pod undocumented
23 2 my $cf = $self->{config};
24
25 # Some platforms (notably Mac OS X 10.3, but some others too) expect
26 # the syntax "FOO=BAR /bin/command arg arg" to work in %Config
27 # (notably $Config{ld}). It usually works in system(SCALAR), but we
28 # use system(LIST). We fix it up here with 'env'.
29
30 2 local $cf->{ld} = $cf->{ld};
31 2 ▶ if (ref $cf->{ld}) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $cf->{'ld'}) { } 0 2 2
32 0 ▶ unshift @{$cf->{ld}}, 'env' if $cf->{ld}[0] =~ /^\s*\w+=/;
Branch: 1 branch
BranchTrueFalseTotal
if $cf->{"ld"}[0] =~ /^\s*\w+=/ 0 0 0
33 } else {
34 2 $cf->{ld} =~ s/^(\s*\w+=)/env $1/;
35 }
36
37 2 return $self->SUPER::link(@_);
38 }
39  
40 2 1;
« blib/lib/ExtUtils/CBuilder/Platform/cygwin.pm ↑ Summary blib/lib/ExtUtils/CBuilder/Platform/aix.pm »