Filename | /usr/share/perl/5.36/ExtUtils/MM.pm |
Statements | Executed 40 statements in 563µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 8µs | 9µs | BEGIN@3 | ExtUtils::MM::
1 | 1 | 1 | 4µs | 15µs | BEGIN@5 | ExtUtils::MM::
1 | 1 | 1 | 4µs | 18µs | BEGIN@4 | ExtUtils::MM::
2 | 2 | 1 | 2µs | 2µs | CORE:match (opcode) | ExtUtils::MM::
1 | 1 | 1 | 2µs | 2µs | _assert | ExtUtils::MM::
0 | 0 | 0 | 0s | 0s | _is_win95 | ExtUtils::MM::
0 | 0 | 0 | 0s | 0s | DESTROY | MM::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package ExtUtils::MM; | ||||
2 | |||||
3 | 2 | 18µs | 2 | 11µs | # spent 9µs (8+1) within ExtUtils::MM::BEGIN@3 which was called:
# once (8µs+1µs) by IPC::Cmd::can_run at line 3 # spent 9µs making 1 call to ExtUtils::MM::BEGIN@3
# spent 1µs making 1 call to strict::import |
4 | 2 | 18µs | 2 | 32µs | # spent 18µs (4+14) within ExtUtils::MM::BEGIN@4 which was called:
# once (4µs+14µs) by IPC::Cmd::can_run at line 4 # spent 18µs making 1 call to ExtUtils::MM::BEGIN@4
# spent 14µs making 1 call to warnings::import |
5 | 2 | 326µs | 2 | 25µs | # spent 15µs (4+11) within ExtUtils::MM::BEGIN@5 which was called:
# once (4µs+11µs) by IPC::Cmd::can_run at line 5 # spent 15µs making 1 call to ExtUtils::MM::BEGIN@5
# spent 11µs making 1 call to ExtUtils::MakeMaker::Config::import |
6 | |||||
7 | 1 | 300ns | our $VERSION = '7.64'; | ||
8 | 1 | 600ns | $VERSION =~ tr/_//d; | ||
9 | |||||
10 | 1 | 86µs | require ExtUtils::Liblist; | ||
11 | 1 | 500ns | require ExtUtils::MakeMaker; | ||
12 | 1 | 13µs | 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 | 1 | 4µs | our @ISA = qw(ExtUtils::MM); | ||
43 | sub DESTROY {} | ||||
44 | } | ||||
45 | |||||
46 | 1 | 300ns | sub _is_win95 { | ||
47 | # miniperl might not have the Win32 functions available and we need | ||||
48 | # to run in miniperl. | ||||
49 | my $have_win32 = eval { require Win32 }; | ||||
50 | return $have_win32 && defined &Win32::IsWin95 ? Win32::IsWin95() | ||||
51 | : ! defined $ENV{SYSTEMROOT}; | ||||
52 | } | ||||
53 | |||||
54 | 1 | 200ns | my %Is = (); | ||
55 | 1 | 2µs | $Is{VMS} = $^O eq 'VMS'; | ||
56 | 1 | 500ns | $Is{OS2} = $^O eq 'os2'; | ||
57 | 1 | 300ns | $Is{MacOS} = $^O eq 'MacOS'; | ||
58 | 1 | 300ns | if( $^O eq 'MSWin32' ) { | ||
59 | _is_win95() ? $Is{Win95} = 1 : $Is{Win32} = 1; | ||||
60 | } | ||||
61 | 1 | 7µs | 1 | 1µs | $Is{UWIN} = $^O =~ /^uwin(-nt)?$/; # spent 1µs making 1 call to ExtUtils::MM::CORE:match |
62 | 1 | 300ns | $Is{Cygwin} = $^O eq 'cygwin'; | ||
63 | 1 | 1µs | $Is{NW5} = $Config{osname} eq 'NetWare'; # intentional | ||
64 | 1 | 2µs | 1 | 900ns | $Is{BeOS} = ($^O =~ /beos/i or $^O eq 'haiku'); # spent 900ns making 1 call to ExtUtils::MM::CORE:match |
65 | 1 | 300ns | $Is{DOS} = $^O eq 'dos'; | ||
66 | 1 | 200ns | if( $Is{NW5} ) { | ||
67 | $^O = 'NetWare'; | ||||
68 | delete $Is{Win32}; | ||||
69 | } | ||||
70 | 1 | 300ns | $Is{VOS} = $^O eq 'vos'; | ||
71 | 1 | 400ns | $Is{QNX} = $^O eq 'qnx'; | ||
72 | 1 | 300ns | $Is{AIX} = $^O eq 'aix'; | ||
73 | 1 | 900ns | $Is{Darwin} = $^O eq 'darwin'; | ||
74 | 1 | 300ns | $Is{OS390} = $^O eq 'os390'; | ||
75 | |||||
76 | 1 | 2µs | $Is{Unix} = !grep { $_ } values %Is; | ||
77 | |||||
78 | 1 | 3µs | map { delete $Is{$_} unless $Is{$_} } keys %Is; | ||
79 | 1 | 1µs | 1 | 2µs | _assert( keys %Is == 1 ); # spent 2µs making 1 call to ExtUtils::MM::_assert |
80 | 1 | 500ns | my($OS) = keys %Is; | ||
81 | |||||
82 | |||||
83 | 1 | 500ns | my $class = "ExtUtils::MM_$OS"; | ||
84 | 1 | 29µs | eval "require $class" unless $INC{"ExtUtils/MM_$OS.pm"}; ## no critic # spent 93µs executing statements in string eval | ||
85 | 1 | 200ns | die $@ if $@; | ||
86 | 1 | 39µs | unshift @ISA, $class; | ||
87 | |||||
88 | |||||
89 | # spent 2µs within ExtUtils::MM::_assert which was called:
# once (2µs+0s) by IPC::Cmd::can_run at line 79 | ||||
90 | 1 | 300ns | my $sanity = shift; | ||
91 | 1 | 200ns | die sprintf "Assert failed at %s line %d\n", (caller)[1,2] unless $sanity; | ||
92 | 1 | 2µs | return; | ||
93 | } | ||||
sub ExtUtils::MM::CORE:match; # opcode |