| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#line 1 |
|
2
|
|
|
|
|
|
|
package Module::Install::Can; |
|
3
|
1
|
|
|
1
|
|
4
|
|
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
27
|
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
14
|
|
|
5
|
1
|
|
|
1
|
|
4
|
use Module::Install::Base; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
|
|
use Config (); |
|
7
|
|
|
|
|
|
|
### This adds a 5.005 Perl version dependency. |
|
8
|
1
|
|
|
1
|
|
6
|
### This is a bug and will be fixed. |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
11
|
|
|
9
|
1
|
|
|
1
|
|
12
|
use File::Spec (); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
|
|
use ExtUtils::MakeMaker (); |
|
11
|
1
|
|
|
1
|
|
4
|
|
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
68
|
|
|
12
|
|
|
|
|
|
|
use vars qw{$VERSION $ISCORE @ISA}; |
|
13
|
1
|
|
|
1
|
|
2
|
BEGIN { |
|
14
|
1
|
|
|
|
|
2
|
$VERSION = '0.65'; |
|
15
|
1
|
|
|
|
|
510
|
$ISCORE = 1; |
|
16
|
|
|
|
|
|
|
@ISA = qw{Module::Install::Base}; |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# check if we can load some module |
|
20
|
|
|
|
|
|
|
### Upgrade this to not have to load the module if possible |
|
21
|
0
|
|
|
0
|
0
|
|
sub can_use { |
|
22
|
0
|
|
|
|
|
|
my ($self, $mod, $ver) = @_; |
|
23
|
0
|
0
|
|
|
|
|
$mod =~ s{::|\\}{/}g; |
|
24
|
|
|
|
|
|
|
$mod .= '.pm' unless $mod =~ /\.pm$/i; |
|
25
|
0
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
my $pkg = $mod; |
|
27
|
0
|
|
|
|
|
|
$pkg =~ s{/}{::}g; |
|
28
|
|
|
|
|
|
|
$pkg =~ s{\.pm$}{}i; |
|
29
|
0
|
|
|
|
|
|
|
|
30
|
0
|
|
0
|
|
|
|
local $@; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
eval { require $mod; $pkg->VERSION($ver || 0); 1 }; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# check if we can run some command |
|
35
|
0
|
|
|
0
|
0
|
|
sub can_run { |
|
36
|
|
|
|
|
|
|
my ($self, $cmd) = @_; |
|
37
|
0
|
|
|
|
|
|
|
|
38
|
0
|
0
|
0
|
|
|
|
my $_cmd = $cmd; |
|
39
|
|
|
|
|
|
|
return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); |
|
40
|
0
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { |
|
42
|
0
|
0
|
0
|
|
|
|
my $abs = File::Spec->catfile($dir, $_[1]); |
|
43
|
|
|
|
|
|
|
return $abs if (-x $abs or $abs = MM->maybe_command($abs)); |
|
44
|
|
|
|
|
|
|
} |
|
45
|
0
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
return; |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# can we locate a (the) C compiler |
|
50
|
0
|
|
|
0
|
0
|
|
sub can_cc { |
|
51
|
0
|
0
|
|
|
|
|
my $self = shift; |
|
52
|
|
|
|
|
|
|
my @chunks = split(/ /, $Config::Config{cc}) or return; |
|
53
|
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
# $Config{cc} may contain args; try to find out the program part |
|
55
|
0
|
|
0
|
|
|
|
while (@chunks) { |
|
56
|
|
|
|
|
|
|
return $self->can_run("@chunks") || (pop(@chunks), next); |
|
57
|
|
|
|
|
|
|
} |
|
58
|
0
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
return; |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# Fix Cygwin bug on maybe_command(); |
|
63
|
|
|
|
|
|
|
if ( $^O eq 'cygwin' ) { |
|
64
|
|
|
|
|
|
|
require ExtUtils::MM_Cygwin; |
|
65
|
|
|
|
|
|
|
require ExtUtils::MM_Win32; |
|
66
|
|
|
|
|
|
|
if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) { |
|
67
|
|
|
|
|
|
|
*ExtUtils::MM_Cygwin::maybe_command = sub { |
|
68
|
|
|
|
|
|
|
my ($self, $file) = @_; |
|
69
|
|
|
|
|
|
|
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) { |
|
70
|
|
|
|
|
|
|
ExtUtils::MM_Win32->maybe_command($file); |
|
71
|
|
|
|
|
|
|
} else { |
|
72
|
|
|
|
|
|
|
ExtUtils::MM_Unix->maybe_command($file); |
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
} |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__END__ |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
#line 157 |