| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Alien::Build::Interpolate::Default; |
|
2
|
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
226339
|
use strict; |
|
|
11
|
|
|
|
|
33
|
|
|
|
11
|
|
|
|
|
352
|
|
|
4
|
11
|
|
|
11
|
|
59
|
use warnings; |
|
|
11
|
|
|
|
|
22
|
|
|
|
11
|
|
|
|
|
307
|
|
|
5
|
11
|
|
|
11
|
|
203
|
use 5.008004; |
|
|
11
|
|
|
|
|
42
|
|
|
6
|
11
|
|
|
11
|
|
499
|
use parent qw( Alien::Build::Interpolate ); |
|
|
11
|
|
|
|
|
337
|
|
|
|
11
|
|
|
|
|
96
|
|
|
7
|
11
|
|
|
11
|
|
1427
|
use File::chdir; |
|
|
11
|
|
|
|
|
4784
|
|
|
|
11
|
|
|
|
|
1109
|
|
|
8
|
11
|
|
|
11
|
|
988
|
use File::Which qw( which ); |
|
|
11
|
|
|
|
|
2151
|
|
|
|
11
|
|
|
|
|
511
|
|
|
9
|
11
|
|
|
11
|
|
618
|
use Capture::Tiny qw( capture ); |
|
|
11
|
|
|
|
|
25567
|
|
|
|
11
|
|
|
|
|
15271
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ABSTRACT: Default interpolator for Alien::Build |
|
12
|
|
|
|
|
|
|
our $VERSION = '2.46'; # VERSION |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _config |
|
15
|
|
|
|
|
|
|
{ |
|
16
|
0
|
|
|
0
|
|
0
|
$Config::Config{$_[0]}; |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new |
|
21
|
|
|
|
|
|
|
{ |
|
22
|
69
|
|
|
69
|
1
|
25214
|
my($class) = @_; |
|
23
|
69
|
|
|
|
|
362
|
my $self = $class->SUPER::new(@_); |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
69
|
|
|
0
|
|
506
|
$self->add_helper( ar => sub { _config 'ar' }, 'Config' ); |
|
|
0
|
|
|
|
|
0
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$self->add_helper( bison => undef, sub { |
|
30
|
2
|
|
|
2
|
|
3
|
my $helper = shift; |
|
31
|
2
|
100
|
|
|
|
6
|
if(which 'bison') |
|
32
|
|
|
|
|
|
|
{ |
|
33
|
1
|
|
|
|
|
11
|
$helper->code(sub { 'bison' }); |
|
|
1
|
|
|
|
|
4
|
|
|
34
|
1
|
|
|
|
|
3
|
return (); |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
else |
|
37
|
|
|
|
|
|
|
{ |
|
38
|
1
|
|
|
|
|
11
|
return 'Alien::bison' => '0.17'; |
|
39
|
|
|
|
|
|
|
} |
|
40
|
69
|
|
|
|
|
454
|
}); |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$self->add_helper( bzip2 => undef, sub { |
|
44
|
0
|
|
|
0
|
|
0
|
my $helper = shift; |
|
45
|
0
|
0
|
|
|
|
0
|
if(which 'bzip2') |
|
46
|
|
|
|
|
|
|
{ |
|
47
|
0
|
|
|
|
|
0
|
$helper->code( sub { 'bzip2' }); |
|
|
0
|
|
|
|
|
0
|
|
|
48
|
0
|
|
|
|
|
0
|
return (); |
|
49
|
|
|
|
|
|
|
} |
|
50
|
|
|
|
|
|
|
else |
|
51
|
|
|
|
|
|
|
{ |
|
52
|
0
|
|
|
|
|
0
|
return 'Alien::Libbz2' => '0.04'; |
|
53
|
|
|
|
|
|
|
} |
|
54
|
69
|
|
|
|
|
425
|
}); |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
|
57
|
69
|
|
|
0
|
|
383
|
$self->add_helper( cc => sub { _config 'cc' }, 'Config' ); |
|
|
0
|
|
|
|
|
0
|
|
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
|
60
|
0
|
|
|
0
|
|
0
|
$self->add_helper( cmake => sub { 'cmake' }, sub { |
|
61
|
0
|
0
|
|
0
|
|
0
|
if(which 'cmake') |
|
62
|
|
|
|
|
|
|
{ |
|
63
|
0
|
|
|
|
|
0
|
return (); |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
else |
|
66
|
|
|
|
|
|
|
{ |
|
67
|
0
|
|
|
|
|
0
|
return 'Alien::CMake' => '0.07'; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
69
|
|
|
|
|
464
|
}); |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
|
72
|
69
|
|
|
0
|
|
375
|
$self->add_helper( cp => sub { _config 'cp' }, 'Config' ); |
|
|
0
|
|
|
|
|
0
|
|
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
|
75
|
69
|
0
|
|
0
|
|
364
|
$self->add_helper( devnull => sub { $^O eq 'MSWin32' ? 'NUL' : '/dev/null' }); |
|
|
0
|
|
|
|
|
0
|
|
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
$self->add_helper( flex => undef, sub { |
|
79
|
0
|
|
|
0
|
|
0
|
my $helper = shift; |
|
80
|
0
|
0
|
|
|
|
0
|
if(which 'flex') |
|
81
|
|
|
|
|
|
|
{ |
|
82
|
0
|
|
|
|
|
0
|
$helper->code(sub { 'flex' }); |
|
|
0
|
|
|
|
|
0
|
|
|
83
|
0
|
|
|
|
|
0
|
return (); |
|
84
|
|
|
|
|
|
|
} |
|
85
|
|
|
|
|
|
|
else |
|
86
|
|
|
|
|
|
|
{ |
|
87
|
0
|
|
|
|
|
0
|
return 'Alien::flex' => '0.08'; |
|
88
|
|
|
|
|
|
|
} |
|
89
|
69
|
|
|
|
|
540
|
}); |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
|
92
|
69
|
|
|
|
|
247
|
$self->add_helper( gmake => undef, 'Alien::gmake' => '0.11' ); |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
|
95
|
69
|
|
|
0
|
|
393
|
$self->add_helper( install => sub { 'install' }); |
|
|
0
|
|
|
|
|
0
|
|
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
|
98
|
69
|
|
|
0
|
|
353
|
$self->add_helper( ld => sub { _config 'ld' }, 'Config' ); |
|
|
0
|
|
|
|
|
0
|
|
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
101
|
69
|
|
|
|
|
272
|
$self->add_helper( m4 => undef, 'Alien::m4' => '0.08' ); |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
|
104
|
69
|
50
|
|
|
|
261
|
if($^O eq 'MSWin32') |
|
105
|
|
|
|
|
|
|
{ |
|
106
|
|
|
|
|
|
|
# TL;DR: dmake is bad, and shouldn't be used to build anything but older |
|
107
|
|
|
|
|
|
|
# versions of Windows Perl that don't support gmake. |
|
108
|
0
|
|
|
|
|
0
|
my $perl_make = _config 'make'; |
|
109
|
0
|
|
|
|
|
0
|
my $my_make; |
|
110
|
|
|
|
|
|
|
$self->add_helper( make => sub { |
|
111
|
0
|
0
|
|
0
|
|
0
|
return $my_make if defined $my_make; |
|
112
|
|
|
|
|
|
|
|
|
113
|
0
|
0
|
0
|
|
|
0
|
if( $perl_make ne 'dmake' && which $perl_make ) |
|
114
|
|
|
|
|
|
|
{ |
|
115
|
|
|
|
|
|
|
# assume if it is called nmake or gmake that it really is what it |
|
116
|
|
|
|
|
|
|
# says it is. |
|
117
|
0
|
0
|
0
|
|
|
0
|
if( $perl_make eq 'nmake' || $perl_make eq 'gmake' ) |
|
118
|
|
|
|
|
|
|
{ |
|
119
|
0
|
|
|
|
|
0
|
return $my_make = $perl_make; |
|
120
|
|
|
|
|
|
|
} |
|
121
|
|
|
|
|
|
|
|
|
122
|
0
|
|
|
|
|
0
|
my $out = capture { system $perl_make, '--version' }; |
|
|
0
|
|
|
|
|
0
|
|
|
123
|
0
|
0
|
0
|
|
|
0
|
if( $out =~ /GNU make/i || $out =~ /Microsoft \(R\) Program Maintenance/ ) |
|
124
|
|
|
|
|
|
|
{ |
|
125
|
0
|
|
|
|
|
0
|
return $my_make = $perl_make; |
|
126
|
|
|
|
|
|
|
} |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
} |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
# if we see something that looks like it might be gmake, use that. |
|
131
|
0
|
|
|
|
|
0
|
foreach my $try (qw( gmake mingw32-make )) |
|
132
|
|
|
|
|
|
|
{ |
|
133
|
0
|
0
|
|
|
|
0
|
return $my_make = $try if which $try; |
|
134
|
|
|
|
|
|
|
} |
|
135
|
|
|
|
|
|
|
|
|
136
|
0
|
0
|
|
|
|
0
|
if( which 'make' ) |
|
137
|
|
|
|
|
|
|
{ |
|
138
|
0
|
|
|
|
|
0
|
my $out = capture { system 'make', '--version' }; |
|
|
0
|
|
|
|
|
0
|
|
|
139
|
0
|
0
|
0
|
|
|
0
|
if( $out =~ /GNU make/i || $out =~ /Microsoft \(R\) Program Maintenance/ ) |
|
140
|
|
|
|
|
|
|
{ |
|
141
|
0
|
|
|
|
|
0
|
return $my_make = 'make'; |
|
142
|
|
|
|
|
|
|
} |
|
143
|
|
|
|
|
|
|
} |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
# if we see something that looks like it might be nmake, use that. |
|
146
|
0
|
|
|
|
|
0
|
foreach my $try (qw( nmake )) |
|
147
|
|
|
|
|
|
|
{ |
|
148
|
0
|
0
|
|
|
|
0
|
return $my_make = $try if which $try; |
|
149
|
|
|
|
|
|
|
} |
|
150
|
|
|
|
|
|
|
|
|
151
|
0
|
|
|
|
|
0
|
$my_make = $perl_make; |
|
152
|
0
|
|
|
|
|
0
|
}); |
|
153
|
|
|
|
|
|
|
} |
|
154
|
|
|
|
|
|
|
else |
|
155
|
|
|
|
|
|
|
{ |
|
156
|
69
|
|
|
0
|
|
408
|
$self->add_helper( make => sub { _config 'make' }, 'Config' ); |
|
|
0
|
|
|
|
|
0
|
|
|
157
|
|
|
|
|
|
|
} |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
|
|
160
|
69
|
50
|
|
1
|
|
394
|
$self->add_helper( mkdir_deep => sub { $^O eq 'MSWin32' ? 'md' : 'mkdir -p'}, 'Alien::Build' => '1.04' ); |
|
|
1
|
|
|
|
|
9
|
|
|
161
|
69
|
50
|
|
4
|
|
334
|
$self->add_helper( make_path => sub { $^O eq 'MSWin32' ? 'md' : 'mkdir -p'}, 'Alien::Build' => '1.05' ); |
|
|
4
|
|
|
|
|
29
|
|
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
$self->add_helper( nasm => undef, sub { |
|
165
|
0
|
|
|
0
|
|
0
|
my $helper = shift; |
|
166
|
0
|
0
|
|
|
|
0
|
if(which 'nasm') |
|
167
|
|
|
|
|
|
|
{ |
|
168
|
0
|
|
|
|
|
0
|
$helper->code(sub { 'nasm' }); |
|
|
0
|
|
|
|
|
0
|
|
|
169
|
0
|
|
|
|
|
0
|
return (); |
|
170
|
|
|
|
|
|
|
} |
|
171
|
|
|
|
|
|
|
else |
|
172
|
|
|
|
|
|
|
{ |
|
173
|
0
|
|
|
|
|
0
|
return 'Alien::nasm' => '0.11'; |
|
174
|
|
|
|
|
|
|
} |
|
175
|
69
|
|
|
|
|
440
|
}); |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
$self->add_helper( patch => undef, sub { |
|
179
|
0
|
|
|
0
|
|
0
|
my $helper = shift; |
|
180
|
0
|
0
|
|
|
|
0
|
if(which 'patch') |
|
181
|
|
|
|
|
|
|
{ |
|
182
|
0
|
0
|
|
|
|
0
|
if($^O eq 'MSWin32') |
|
183
|
|
|
|
|
|
|
{ |
|
184
|
0
|
|
|
|
|
0
|
$helper->code(sub { 'patch --binary' }); |
|
|
0
|
|
|
|
|
0
|
|
|
185
|
|
|
|
|
|
|
} |
|
186
|
|
|
|
|
|
|
else |
|
187
|
|
|
|
|
|
|
{ |
|
188
|
0
|
|
|
|
|
0
|
$helper->code(sub { 'patch' }); |
|
|
0
|
|
|
|
|
0
|
|
|
189
|
|
|
|
|
|
|
} |
|
190
|
0
|
|
|
|
|
0
|
return (); |
|
191
|
|
|
|
|
|
|
} |
|
192
|
|
|
|
|
|
|
else |
|
193
|
|
|
|
|
|
|
{ |
|
194
|
0
|
|
|
|
|
0
|
return 'Alien::patch' => '0.09'; |
|
195
|
|
|
|
|
|
|
} |
|
196
|
69
|
|
|
|
|
471
|
}); |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
$self->add_helper( perl => sub { |
|
200
|
0
|
|
|
0
|
|
0
|
my $perl = Devel::FindPerl::find_perl_interpreter(); |
|
201
|
0
|
0
|
|
|
|
0
|
$perl =~ s{\\}{/}g if $^O eq 'MSWin32'; |
|
202
|
0
|
|
|
|
|
0
|
$perl; |
|
203
|
69
|
|
|
|
|
382
|
}, 'Devel::FindPerl' ); |
|
204
|
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
|
|
206
|
69
|
|
|
|
|
254
|
$self->add_helper( pkgconf => undef, 'Alien::pkgconf' => 0.06 ); |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
$self->add_helper( cwd => sub { |
|
210
|
1
|
|
|
1
|
|
8
|
my $cwd = "$CWD"; |
|
211
|
1
|
50
|
|
|
|
33
|
$cwd =~ s{\\}{/}g if $^O eq 'MSWin32'; |
|
212
|
1
|
|
|
|
|
5
|
$cwd; |
|
213
|
69
|
|
|
|
|
412
|
} ); |
|
214
|
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
|
|
216
|
69
|
|
|
0
|
|
428
|
$self->add_helper( sh => sub { 'sh' }, 'Alien::MSYS' => '0.07' ); |
|
|
0
|
|
|
|
|
0
|
|
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
|
|
219
|
69
|
|
|
0
|
|
427
|
$self->add_helper( rm => sub { _config 'rm' }, 'Config' ); |
|
|
0
|
|
|
|
|
0
|
|
|
220
|
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
$self->add_helper( xz => undef, sub { |
|
224
|
0
|
|
|
0
|
|
0
|
my $helper = shift; |
|
225
|
0
|
0
|
|
|
|
0
|
if(which 'xz') |
|
226
|
|
|
|
|
|
|
{ |
|
227
|
0
|
|
|
|
|
0
|
$helper->code(sub { 'xz' }); |
|
|
0
|
|
|
|
|
0
|
|
|
228
|
0
|
|
|
|
|
0
|
return (); |
|
229
|
|
|
|
|
|
|
} |
|
230
|
|
|
|
|
|
|
else |
|
231
|
|
|
|
|
|
|
{ |
|
232
|
0
|
|
|
|
|
0
|
return 'Alien::xz' => '0.02'; |
|
233
|
|
|
|
|
|
|
} |
|
234
|
69
|
|
|
|
|
419
|
}); |
|
235
|
|
|
|
|
|
|
|
|
236
|
69
|
|
|
|
|
235
|
$self; |
|
237
|
|
|
|
|
|
|
} |
|
238
|
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
1; |
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
__END__ |