line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::Build::Plugin::Core::Setup; |
2
|
|
|
|
|
|
|
|
3
|
48
|
|
|
48
|
|
715377
|
use strict; |
|
48
|
|
|
|
|
106
|
|
|
48
|
|
|
|
|
1536
|
|
4
|
48
|
|
|
48
|
|
307
|
use warnings; |
|
48
|
|
|
|
|
174
|
|
|
48
|
|
|
|
|
1272
|
|
5
|
48
|
|
|
48
|
|
1073
|
use 5.008004; |
|
48
|
|
|
|
|
181
|
|
6
|
48
|
|
|
48
|
|
3923
|
use Alien::Build::Plugin; |
|
48
|
|
|
|
|
124
|
|
|
48
|
|
|
|
|
442
|
|
7
|
48
|
|
|
48
|
|
319
|
use Config; |
|
48
|
|
|
|
|
121
|
|
|
48
|
|
|
|
|
2435
|
|
8
|
48
|
|
|
48
|
|
15798
|
use File::Which qw( which ); |
|
48
|
|
|
|
|
35782
|
|
|
48
|
|
|
|
|
19624
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: Core setup plugin |
11
|
|
|
|
|
|
|
our $VERSION = '2.45'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub init |
15
|
|
|
|
|
|
|
{ |
16
|
337
|
|
|
337
|
1
|
935
|
my($self, $meta) = @_; |
17
|
337
|
|
50
|
|
|
1018
|
$meta->prop->{platform} ||= {}; |
18
|
337
|
|
|
|
|
943
|
$self->_platform($meta->prop->{platform}); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _platform |
22
|
|
|
|
|
|
|
{ |
23
|
338
|
|
|
338
|
|
971
|
my(undef, $hash) = @_; |
24
|
|
|
|
|
|
|
|
25
|
338
|
50
|
33
|
|
|
1697
|
if($^O eq 'MSWin32' && $Config{ccname} eq 'cl') |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
|
|
0
|
$hash->{compiler_type} = 'microsoft'; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
else |
30
|
|
|
|
|
|
|
{ |
31
|
338
|
|
|
|
|
1164
|
$hash->{compiler_type} = 'unix'; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
338
|
50
|
|
|
|
1763
|
if($^O eq 'MSWin32') |
|
|
50
|
|
|
|
|
|
35
|
|
|
|
|
|
|
{ |
36
|
0
|
|
|
|
|
0
|
$hash->{system_type} = 'windows-unknown'; |
37
|
|
|
|
|
|
|
|
38
|
0
|
0
|
|
|
|
0
|
if(defined &Win32::BuildNumber) |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
39
|
|
|
|
|
|
|
{ |
40
|
0
|
|
|
|
|
0
|
$hash->{system_type} = 'windows-activestate'; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
elsif($Config{myuname} =~ /strawberry-perl/) |
43
|
|
|
|
|
|
|
{ |
44
|
0
|
|
|
|
|
0
|
$hash->{system_type} = 'windows-strawberry'; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
elsif($hash->{compiler_type} eq 'microsoft') |
47
|
|
|
|
|
|
|
{ |
48
|
0
|
|
|
|
|
0
|
$hash->{system_type} = 'windows-microsoft'; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
else |
51
|
|
|
|
|
|
|
{ |
52
|
0
|
|
|
|
|
0
|
my $uname_exe = which('uname'); |
53
|
0
|
0
|
|
|
|
0
|
if($uname_exe) |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
|
|
0
|
my $uname = `$uname_exe`; |
56
|
0
|
0
|
|
|
|
0
|
if($uname =~ /^(MINGW)(32|64)_NT/) |
57
|
|
|
|
|
|
|
{ |
58
|
0
|
|
|
|
|
0
|
$hash->{system_type} = 'windows-' . lc $1; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
elsif($^O =~ /^(VMS)$/) |
64
|
|
|
|
|
|
|
{ |
65
|
|
|
|
|
|
|
# others probably belong in here... |
66
|
0
|
|
|
|
|
0
|
$hash->{system_type} = lc $^O; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
else |
69
|
|
|
|
|
|
|
{ |
70
|
338
|
|
|
|
|
1158
|
$hash->{system_type} = 'unix'; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
__END__ |