| 1 | #!perl | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use Config; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use ExtUtils::Embed; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | my ($coredir, $libdir); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | if ($ENV{PERL_CORE}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 0 | ▶ | $libdir = $coredir = $^O eq 'MSWin32'? '../../lib/CORE' : '../..'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | $libdir = $Config{prefix} . "/lib"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | $coredir = $ENV{PERL_SRC} || $Config{archlib}."/CORE"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$ENV{'PERL_SRC'} || $Config{'archlib'} . '/CORE'
MC/DC0%0/1
$ENV{'PERL_SRC'} || $Config{'archlib'} . '/CORE'
$ENV{'PERL_SRC'}
Truth table50%1/2
A
A= $ENV{'PERL_SRC'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | my $useshrplib = $Config{useshrplib} =~ /^(true|yes)$/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | my $libs = $Config{libs}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | my $so = $Config{so}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 1 | my $libperl = $Config{libperl}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | my ($linkargs, $quiet, $debug); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | my $pkg = ($Config{usecperl} and $libperl =~ /libcperl/) ? "cperl" : "perl"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$Config{"usecperl"} and $libperl =~ /libcperl/
MC/DC0%0/2
$Config{"usecperl"} and $libperl =~ /libcperl/
$Config{"usecperl"}
$libperl =~ /libcperl/
Truth table33%1/3
A and B
A= $Config{"usecperl"}B= $libperl =~ /libcperl/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | if (grep {$_ eq '-q' or $_ eq '--quiet'} @ARGV) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$_ eq '-q' || $_ eq '--quiet'
MC/DC50%1/2
$_ eq '-q' || $_ eq '--quiet'
$_ eq '-q'
$_ eq '--quiet'
Truth table66%2/3
A || B
A= $_ eq '-q'B= $_ eq '--quiet'
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | $quiet++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | @ARGV = grep {$_ ne '-q' and $_ ne '--quiet'} @ARGV; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$_ ne '-q' && $_ ne '--quiet'
MC/DC50%1/2
$_ ne '-q' && $_ ne '--quiet'
$_ ne '-q'
$_ ne '--quiet'
Truth table66%2/3
A && B
A= $_ ne '-q'B= $_ ne '--quiet'
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | ▶ | if (grep {$_ eq '-d' or $_ eq '--debug'} @ARGV) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$_ eq '-d' || $_ eq '--debug'
MC/DC0%0/2
$_ eq '-d' || $_ eq '--debug'
$_ eq '-d'
$_ eq '--debug'
Truth table33%1/3
A || B
A= $_ eq '-d'B= $_ eq '--debug'
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | $debug++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | @ARGV = grep {$_ ne '-d' and $_ ne '--debug'} @ARGV; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$_ ne '-d' && $_ ne '--debug'
MC/DC0%0/2
$_ ne '-d' && $_ ne '--debug'
$_ ne '-d'
$_ ne '--debug'
Truth table0%0/3
A && B
A= $_ ne '-d'B= $_ ne '--debug'
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 1 | ▶ | if (grep {$_ eq '-A'} @ARGV) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | @ARGV = grep {$_ ne '-A'} @ARGV; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | push @ARGV, '-DALLOW_PERL_OPTIONS'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 1 | eval { require B::C::Config; }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 1 | ▶ | if (grep(/^-[cES]$/, @ARGV)) { # compile-only with -c -E or -S | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | ; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | } elsif (grep(/^-Bdynamic$/, @ARGV)) { # force dynamic linking with -Bdynamic | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | @ARGV = grep{ !/^-Bdynamic$/o } @ARGV; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | $linkargs = ldopts; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | } elsif (grep(/^-Bstatic$/, @ARGV)) { # force static linking with -Bstatic | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | @ARGV = grep{ !/^-Bstatic$/o } @ARGV; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | $linkargs = ldopts("-std"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | for my $lib ("$libdir/lib$pkg.a", "$coredir/lib$pkg.a") { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | if (-e $lib) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | $linkargs =~ s|-l$pkg |$lib |; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | ▶ | push @ARGV, ("$coredir/DynaLoader.o") if -e "$coredir/DynaLoader.o"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | #$linkargs .= " $coredir/Win32CORE.o" if $^O eq 'cygwin' and -e "$coredir/Win32CORE.o"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | ▶ | } elsif (-e "$coredir/$libperl" and $libperl !~ /\.$so$/) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
-e "$coredir/$libperl" and not $libperl =~ /\.$so$/
MC/DC0%0/2
-e "$coredir/$libperl" and not $libperl =~ /\.$so$/
-e "$coredir/$libperl"
not $libperl =~ /\.$so$/
Truth table33%1/3
A and not(B)
A= -e "$coredir/$libperl"B= not $libperl =~ /\.$so$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 1 | $linkargs = ldopts("-std"); # importlib or static | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | ▶ | } elsif ( $useshrplib and -e "$libdir/$libperl") { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$useshrplib and -e "$libdir/$libperl"
MC/DC0%0/2
$useshrplib and -e "$libdir/$libperl"
$useshrplib
-e "$libdir/$libperl"
Truth table0%0/3
A and B
A= $useshrplibB= -e "$libdir/$libperl"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | # debian: /usr/lib/libperl.so.5.10.1 and broken ExtUtils::Embed::ldopts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | $linkargs = ldopts('-std'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | $linkargs =~ s|-lc?perl |$libdir/$libperl |; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | ▶ | } elsif ( $useshrplib and -e "$coredir/$libperl") { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$useshrplib and -e "$coredir/$libperl"
MC/DC0%0/2
$useshrplib and -e "$coredir/$libperl"
$useshrplib
-e "$coredir/$libperl"
Truth table0%0/3
A and B
A= $useshrplibB= -e "$coredir/$libperl"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | # just help cygwin debugging | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | $linkargs = ldopts('-std'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | $linkargs =~ s|-lc?perl |$coredir/$libperl |; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } else { # try dynamic lib if no static lib exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | @ARGV = grep{ !/^-Bdynamic$/o } @ARGV; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | $linkargs = ldopts('-std'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | # Note (probably harmless): No library found for -lnsl | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | # another ldopts bug: ensure Win32CORE gets added. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 1 | ▶ | if ($^O =~ /^(cygwin|MSWin32|msys)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | ▶ | if (index($linkargs, "Win32CORE") < 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | my $archdir = $ENV{PERL_CORE} ? "../.." : $Config{archlib}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | my $win32core = "-L$archdir/lib/auto/Win32CORE -lWin32CORE"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | if (-e "$archdir/lib/auto/Win32CORE/Win32CORE.a") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | $win32core = "$archdir/lib/auto/Win32CORE/Win32CORE.a"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | if ($linkargs =~ m{ (-lc?perl|\S*/$libperl)}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | $linkargs =~ s{ (-lc?perl|\S*/$libperl)}{ $win32core $1}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | $linkargs .= " $win32core"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 1 | ▶ | $linkargs .= " -L".$coredir if $ENV{PERL_CORE}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 1 | ▶ | $linkargs .= " -l$pkg" unless $linkargs =~ /( -lc?perl|CORE\/libc?perl)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 1 | $linkargs = $B::C::Config::extra_libs . " " . $linkargs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 1 | ▶ | $linkargs .= " $libs" if index($linkargs,$libs) == -1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | ▶ | sub cc_harness_msvc { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cc_harness_msvc: not called CC=25 SCAR=64.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | my @ARGV = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | my $cfile = 'a.c'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | my $Output; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | for my $i (0 .. @ARGV) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | ▶ | if ($ARGV[$i] eq '-o') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | $Output = $ARGV[$i+1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | my @cfile = grep {!/^-/} @ARGV; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | if (@cfile == 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | $cfile = $cfile[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | } elsif (@cfile > 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | die "too many arguments @cfile"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | my $obj = $cfile; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | $obj =~ s/\.c$/.obj/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | unless ($Output) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | $Output = $cfile; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | $Output =~ s/\.c$/.exe/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | my $compile = ccopts()." -c @ARGV "; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | if ($debug) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | $compile .= "/Wall " if !$quiet; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | # remove conflicting flags | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | $compile .= "-g "; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | $compile =~ s/ -O.? / -Od /; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | $compile =~ s/ -DNDEBUG / -DDEBUG /; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | # avoid expensive optimisations with low memory (1-2 hours!) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | $compile .= " -Od" if $ENV{APPVEYOR} and $^O eq 'MSWin32'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$ENV{"APPVEYOR"} and $^O eq "MSWin32"
MC/DC0%0/2
$ENV{"APPVEYOR"} and $^O eq "MSWin32"
$ENV{"APPVEYOR"}
$^O eq "MSWin32"
Truth table0%0/3
A and B
A= $ENV{"APPVEYOR"}B= $^O eq "MSWin32"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | if ($ENV{PERL_CORE} and $Config{ccflags} =~ /-flto/) { # too big | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$ENV{"PERL_CORE"} and $Config{"ccflags"} =~ /-flto/
MC/DC0%0/2
$ENV{"PERL_CORE"} and $Config{"ccflags"} =~ /-flto/
$ENV{"PERL_CORE"}
$Config{"ccflags"} =~ /-flto/
Truth table0%0/3
A and B
A= $ENV{"PERL_CORE"}B= $Config{"ccflags"} =~ /-flto/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | $compile =~ s/-O\d / -O1 /; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | $compile .= "-DHAVE_INDEPENDENT_COMALLOC " if $B::C::Config::have_independent_comalloc; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | $compile .= $B::C::Config::extra_cflags; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | $compile = ' -I"..\..\lib\CORE"'.$compile if $ENV{PERL_CORE}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | ▶ | print "running $Config{cc} $compile" unless $quiet; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | system("$Config{cc} $compile"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | my $link = "-out:$Output $obj "; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | $link .= " -libpath:".$coredir if $ENV{PERL_CORE}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | # TODO: -shared,-static,-sharedxs,-staticxs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | $link .= (" ".$B::C::Config::extra_libs); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | if ($stash) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | my @mods = split /-?u /, $stash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | $link .= " ".ldopts("-std", \@mods); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | $link .= " ".ldopts("-std"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | $link .= " ".$Config{optimize}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | if ($debug) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | $link .= " /DEBUG"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | # avoid expensive folding with low memory | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | $link .= " /OPT:NOREF" if $ENV{APPVEYOR} and $^O eq 'MSWin32'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$ENV{"APPVEYOR"} and $^O eq "MSWin32"
MC/DC0%0/2
$ENV{"APPVEYOR"} and $^O eq "MSWin32"
$ENV{"APPVEYOR"}
$^O eq "MSWin32"
Truth table0%0/3
A and B
A= $ENV{"APPVEYOR"}B= $^O eq "MSWin32"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | ▶ | if (index($link, "Win32CORE") < 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | my $archdir = $ENV{PERL_CORE} ? "../.." : $Config{archlib}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | my $win32core = "-L$archdir/lib/auto/Win32CORE -lWin32CORE"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | ▶ | if (-e "$archdir/lib/auto/Win32CORE/Win32CORE.lib") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | $win32core = "$archdir/lib/auto/Win32CORE/Win32CORE.lib"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | $link .= " $win32core"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | ▶ | $link .= " ".($Config{usecperl}?"c":"")."perl5$Config{PERL_VERSION}.lib"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | $link .= " kernel32.lib msvcrt.lib"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | ▶ | print "running $Config{ld} $link" unless $quiet; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | system("$Config{ld} $link"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 1 | ▶ | if ($^O eq 'MSWin32' && $Config{cc} =~ 'cl') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$^O eq "MSWin32" and $Config{"cc"} =~ /cl/
MC/DC0%0/2
$^O eq "MSWin32" and $Config{"cc"} =~ /cl/
$^O eq "MSWin32"
$Config{"cc"} =~ /cl/
Truth table33%1/3
A and B
A= $^O eq "MSWin32"B= $Config{"cc"} =~ /cl/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | cc_harness_msvc(@ARGV); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | exit; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | # ActivePerl 5.10.0.1004 claims to use MSVC6 but used MSVC8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | #if ($Config::Config{ccversion} eq '12.0.8804' and $Config::Config{cc} eq 'cl') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | # $linkargs =~ s/ -opt:ref,icf//; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | #} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 1 | my $ccflags = $Config{optimize}." ".$Config{ccflags}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | # crashes on cygwin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 1 | ▶ | if ($^O eq 'cygwin' and $ccflags =~ /-fstack-protector / | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$^O eq "cygwin" and $ccflags =~ /-fstack-protector / and $linkargs =~ /-fstack-protector /
$^O eq "cygwin" and $ccflags =~ /-fstack-protector /
MC/DC0%0/3
$^O eq "cygwin" and $ccflags =~ /-fstack-protector / and $linkargs =~ /-fstack-protector /
$^O eq "cygwin"
$ccflags =~ /-fstack-protector /
$linkargs =~ /-fstack-protector /
Truth table25%1/4
A and B and C
A= $^O eq "cygwin"B= $ccflags =~ /-fstack-protector /C= $linkargs =~ /-fstack-protector /
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | and $linkargs =~ /-fstack-protector /) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | $linkargs =~ s/-fstack-protector //; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | #-pedantic -Wextra -Wconversion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 1 | ▶ | if ($debug and $Config{cc} =~ /\bgcc/ and $Config{gccversion}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$debug and $Config{"cc"} =~ /\bgcc/ and $Config{"gccversion"}
$debug and $Config{"cc"} =~ /\bgcc/
MC/DC0%0/3
$debug and $Config{"cc"} =~ /\bgcc/ and $Config{"gccversion"}
$debug
$Config{"cc"} =~ /\bgcc/
$Config{"gccversion"}
Truth table25%1/4
A and B and C
A= $debugB= $Config{"cc"} =~ /\bgcc/C= $Config{"gccversion"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 0 | ▶ | $ccflags .= " -ansi -Wall -Wshadow -Wcast-qual -Wwrite-strings" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | if !$quiet; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | # remove conflicting flags, esp. -s for strip | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | $ccflags =~ s/ -O.? / /; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | $ccflags =~ s/ -s / /; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | $linkargs =~ s/-s / /; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | # -Wl,--warn-once is not gold compatible | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | $ccflags .= " --no-warn" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 1 | ▶ | if $Config{cc} =~ /\bgcc/ and $Config{gccversion} and $quiet and $^O ne 'darwin'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
$Config{"cc"} =~ /\bgcc/ and $Config{"gccversion"} and $quiet and $^O ne "darwin"
$Config{"cc"} =~ /\bgcc/ and $Config{"gccversion"} and $quiet
$Config{"cc"} =~ /\bgcc/ and $Config{"gccversion"}
MC/DC0%0/4
$Config{"cc"} =~ /\bgcc/ and $Config{"gccversion"} and $quiet and $^O ne "darwin"
$Config{"cc"} =~ /\bgcc/
$Config{"gccversion"}
$quiet
$^O ne "darwin"
Truth table20%1/5
A and B and C and D
A= $Config{"cc"} =~ /\bgcc/B= $Config{"gccversion"}C= $quietD= $^O ne "darwin"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 1 | ▶ | $ccflags .= " -DHAVE_INDEPENDENT_COMALLOC" if $B::C::Config::have_independent_comalloc; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 1 | $ccflags .= $B::C::Config::extra_cflags; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 1 | my $cccmd = "$Config{cc} $ccflags -I$coredir @ARGV $linkargs"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 1 | ▶ | print "$cccmd\n" unless $quiet; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 1 | exec $cccmd; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||