line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ExtUtils::MM; |
2
|
|
|
|
|
|
|
|
3
|
52
|
|
|
52
|
|
531785
|
use strict; |
|
52
|
|
|
|
|
427
|
|
|
52
|
|
|
|
|
1645
|
|
4
|
52
|
|
|
52
|
|
940
|
use warnings; |
|
52
|
|
|
|
|
135
|
|
|
52
|
|
|
|
|
1632
|
|
5
|
52
|
|
|
52
|
|
11630
|
use ExtUtils::MakeMaker::Config; |
|
52
|
|
|
|
|
148
|
|
|
52
|
|
|
|
|
546
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '7.66'; |
8
|
|
|
|
|
|
|
$VERSION =~ tr/_//d; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
require ExtUtils::Liblist; |
11
|
|
|
|
|
|
|
require ExtUtils::MakeMaker; |
12
|
|
|
|
|
|
|
our @ISA = qw(ExtUtils::Liblist ExtUtils::MakeMaker); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
ExtUtils::MM - OS adjusted ExtUtils::MakeMaker subclass |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
require ExtUtils::MM; |
21
|
|
|
|
|
|
|
my $mm = MM->new(...); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 DESCRIPTION |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
B<FOR INTERNAL USE ONLY> |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
ExtUtils::MM is a subclass of L<ExtUtils::MakeMaker> which automatically |
28
|
|
|
|
|
|
|
chooses the appropriate OS specific subclass for you |
29
|
|
|
|
|
|
|
(ie. L<ExtUtils::MM_Unix>, etc...). |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
It also provides a convenient alias via the MM class (I didn't want |
32
|
|
|
|
|
|
|
MakeMaker modules outside of ExtUtils/). |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
This class might turn out to be a temporary solution, but MM won't go |
35
|
|
|
|
|
|
|
away. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
{ |
40
|
|
|
|
|
|
|
# Convenient alias. |
41
|
|
|
|
|
|
|
package MM; |
42
|
|
|
|
|
|
|
our @ISA = qw(ExtUtils::MM); |
43
|
|
|
|
0
|
|
|
sub DESTROY {} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub _is_win95 { |
47
|
|
|
|
|
|
|
# miniperl might not have the Win32 functions available and we need |
48
|
|
|
|
|
|
|
# to run in miniperl. |
49
|
0
|
|
|
0
|
|
0
|
my $have_win32 = eval { require Win32 }; |
|
0
|
|
|
|
|
0
|
|
50
|
|
|
|
|
|
|
return $have_win32 && defined &Win32::IsWin95 ? Win32::IsWin95() |
51
|
0
|
0
|
0
|
|
|
0
|
: ! defined $ENV{SYSTEMROOT}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
my %Is = (); |
55
|
|
|
|
|
|
|
$Is{VMS} = $^O eq 'VMS'; |
56
|
|
|
|
|
|
|
$Is{OS2} = $^O eq 'os2'; |
57
|
|
|
|
|
|
|
$Is{MacOS} = $^O eq 'MacOS'; |
58
|
|
|
|
|
|
|
if( $^O eq 'MSWin32' ) { |
59
|
|
|
|
|
|
|
_is_win95() ? $Is{Win95} = 1 : $Is{Win32} = 1; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
$Is{UWIN} = $^O =~ /^uwin(-nt)?$/; |
62
|
|
|
|
|
|
|
$Is{Cygwin} = $^O eq 'cygwin'; |
63
|
|
|
|
|
|
|
$Is{NW5} = $Config{osname} eq 'NetWare'; # intentional |
64
|
|
|
|
|
|
|
$Is{BeOS} = ($^O =~ /beos/i or $^O eq 'haiku'); |
65
|
|
|
|
|
|
|
$Is{DOS} = $^O eq 'dos'; |
66
|
|
|
|
|
|
|
if( $Is{NW5} ) { |
67
|
|
|
|
|
|
|
$^O = 'NetWare'; |
68
|
|
|
|
|
|
|
delete $Is{Win32}; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
$Is{VOS} = $^O eq 'vos'; |
71
|
|
|
|
|
|
|
$Is{QNX} = $^O eq 'qnx'; |
72
|
|
|
|
|
|
|
$Is{AIX} = $^O eq 'aix'; |
73
|
|
|
|
|
|
|
$Is{Darwin} = $^O eq 'darwin'; |
74
|
|
|
|
|
|
|
$Is{OS390} = $^O eq 'os390'; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
$Is{Unix} = !grep { $_ } values %Is; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
map { delete $Is{$_} unless $Is{$_} } keys %Is; |
79
|
|
|
|
|
|
|
_assert( keys %Is == 1 ); |
80
|
|
|
|
|
|
|
my($OS) = keys %Is; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
my $class = "ExtUtils::MM_$OS"; |
84
|
|
|
|
|
|
|
eval "require $class" unless $INC{"ExtUtils/MM_$OS.pm"}; ## no critic |
85
|
|
|
|
|
|
|
die $@ if $@; |
86
|
|
|
|
|
|
|
unshift @ISA, $class; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub _assert { |
90
|
52
|
|
|
52
|
|
132
|
my $sanity = shift; |
91
|
52
|
50
|
|
|
|
169
|
die sprintf "Assert failed at %s line %d\n", (caller)[1,2] unless $sanity; |
92
|
52
|
|
|
|
|
123
|
return; |
93
|
|
|
|
|
|
|
} |