« blib/lib/Alien/Build/Plugin/Fetch/HTTPTiny.pm
↑ Summary
blib/lib/Alien/Build/Plugin/Fetch/NetFTP.pm »
| 1 | package Alien::Build::Plugin::Core::Setup; | ||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||
| 3 | 58 | ▶ | use strict; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 4 | 58 | ▶ | use warnings; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 5 | 58 | ▶ | use 5.008004; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 6 | 58 | ▶ | use Alien::Build::Plugin; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 7 | 58 | ▶ | use Config; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 8 | 58 | ▶ | use File::Which qw( which ); | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||
| 10 | # ABSTRACT: Core setup plugin | ||||||||||||||||||||||||||||||
| 11 | 58 | our $VERSION = '2.88'; # VERSION | |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||
| 14 | sub init | ||||||||||||||||||||||||||||||
| 15 | 399 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
init: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||||
| 16 | 399 | my($self, $meta) = @_; | |||||||||||||||||||||||||||||
| 17 | 399 | ▶ | $meta->prop->{platform} ||= {}; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$meta->prop->{"platform"} ||= {}
MC/DC0%0/1
$meta->prop->{"platform"} ||= {}
$meta->prop->{"platform"}
Truth table50%1/2
A
A= $meta->prop->{"platform"}
| |||||||||||||||||||||||||||||||
| 18 | 399 | $self->_platform($meta->prop->{platform}); | |||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||
| 21 | sub _platform | ||||||||||||||||||||||||||||||
| 22 | 400 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
_platform: called CC=12 SCAR=38.6
| |||||||||||||||||||||||||||||||
| 23 | 400 | my(undef, $hash) = @_; | |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||
| 25 | 400 | ▶ | if($^O eq 'MSWin32' && $Config{ccname} eq 'cl') | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$^O eq "MSWin32" and $Alien::Build::Plugin::Core::Setup::Config{"ccname"} eq "cl"
MC/DC0%0/2
$^O eq "MSWin32" and $Alien::Build::Plugin::Core::Setup::Config{"ccname"} eq "cl"
$^O eq "MSWin32"
$Alien::Build::Plugin::Core::Setup::Config{"ccname"} eq "cl"
Truth table33%1/3
A and B
A= $^O eq "MSWin32"B= $Alien::Build::Plugin::Core::Setup::Config{"ccname"} eq "cl"
| |||||||||||||||||||||||||||||||
| 26 | { | ||||||||||||||||||||||||||||||
| 27 | 0 | $hash->{compiler_type} = 'microsoft'; | |||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||
| 29 | else | ||||||||||||||||||||||||||||||
| 30 | { | ||||||||||||||||||||||||||||||
| 31 | 400 | $hash->{compiler_type} = 'unix'; | |||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||
| 34 | 400 | ▶ | if($^O eq 'MSWin32') | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 35 | { | ||||||||||||||||||||||||||||||
| 36 | 0 | $hash->{system_type} = 'windows-unknown'; | |||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | if(defined &Win32::BuildNumber) | ||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||
| 39 | { | ||||||||||||||||||||||||||||||
| 40 | 0 | $hash->{system_type} = 'windows-activestate'; | |||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||
| 42 | elsif($Config{myuname} =~ /strawberry-perl/) | ||||||||||||||||||||||||||||||
| 43 | { | ||||||||||||||||||||||||||||||
| 44 | 0 | $hash->{system_type} = 'windows-strawberry'; | |||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||
| 46 | elsif($hash->{compiler_type} eq 'microsoft') | ||||||||||||||||||||||||||||||
| 47 | { | ||||||||||||||||||||||||||||||
| 48 | 0 | $hash->{system_type} = 'windows-microsoft'; | |||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||
| 50 | else | ||||||||||||||||||||||||||||||
| 51 | { | ||||||||||||||||||||||||||||||
| 52 | 0 | my $uname_exe = which('uname'); | |||||||||||||||||||||||||||||
| 53 | 0 | ▶ | if($uname_exe) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 54 | { | ||||||||||||||||||||||||||||||
| 55 | 0 | my $uname = `$uname_exe`; | |||||||||||||||||||||||||||||
| 56 | 0 | ▶ | if($uname =~ /^(MINGW)(32|64)_NT/) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 57 | { | ||||||||||||||||||||||||||||||
| 58 | 0 | $hash->{system_type} = 'windows-' . lc $1; | |||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||
| 63 | elsif($^O =~ /^(VMS)$/) | ||||||||||||||||||||||||||||||
| 64 | { | ||||||||||||||||||||||||||||||
| 65 | # others probably belong in here... | ||||||||||||||||||||||||||||||
| 66 | 0 | $hash->{system_type} = lc $^O; | |||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||
| 68 | else | ||||||||||||||||||||||||||||||
| 69 | { | ||||||||||||||||||||||||||||||
| 70 | 400 | $hash->{system_type} = 'unix'; | |||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||
| 73 | $hash->{cpu}{count} = | ||||||||||||||||||||||||||||||
| 74 | exists $ENV{ALIEN_CPU_COUNT} && $ENV{ALIEN_CPU_COUNT} > 0 | ||||||||||||||||||||||||||||||
| 75 | ? $ENV{ALIEN_CPU_COUNT} | ||||||||||||||||||||||||||||||
| 76 | 400 | ▶ | : _cpu_count(); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
exists $ENV{"ALIEN_CPU_COUNT"} and $ENV{"ALIEN_CPU_COUNT"} > 0
MC/DC100%2/2
exists $ENV{"ALIEN_CPU_COUNT"} and $ENV{"ALIEN_CPU_COUNT"} > 0
exists $ENV{"ALIEN_CPU_COUNT"}
$ENV{"ALIEN_CPU_COUNT"} > 0
Truth table100%3/3
A and B
A= exists $ENV{"ALIEN_CPU_COUNT"}B= $ENV{"ALIEN_CPU_COUNT"} > 0
| |||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||
| 78 | 400 | $hash->{cpu}{arch} = _cpu_arch(\%Config); | |||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||
| 81 | # Retrieve number of available CPU cores. Adopted from | ||||||||||||||||||||||||||||||
| 82 | # <https://metacpan.org/release/MARIOROY/MCE-1.879/source/lib/MCE/Util.pm#L49> | ||||||||||||||||||||||||||||||
| 83 | # which is in turn adopted from Test::Smoke::Util with improvements. | ||||||||||||||||||||||||||||||
| 84 | 398 | ▶ | sub _cpu_count { | ||||||||||||||||||||||||||||
|
Subroutine
_cpu_count: called CC=29 SCAR=61.5
| |||||||||||||||||||||||||||||||
| 85 | 398 | local $ENV{PATH} = $ENV{PATH}; | |||||||||||||||||||||||||||||
| 86 | 398 | ▶ | if( $^O ne 'MSWin32' ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 87 | 398 | $ENV{PATH} = "/usr/sbin:/sbin:/usr/bin:/bin:$ENV{PATH}"; | |||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||||
| 89 | 398 | $ENV{PATH} =~ /(.*)/; $ENV{PATH} = $1; ## Remove tainted'ness | |||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||
| 91 | 398 | my $ncpu = 1; | |||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||
| 93 | OS_CHECK: { | ||||||||||||||||||||||||||||||
| 94 | 398 | local $_ = lc $^O; | |||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||
| 96 | 398 | ▶ | /linux/ && do { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 97 | 398 | my ( $count, $fh ); | |||||||||||||||||||||||||||||
| 98 | 398 | ▶ | if ( open $fh, '<', '/proc/stat' ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 99 | 398 | $count = grep { /^cpu\d/ } <$fh>; | |||||||||||||||||||||||||||||
| 100 | 398 | close $fh; | |||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||
| 102 | 398 | ▶ | $ncpu = $count if $count; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 103 | 398 | last OS_CHECK; | |||||||||||||||||||||||||||||
| 104 | }; | ||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | /bsd|darwin|dragonfly/ && do { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 107 | 0 | chomp( my @output = `sysctl -n hw.ncpu 2>/dev/null` ); | |||||||||||||||||||||||||||||
| 108 | 0 | ▶ | $ncpu = $output[0] if @output; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 109 | 0 | last OS_CHECK; | |||||||||||||||||||||||||||||
| 110 | }; | ||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||
| 112 | 0 | ▶ | /aix/ && do { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 113 | 0 | my @output = `lparstat -i 2>/dev/null | grep "^Online Virtual CPUs"`; | |||||||||||||||||||||||||||||
| 114 | 0 | ▶ | if ( @output ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 115 | 0 | $output[0] =~ /(\d+)\n$/; | |||||||||||||||||||||||||||||
| 116 | 0 | ▶ | $ncpu = $1 if $1; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | if ( !$ncpu ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 119 | 0 | @output = `pmcycles -m 2>/dev/null`; | |||||||||||||||||||||||||||||
| 120 | 0 | ▶ | if ( @output ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 121 | 0 | $ncpu = scalar @output; | |||||||||||||||||||||||||||||
| 122 | } else { | ||||||||||||||||||||||||||||||
| 123 | 0 | @output = `lsdev -Cc processor -S Available 2>/dev/null`; | |||||||||||||||||||||||||||||
| 124 | 0 | ▶ | $ncpu = scalar @output if @output; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||
| 127 | 0 | last OS_CHECK; | |||||||||||||||||||||||||||||
| 128 | }; | ||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | /gnu/ && do { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 131 | 0 | chomp( my @output = `nproc 2>/dev/null` ); | |||||||||||||||||||||||||||||
| 132 | 0 | ▶ | $ncpu = $output[0] if @output; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 133 | 0 | last OS_CHECK; | |||||||||||||||||||||||||||||
| 134 | }; | ||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | /haiku/ && do { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 137 | 0 | my @output = `sysinfo -cpu 2>/dev/null | grep "^CPU #"`; | |||||||||||||||||||||||||||||
| 138 | 0 | ▶ | $ncpu = scalar @output if @output; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 139 | 0 | last OS_CHECK; | |||||||||||||||||||||||||||||
| 140 | }; | ||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | /hp-?ux/ && do { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 143 | 0 | my $count = grep { /^processor/ } `ioscan -fkC processor 2>/dev/null`; | |||||||||||||||||||||||||||||
| 144 | 0 | ▶ | $ncpu = $count if $count; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 145 | 0 | last OS_CHECK; | |||||||||||||||||||||||||||||
| 146 | }; | ||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||
| 148 | 0 | ▶ | /irix/ && do { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 149 | 0 | my @out = grep { /\s+processors?$/i } `hinv -c processor 2>/dev/null`; | |||||||||||||||||||||||||||||
| 150 | 0 | ▶ | $ncpu = (split ' ', $out[0])[0] if @out; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 151 | 0 | last OS_CHECK; | |||||||||||||||||||||||||||||
| 152 | }; | ||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | /osf|solaris|sunos|svr5|sco/ && do { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | if (-x '/usr/sbin/psrinfo') { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 156 | 0 | my $count = grep { /on-?line/ } `psrinfo 2>/dev/null`; | |||||||||||||||||||||||||||||
| 157 | 0 | ▶ | $ncpu = $count if $count; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||
| 159 | else { | ||||||||||||||||||||||||||||||
| 160 | 0 | my @output = grep { /^NumCPU = \d+/ } `uname -X 2>/dev/null`; | |||||||||||||||||||||||||||||
| 161 | 0 | ▶ | $ncpu = (split ' ', $output[0])[2] if @output; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||
| 163 | 0 | last OS_CHECK; | |||||||||||||||||||||||||||||
| 164 | }; | ||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||
| 166 | 0 | ▶ | /mswin|mingw|msys|cygwin/ && do { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | if (exists $ENV{NUMBER_OF_PROCESSORS}) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 168 | 0 | $ncpu = $ENV{NUMBER_OF_PROCESSORS}; | |||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||
| 170 | 0 | last OS_CHECK; | |||||||||||||||||||||||||||||
| 171 | }; | ||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||
| 173 | 0 | warn "CPU count: unknown operating system"; | |||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||
| 176 | 398 | ▶ | $ncpu = 1 if (!$ncpu || $ncpu < 1); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not $ncpu or $ncpu < 1
MC/DC0%0/2
not $ncpu or $ncpu < 1
not $ncpu
$ncpu < 1
Truth table33%1/3
not(A) or B
A= not $ncpuB= $ncpu < 1
| |||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||
| 178 | 398 | $ncpu; | |||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||
| 181 | 400 | ▶ | sub _cpu_arch { | ||||||||||||||||||||||||||||
|
Subroutine
_cpu_arch: called CC=17 SCAR=50.6
| |||||||||||||||||||||||||||||||
| 182 | 400 | my ($my_config) = @_; | |||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||
| 184 | 400 | my $arch = {}; | |||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||
| 186 | 400 | my %Config = %$my_config; | |||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||
| 188 | 400 | ▶ | die "Config missing archname" unless exists $Config{archname}; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 189 | 400 | ▶ | die "Config missing ptrsize" unless exists $Config{ptrsize}; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||
| 191 | 400 | ▶ | if( $Config{archname} =~ m/ | ||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||
| 192 | \b x64 \b # MSWin32-x64 | ||||||||||||||||||||||||||||||
| 193 | | \b x86_64 \b # x86_64-linux | ||||||||||||||||||||||||||||||
| 194 | | \b amd64 \b # amd64-freebsd | ||||||||||||||||||||||||||||||
| 195 | /ix) { | ||||||||||||||||||||||||||||||
| 196 | 400 | $arch = { name => 'x86_64' }; | |||||||||||||||||||||||||||||
| 197 | } elsif( $Config{archname} =~ m/ | ||||||||||||||||||||||||||||||
| 198 | \b x86 \b # MSWin32-x86 | ||||||||||||||||||||||||||||||
| 199 | | \b i386 \b # freebsd-i386 | ||||||||||||||||||||||||||||||
| 200 | | \b i486 \b # i486-linux | ||||||||||||||||||||||||||||||
| 201 | | \b i686 \b # i686-cygwin | ||||||||||||||||||||||||||||||
| 202 | | \b i86pc \b # i86pc-solaris, i86pc-solaris-thread-multi-64 | ||||||||||||||||||||||||||||||
| 203 | /ix ) { | ||||||||||||||||||||||||||||||
| 204 | 0 | $arch = { name => 'x86' }; | |||||||||||||||||||||||||||||
| 205 | } elsif( $Config{archname} =~ m/ | ||||||||||||||||||||||||||||||
| 206 | \b darwin \b | ||||||||||||||||||||||||||||||
| 207 | /ix ) { | ||||||||||||||||||||||||||||||
| 208 | 0 | chomp( my $hw_machine = `sysctl -n hw.machine 2>/dev/null` ); | |||||||||||||||||||||||||||||
| 209 | HW_MACHINE: | ||||||||||||||||||||||||||||||
| 210 | 0 | for($hw_machine) { | |||||||||||||||||||||||||||||
| 211 | 0 | ▶ | $_ eq 'arm64' && do { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 212 | 0 | $arch = { name => 'aarch64' }; | |||||||||||||||||||||||||||||
| 213 | 0 | last HW_MACHINE; | |||||||||||||||||||||||||||||
| 214 | }; | ||||||||||||||||||||||||||||||
| 215 | 0 | ▶ | $_ eq 'x86_64' && do { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | $arch = { name => $Config{ptrsize} == 8 ? 'x86_64' : 'x86' }; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 217 | 0 | last HW_MACHINE; | |||||||||||||||||||||||||||||
| 218 | }; | ||||||||||||||||||||||||||||||
| 219 | 0 | ▶ | $_ eq 'i386' && do { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 220 | 0 | $arch = { name => 'x86' }; | |||||||||||||||||||||||||||||
| 221 | 0 | last HW_MACHINE; | |||||||||||||||||||||||||||||
| 222 | }; | ||||||||||||||||||||||||||||||
| 223 | 0 | ▶ | $_ eq 'Power Macintosh' && do { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 224 | 0 | ▶ | $arch = { name => $Config{ptrsize} == 8 ? 'ppc64' : 'ppc' }; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 225 | 0 | last HW_MACHINE; | |||||||||||||||||||||||||||||
| 226 | }; | ||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||
| 228 | 0 | warn "Architecture detection: unknown macOS arch hw.machine = $_, ptrsize = $Config{ptrsize}"; | |||||||||||||||||||||||||||||
| 229 | 0 | $arch = { name => 'unknown' }; | |||||||||||||||||||||||||||||
| 230 | } | ||||||||||||||||||||||||||||||
| 231 | } elsif( $Config{archname} =~ / | ||||||||||||||||||||||||||||||
| 232 | \b aarch64 \b | ||||||||||||||||||||||||||||||
| 233 | | \b arm64 \b # arm64-freebsd (FreeBSD can have either aarch64 or arm64) | ||||||||||||||||||||||||||||||
| 234 | /ix ) { | ||||||||||||||||||||||||||||||
| 235 | 0 | $arch = { name => 'aarch64' }; # ARM64 | |||||||||||||||||||||||||||||
| 236 | } elsif( $Config{archname} =~ m/ | ||||||||||||||||||||||||||||||
| 237 | \b arm-linux-gnueabi \b | ||||||||||||||||||||||||||||||
| 238 | /ix ) { | ||||||||||||||||||||||||||||||
| 239 | # 32-bit ARM soft-float | ||||||||||||||||||||||||||||||
| 240 | 0 | $arch = { name => 'armel' }; | |||||||||||||||||||||||||||||
| 241 | } elsif( $Config{archname} =~ m/ | ||||||||||||||||||||||||||||||
| 242 | \b arm-linux-gnueabihf \b | ||||||||||||||||||||||||||||||
| 243 | /ix ) { | ||||||||||||||||||||||||||||||
| 244 | # 32-bit ARM hard-float | ||||||||||||||||||||||||||||||
| 245 | 0 | $arch = { name => 'armhf' }; | |||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||
| 248 | 400 | ▶ | unless(exists $arch->{name}) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 249 | 0 | warn "Architecture detection: Unknown archname '$Config{archname}'."; | |||||||||||||||||||||||||||||
| 250 | 0 | $arch->{name} = 'unknown'; | |||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||
| 253 | 400 | return $arch; | |||||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||
| 256 | 58 | 1; | |||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||||
| 258 | __END__ | ||||||||||||||||||||||||||||||