Filename | C:/tmp64ng/perl/lib/ExtUtils/MM_Any.pm |
Statements | Executed 14955 statements in 61.8s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
333 | 1 | 1 | 61.7s | 61.7s | CORE:backtick (opcode) | ExtUtils::MM_Any::
672 | 3 | 2 | 16.6ms | 16.6ms | make | ExtUtils::MM_Any::
1 | 1 | 1 | 0s | 15.6ms | BEGIN@12 | ExtUtils::MM_Any::
1 | 1 | 1 | 0s | 0s | BEGIN@14 | ExtUtils::MM_Any::
1 | 1 | 1 | 0s | 0s | BEGIN@3 | ExtUtils::MM_Any::
1 | 1 | 1 | 0s | 0s | BEGIN@6 | ExtUtils::MM_Any::
1 | 1 | 1 | 0s | 0s | BEGIN@7 | ExtUtils::MM_Any::
1 | 1 | 1 | 0s | 0s | BEGIN@8 | ExtUtils::MM_Any::
1 | 1 | 1 | 0s | 0s | BEGIN@9 | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | CORE:closedir (opcode) | ExtUtils::MM_Any::
1 | 1 | 1 | 0s | 0s | CORE:ftdir (opcode) | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | CORE:ftfile (opcode) | ExtUtils::MM_Any::
8 | 1 | 1 | 0s | 0s | CORE:ftis (opcode) | ExtUtils::MM_Any::
970 | 11 | 1 | 0s | 0s | CORE:match (opcode) | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | CORE:open_dir (opcode) | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | CORE:readdir (opcode) | ExtUtils::MM_Any::
336 | 1 | 1 | 0s | 0s | CORE:regcomp (opcode) | ExtUtils::MM_Any::
24 | 6 | 1 | 0s | 0s | CORE:sort (opcode) | ExtUtils::MM_Any::
1679 | 11 | 1 | 0s | 0s | CORE:subst (opcode) | ExtUtils::MM_Any::
30 | 1 | 1 | 0s | 0s | CORE:substcont (opcode) | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | POD2MAN_macro | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | _PREREQ_PRINT | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | _PRINT_PREREQ | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | __ANON__[:1300] | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | __ANON__[:2680] | ExtUtils::MM_Any::
6 | 2 | 1 | 0s | 0s | _add_requirements_to_meta_v1_4 | ExtUtils::MM_Any::
2 | 2 | 1 | 0s | 0s | _add_requirements_to_meta_v2 | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | _all_prereqs | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | _dump_hash | ExtUtils::MM_Any::
15 | 1 | 1 | 0s | 0s | _expand_macros | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | _fix_libs | ExtUtils::MM_Any::
6 | 2 | 1 | 0s | 0s | _fix_metadata_before_conversion | ExtUtils::MM_Any::
15 | 4 | 1 | 0s | 31.2ms | _has_cpan_meta | ExtUtils::MM_Any::
3 | 2 | 1 | 0s | 0s | _hash_merge (recurses: max depth 1, inclusive time 0s) | ExtUtils::MM_Any::
5 | 1 | 1 | 0s | 0s | _metaspec_version | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 15.6ms | _mymeta_from_meta | ExtUtils::MM_Any::
5 | 1 | 1 | 0s | 0s | _normalize_version | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | _perl_header_files | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | _perl_header_files_fragment | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | _sort_pairs | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | all_target | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | arch_check | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | blessed | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | blibdirs_target | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | can_dep_space | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | can_load_xs | ExtUtils::MM_Any::
333 | 1 | 1 | 0s | 0s | can_redirect_error | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | can_run | ExtUtils::MM_Any::
83 | 19 | 3 | 0s | 15.6ms | catfile | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | clean | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 359ms | clean_subdirs_target | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | dir_target | ExtUtils::MM_Any::
1 | 1 | 1 | 0s | 187ms | dist_test | ExtUtils::MM_Any::
1 | 1 | 1 | 0s | 0s | distdir | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 2.22s | distmeta_target | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 2.22s | distsignature_target | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | dynamic | ExtUtils::MM_Any::
12 | 4 | 2 | 0s | 39.7s | echo | ExtUtils::MM_Any::
210 | 1 | 1 | 0s | 0s | escape_all_dollarsigns | ExtUtils::MM_Any::
82 | 1 | 1 | 0s | 0s | escape_dollarsigns | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | extra_clean_files | ExtUtils::MM_Any::
1 | 1 | 1 | 0s | 0s | find_tests | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | find_tests_recursive | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | init_ABSTRACT | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | init_INST | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | init_INSTALL | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | init_INSTALL_from_INSTALL_BASE | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | init_INSTALL_from_PREFIX | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | init_MAKE | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 15.6ms | init_VERSION | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 46.8ms | init_others | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | init_platform | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 10.4s | init_tools | ExtUtils::MM_Any::
6 | 2 | 1 | 0s | 0s | installvars | ExtUtils::MM_Any::
336 | 7 | 2 | 0s | 61.8s | is_make_type | ExtUtils::MM_Any::
15 | 1 | 1 | 0s | 0s | libscan | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | makemakerdflt_target | ExtUtils::MM_Any::
154 | 1 | 1 | 0s | 0s | maketext_filter | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | manifypods | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | manifypods_target | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | max | ExtUtils::MM_Any::
5 | 2 | 1 | 0s | 0s | metafile_data | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | metafile_file | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 35.4s | metafile_target | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | min | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 15.6ms | mymeta | ExtUtils::MM_Any::
1002 | 2 | 2 | 0s | 0s | os_flavor_is | ExtUtils::MM_Any::
0 | 0 | 0 | 0s | 0s | platform_constants | ExtUtils::MM_Any::
13 | 1 | 1 | 0s | 0s | quote_dep | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | realclean | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 749ms | realclean_subdirs_target | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | signature_target | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | special_targets | ExtUtils::MM_Any::
21 | 6 | 2 | 0s | 0s | split_command | ExtUtils::MM_Any::
2 | 2 | 1 | 0s | 0s | test_via_harness | ExtUtils::MM_Any::
6 | 2 | 1 | 0s | 0s | test_via_script | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 562ms | tool_autosplit | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 0s | tools_other | ExtUtils::MM_Any::
24 | 2 | 1 | 0s | 0s | wraplist | ExtUtils::MM_Any::
3 | 1 | 1 | 0s | 109ms | write_mymeta | ExtUtils::MM_Any::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package ExtUtils::MM_Any; | ||||
2 | |||||
3 | 2 | 0s | 2 | 0s | # spent 0s within ExtUtils::MM_Any::BEGIN@3 which was called:
# once (0s+0s) by main::BEGIN@1 at line 3 # spent 0s making 1 call to ExtUtils::MM_Any::BEGIN@3
# spent 0s making 1 call to strict::import |
4 | 1 | 0s | our $VERSION = '7.04'; | ||
5 | |||||
6 | 2 | 0s | 2 | 0s | # spent 0s within ExtUtils::MM_Any::BEGIN@6 which was called:
# once (0s+0s) by main::BEGIN@1 at line 6 # spent 0s making 1 call to Exporter::import
# spent 0s making 1 call to ExtUtils::MM_Any::BEGIN@6 |
7 | 2 | 0s | 1 | 0s | # spent 0s within ExtUtils::MM_Any::BEGIN@7 which was called:
# once (0s+0s) by main::BEGIN@1 at line 7 # spent 0s making 1 call to ExtUtils::MM_Any::BEGIN@7 |
8 | 2 | 0s | 2 | 0s | # spent 0s within ExtUtils::MM_Any::BEGIN@8 which was called:
# once (0s+0s) by main::BEGIN@1 at line 8 # spent 0s making 1 call to Exporter::import
# spent 0s making 1 call to ExtUtils::MM_Any::BEGIN@8 |
9 | 1 | 0s | 1 | 0s | # spent 0s within ExtUtils::MM_Any::BEGIN@9 which was called:
# once (0s+0s) by main::BEGIN@1 at line 9 # spent 0s making 1 call to ExtUtils::MM_Any::BEGIN@9 |
10 | |||||
11 | # We need $Verbose | ||||
12 | 2 | 0s | 2 | 31.2ms | # spent 15.6ms (0s+15.6) within ExtUtils::MM_Any::BEGIN@12 which was called:
# once (0s+15.6ms) by main::BEGIN@1 at line 12 # spent 15.6ms making 1 call to Exporter::import
# spent 15.6ms making 1 call to ExtUtils::MM_Any::BEGIN@12 |
13 | |||||
14 | 2 | 15.6ms | 2 | 0s | # spent 0s within ExtUtils::MM_Any::BEGIN@14 which was called:
# once (0s+0s) by main::BEGIN@1 at line 14 # spent 0s making 1 call to ExtUtils::MM_Any::BEGIN@14
# spent 0s making 1 call to ExtUtils::MakeMaker::Config::import |
15 | |||||
16 | |||||
17 | # So we don't have to keep calling the methods over and over again, | ||||
18 | # we have these globals to cache the values. Faster and shrtr. | ||||
19 | 1 | 0s | 1 | 0s | my $Curdir = __PACKAGE__->curdir; # spent 0s making 1 call to File::Spec::Unix::curdir |
20 | 1 | 0s | 1 | 0s | my $Rootdir = __PACKAGE__->rootdir; # spent 0s making 1 call to File::Spec::Win32::rootdir |
21 | 1 | 0s | 1 | 0s | my $Updir = __PACKAGE__->updir; # spent 0s making 1 call to File::Spec::Unix::updir |
22 | |||||
23 | |||||
24 | =head1 NAME | ||||
25 | |||||
26 | ExtUtils::MM_Any - Platform-agnostic MM methods | ||||
27 | |||||
28 | =head1 SYNOPSIS | ||||
29 | |||||
30 | FOR INTERNAL USE ONLY! | ||||
31 | |||||
32 | package ExtUtils::MM_SomeOS; | ||||
33 | |||||
34 | # Temporarily, you have to subclass both. Put MM_Any first. | ||||
35 | require ExtUtils::MM_Any; | ||||
36 | require ExtUtils::MM_Unix; | ||||
37 | @ISA = qw(ExtUtils::MM_Any ExtUtils::Unix); | ||||
38 | |||||
39 | =head1 DESCRIPTION | ||||
40 | |||||
41 | B<FOR INTERNAL USE ONLY!> | ||||
42 | |||||
43 | ExtUtils::MM_Any is a superclass for the ExtUtils::MM_* set of | ||||
44 | modules. It contains methods which are either inherently | ||||
45 | cross-platform or are written in a cross-platform manner. | ||||
46 | |||||
47 | Subclass off of ExtUtils::MM_Any I<and> ExtUtils::MM_Unix. This is a | ||||
48 | temporary solution. | ||||
49 | |||||
50 | B<THIS MAY BE TEMPORARY!> | ||||
51 | |||||
52 | |||||
53 | =head1 METHODS | ||||
54 | |||||
55 | Any methods marked I<Abstract> must be implemented by subclasses. | ||||
56 | |||||
57 | |||||
58 | =head2 Cross-platform helper methods | ||||
59 | |||||
60 | These are methods which help writing cross-platform code. | ||||
61 | |||||
- - | |||||
64 | =head3 os_flavor I<Abstract> | ||||
65 | |||||
66 | my @os_flavor = $mm->os_flavor; | ||||
67 | |||||
68 | @os_flavor is the style of operating system this is, usually | ||||
69 | corresponding to the MM_*.pm file we're using. | ||||
70 | |||||
71 | The first element of @os_flavor is the major family (ie. Unix, | ||||
72 | Windows, VMS, OS/2, etc...) and the rest are sub families. | ||||
73 | |||||
74 | Some examples: | ||||
75 | |||||
76 | Cygwin98 ('Unix', 'Cygwin', 'Cygwin9x') | ||||
77 | Windows ('Win32') | ||||
78 | Win98 ('Win32', 'Win9x') | ||||
79 | Linux ('Unix', 'Linux') | ||||
80 | MacOS X ('Unix', 'Darwin', 'MacOS', 'MacOS X') | ||||
81 | OS/2 ('OS/2') | ||||
82 | |||||
83 | This is used to write code for styles of operating system. | ||||
84 | See os_flavor_is() for use. | ||||
85 | |||||
86 | |||||
87 | =head3 os_flavor_is | ||||
88 | |||||
89 | my $is_this_flavor = $mm->os_flavor_is($this_flavor); | ||||
90 | my $is_this_flavor = $mm->os_flavor_is(@one_of_these_flavors); | ||||
91 | |||||
92 | Checks to see if the current operating system is one of the given flavors. | ||||
93 | |||||
94 | This is useful for code like: | ||||
95 | |||||
96 | if( $mm->os_flavor_is('Unix') ) { | ||||
97 | $out = `foo 2>&1`; | ||||
98 | } | ||||
99 | else { | ||||
100 | $out = `foo`; | ||||
101 | } | ||||
102 | |||||
103 | =cut | ||||
104 | |||||
105 | # spent 0s within ExtUtils::MM_Any::os_flavor_is which was called 1002 times, avg 0s/call:
# 999 times (0s+0s) by ExtUtils::MM_Any::can_redirect_error at line 186, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MakeMaker::flush at line 1158 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
106 | 1002 | 0s | my $self = shift; | ||
107 | 1002 | 0s | 1002 | 0s | my %flavors = map { ($_ => 1) } $self->os_flavor; # spent 0s making 1002 calls to ExtUtils::MM_Win32::os_flavor, avg 0s/call |
108 | 1002 | 0s | return (grep { $flavors{$_} } @_) ? 1 : 0; | ||
109 | } | ||||
110 | |||||
111 | |||||
112 | =head3 can_load_xs | ||||
113 | |||||
114 | my $can_load_xs = $self->can_load_xs; | ||||
115 | |||||
116 | Returns true if we have the ability to load XS. | ||||
117 | |||||
118 | This is important because miniperl, used to build XS modules in the | ||||
119 | core, can not load XS. | ||||
120 | |||||
121 | =cut | ||||
122 | |||||
123 | # spent 0s within ExtUtils::MM_Any::can_load_xs which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Win32::arch_check at line 485 of ExtUtils/MM_Win32.pm, avg 0s/call | ||||
124 | 3 | 0s | return defined &DynaLoader::boot_DynaLoader ? 1 : 0; | ||
125 | } | ||||
126 | |||||
127 | |||||
128 | =head3 can_run | ||||
129 | |||||
130 | use ExtUtils::MM; | ||||
131 | my $runnable = MM->can_run($Config{make}); | ||||
132 | |||||
133 | If called in a scalar context it will return the full path to the binary | ||||
134 | you asked for if it was found, or C<undef> if it was not. | ||||
135 | |||||
136 | If called in a list context, it will return a list of the full paths to instances | ||||
137 | of the binary where found in C<PATH>, or an empty list if it was not found. | ||||
138 | |||||
139 | Copied from L<IPC::Cmd|IPC::Cmd/"$path = can_run( PROGRAM );">, but modified into | ||||
140 | a method (and removed C<$INSTANCES> capability). | ||||
141 | |||||
142 | =cut | ||||
143 | |||||
144 | sub can_run { | ||||
145 | my ($self, $command) = @_; | ||||
146 | |||||
147 | # a lot of VMS executables have a symbol defined | ||||
148 | # check those first | ||||
149 | if ( $^O eq 'VMS' ) { | ||||
150 | require VMS::DCLsym; | ||||
151 | my $syms = VMS::DCLsym->new; | ||||
152 | return $command if scalar $syms->getsym( uc $command ); | ||||
153 | } | ||||
154 | |||||
155 | my @possibles; | ||||
156 | |||||
157 | if( File::Spec->file_name_is_absolute($command) ) { | ||||
158 | return $self->maybe_command($command); | ||||
159 | |||||
160 | } else { | ||||
161 | for my $dir ( | ||||
162 | File::Spec->path, | ||||
163 | File::Spec->curdir | ||||
164 | ) { | ||||
165 | next if ! $dir || ! -d $dir; | ||||
166 | my $abs = File::Spec->catfile($self->os_flavor_is('Win32') ? Win32::GetShortPathName( $dir ) : $dir, $command); | ||||
167 | push @possibles, $abs if $abs = $self->maybe_command($abs); | ||||
168 | } | ||||
169 | } | ||||
170 | return @possibles if wantarray; | ||||
171 | return shift @possibles; | ||||
172 | } | ||||
173 | |||||
174 | |||||
175 | =head3 can_redirect_error | ||||
176 | |||||
177 | $useredirect = MM->can_redirect_error; | ||||
178 | |||||
179 | True if on an OS where qx operator (or backticks) can redirect C<STDERR> | ||||
180 | onto C<STDOUT>. | ||||
181 | |||||
182 | =cut | ||||
183 | |||||
184 | # spent 0s within ExtUtils::MM_Any::can_redirect_error which was called 333 times, avg 0s/call:
# 333 times (0s+0s) by ExtUtils::MM_Any::is_make_type at line 211, avg 0s/call | ||||
185 | 333 | 0s | my $self = shift; | ||
186 | 333 | 0s | 999 | 0s | $self->os_flavor_is('Unix') # spent 0s making 999 calls to ExtUtils::MM_Any::os_flavor_is, avg 0s/call |
187 | or ($self->os_flavor_is('Win32') and !$self->os_flavor_is('Win9x')) | ||||
188 | or $self->os_flavor_is('OS/2') | ||||
189 | } | ||||
190 | |||||
191 | |||||
192 | =head3 is_make_type | ||||
193 | |||||
194 | my $is_dmake = $self->is_make_type('dmake'); | ||||
195 | |||||
196 | Returns true if C<<$self->make>> is the given type; possibilities are: | ||||
197 | |||||
198 | gmake GNU make | ||||
199 | dmake | ||||
200 | nmake | ||||
201 | bsdmake BSD pmake-derived | ||||
202 | |||||
203 | =cut | ||||
204 | |||||
205 | # spent 61.8s (0+61.8) within ExtUtils::MM_Any::is_make_type which was called 336 times, avg 184ms/call:
# 292 times (0s+54.2s) by ExtUtils::MM_Win32::quote_literal at line 543 of ExtUtils/MM_Win32.pm, avg 186ms/call
# 23 times (0s+4.27s) by ExtUtils::MM_Win32::cd at line 580 of ExtUtils/MM_Win32.pm, avg 186ms/call
# 9 times (0s+1.11s) by ExtUtils::MM_Win32::init_DIRFILESEP at line 139 of ExtUtils/MM_Win32.pm, avg 123ms/call
# 3 times (0s+562ms) by ExtUtils::MM_Win32::special_targets at line 277 of ExtUtils/MM_Win32.pm, avg 187ms/call
# 3 times (0s+562ms) by ExtUtils::MM_Win32::constants at line 246 of ExtUtils/MM_Win32.pm, avg 187ms/call
# 3 times (0s+546ms) by ExtUtils::MM_Win32::pasthru at line 470 of ExtUtils/MM_Win32.pm, avg 182ms/call
# 3 times (0s+530ms) by ExtUtils::MM_Unix::test at line 3484 of ExtUtils/MM_Unix.pm, avg 177ms/call | ||||
206 | 336 | 0s | my($self, $type) = @_; | ||
207 | 336 | 15.6ms | 672 | 47.8ms | (undef, undef, my $make_basename) = $self->splitpath($self->make); # spent 31.2ms making 336 calls to File::Spec::Win32::splitpath, avg 93µs/call
# spent 16.6ms making 336 calls to ExtUtils::MM_Any::make, avg 49µs/call |
208 | 336 | 0s | 672 | 0s | return 1 if $make_basename =~ /\b$type\b/i; # executable's filename # spent 0s making 336 calls to ExtUtils::MM_Any::CORE:match, avg 0s/call
# spent 0s making 336 calls to ExtUtils::MM_Any::CORE:regcomp, avg 0s/call |
209 | 333 | 0s | 333 | 0s | return 0 if $make_basename =~ /\b(dmake|nmake)\b/i; # Never fall through for dmake/nmake # spent 0s making 333 calls to ExtUtils::MM_Any::CORE:match, avg 0s/call |
210 | # now have to run with "-v" and guess | ||||
211 | 333 | 0s | 333 | 0s | my $redirect = $self->can_redirect_error ? '2>&1' : ''; # spent 0s making 333 calls to ExtUtils::MM_Any::can_redirect_error, avg 0s/call |
212 | 333 | 0s | 333 | 0s | my $make = $self->make || $self->{MAKE}; # spent 0s making 333 calls to ExtUtils::MM_Any::make, avg 0s/call |
213 | 333 | 61.7s | 333 | 61.7s | my $minus_v = `"$make" -v $redirect`; # spent 61.7s making 333 calls to ExtUtils::MM_Any::CORE:backtick, avg 185ms/call |
214 | 333 | 0s | return 1 if $type eq 'gmake' and $minus_v =~ /GNU make/i; | ||
215 | 333 | 0s | return 1 if $type eq 'bsdmake' | ||
216 | and $minus_v =~ /^usage: make \[-BeikNnqrstWwX\]/im; | ||||
217 | 333 | 0s | 0; # it wasn't whatever you asked | ||
218 | } | ||||
219 | |||||
220 | |||||
221 | =head3 can_dep_space | ||||
222 | |||||
223 | my $can_dep_space = $self->can_dep_space; | ||||
224 | |||||
225 | Returns true if C<make> can handle (probably by quoting) | ||||
226 | dependencies that contain a space. Currently known true for GNU make, | ||||
227 | false for BSD pmake derivative. | ||||
228 | |||||
229 | =cut | ||||
230 | |||||
231 | 1 | 0s | my $cached_dep_space; | ||
232 | sub can_dep_space { | ||||
233 | my $self = shift; | ||||
234 | return $cached_dep_space if defined $cached_dep_space; | ||||
235 | return $cached_dep_space = 1 if $self->is_make_type('gmake'); | ||||
236 | return $cached_dep_space = 0 if $self->is_make_type('dmake'); # only on W32 | ||||
237 | return $cached_dep_space = 0 if $self->is_make_type('bsdmake'); | ||||
238 | return $cached_dep_space = 0; # assume no | ||||
239 | } | ||||
240 | |||||
241 | |||||
242 | =head3 quote_dep | ||||
243 | |||||
244 | $text = $mm->quote_dep($text); | ||||
245 | |||||
246 | Method that protects Makefile single-value constants (mainly filenames), | ||||
247 | so that make will still treat them as single values even if they | ||||
248 | inconveniently have spaces in. If the make program being used cannot | ||||
249 | achieve such protection and the given text would need it, throws an | ||||
250 | exception. | ||||
251 | |||||
252 | =cut | ||||
253 | |||||
254 | # spent 0s within ExtUtils::MM_Any::quote_dep which was called 13 times, avg 0s/call:
# 13 times (0s+0s) by ExtUtils::MM_Win32::quote_dep at line 447 of ExtUtils/MM_Win32.pm, avg 0s/call | ||||
255 | 13 | 0s | my ($self, $arg) = @_; | ||
256 | 13 | 0s | 13 | 0s | die <<EOF if $arg =~ / / and not $self->can_dep_space; # spent 0s making 13 calls to ExtUtils::MM_Any::CORE:match, avg 0s/call |
257 | Tried to use make dependency with space for make that can't: | ||||
258 | '$arg' | ||||
259 | EOF | ||||
260 | 13 | 0s | 13 | 0s | $arg =~ s/( )/\\$1/g; # how GNU make does it # spent 0s making 13 calls to ExtUtils::MM_Any::CORE:subst, avg 0s/call |
261 | 13 | 0s | return $arg; | ||
262 | } | ||||
263 | |||||
264 | |||||
265 | =head3 split_command | ||||
266 | |||||
267 | my @cmds = $MM->split_command($cmd, @args); | ||||
268 | |||||
269 | Most OS have a maximum command length they can execute at once. Large | ||||
270 | modules can easily generate commands well past that limit. Its | ||||
271 | necessary to split long commands up into a series of shorter commands. | ||||
272 | |||||
273 | C<split_command> will return a series of @cmds each processing part of | ||||
274 | the args. Collectively they will process all the arguments. Each | ||||
275 | individual line in @cmds will not be longer than the | ||||
276 | $self->max_exec_len being careful to take into account macro expansion. | ||||
277 | |||||
278 | $cmd should include any switches and repeated initial arguments. | ||||
279 | |||||
280 | If no @args are given, no @cmds will be returned. | ||||
281 | |||||
282 | Pairs of arguments will always be preserved in a single command, this | ||||
283 | is a heuristic for things like pm_to_blib and pod2man which work on | ||||
284 | pairs of arguments. This makes things like this safe: | ||||
285 | |||||
286 | $self->split_command($cmd, %pod2man); | ||||
287 | |||||
288 | |||||
289 | =cut | ||||
290 | |||||
291 | # spent 0s within ExtUtils::MM_Any::split_command which was called 21 times, avg 0s/call:
# 6 times (0s+0s) by ExtUtils::MM_Any::manifypods_target at line 924, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Unix::pm_to_blib at line 2915 of ExtUtils/MM_Unix.pm, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::clean at line 713, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::realclean at line 1573, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::realclean at line 1571, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::clean at line 714, avg 0s/call | ||||
292 | 21 | 0s | my($self, $cmd, @args) = @_; | ||
293 | |||||
294 | 21 | 0s | my @cmds = (); | ||
295 | 21 | 0s | return(@cmds) unless @args; | ||
296 | |||||
297 | # If the command was given as a here-doc, there's probably a trailing | ||||
298 | # newline. | ||||
299 | 15 | 0s | chomp $cmd; | ||
300 | |||||
301 | # set aside 30% for macro expansion. | ||||
302 | 15 | 0s | 15 | 0s | my $len_left = int($self->max_exec_len * 0.70); # spent 0s making 15 calls to ExtUtils::MM_Win32::max_exec_len, avg 0s/call |
303 | 15 | 0s | 15 | 0s | $len_left -= length $self->_expand_macros($cmd); # spent 0s making 15 calls to ExtUtils::MM_Any::_expand_macros, avg 0s/call |
304 | |||||
305 | 15 | 0s | do { | ||
306 | 15 | 0s | my $arg_str = ''; | ||
307 | 15 | 0s | my @next_args; | ||
308 | 15 | 0s | while( @next_args = splice(@args, 0, 2) ) { | ||
309 | # Two at a time to preserve pairs. | ||||
310 | 70 | 0s | my $next_arg_str = "\t ". join ' ', @next_args, "\n"; | ||
311 | |||||
312 | 70 | 0s | if( !length $arg_str ) { | ||
313 | $arg_str .= $next_arg_str | ||||
314 | } | ||||
315 | elsif( length($arg_str) + length($next_arg_str) > $len_left ) { | ||||
316 | unshift @args, @next_args; | ||||
317 | last; | ||||
318 | } | ||||
319 | else { | ||||
320 | 55 | 0s | $arg_str .= $next_arg_str; | ||
321 | } | ||||
322 | } | ||||
323 | 15 | 0s | chop $arg_str; | ||
324 | |||||
325 | 15 | 0s | 15 | 0s | push @cmds, $self->escape_newlines("$cmd \n$arg_str"); # spent 0s making 15 calls to ExtUtils::MM_Win32::escape_newlines, avg 0s/call |
326 | } while @args; | ||||
327 | |||||
328 | 15 | 0s | return @cmds; | ||
329 | } | ||||
330 | |||||
331 | |||||
332 | # spent 0s within ExtUtils::MM_Any::_expand_macros which was called 15 times, avg 0s/call:
# 15 times (0s+0s) by ExtUtils::MM_Any::split_command at line 303, avg 0s/call | ||||
333 | 15 | 0s | my($self, $cmd) = @_; | ||
334 | |||||
335 | 15 | 0s | 45 | 0s | $cmd =~ s{\$\((\w+)\)}{ # spent 0s making 15 calls to ExtUtils::MM_Any::CORE:subst, avg 0s/call
# spent 0s making 30 calls to ExtUtils::MM_Any::CORE:substcont, avg 0s/call |
336 | defined $self->{$1} ? $self->{$1} : "\$($1)" | ||||
337 | }e; | ||||
338 | 15 | 0s | return $cmd; | ||
339 | } | ||||
340 | |||||
341 | |||||
342 | =head3 echo | ||||
343 | |||||
344 | my @commands = $MM->echo($text); | ||||
345 | my @commands = $MM->echo($text, $file); | ||||
346 | my @commands = $MM->echo($text, $file, \%opts); | ||||
347 | |||||
348 | Generates a set of @commands which print the $text to a $file. | ||||
349 | |||||
350 | If $file is not given, output goes to STDOUT. | ||||
351 | |||||
352 | If $opts{append} is true the $file will be appended to rather than | ||||
353 | overwritten. Default is to overwrite. | ||||
354 | |||||
355 | If $opts{allow_variables} is true, make variables of the form | ||||
356 | C<$(...)> will not be escaped. Other C<$> will. Default is to escape | ||||
357 | all C<$>. | ||||
358 | |||||
359 | Example of use: | ||||
360 | |||||
361 | my $make = map "\t$_\n", $MM->echo($text, $file); | ||||
362 | |||||
363 | =cut | ||||
364 | |||||
365 | # spent 39.7s (0+39.7) within ExtUtils::MM_Any::echo which was called 12 times, avg 3.31s/call:
# 3 times (0s+23.1s) by ExtUtils::MM_Any::metafile_target at line 986, avg 7.69s/call
# 3 times (0s+12.2s) by ExtUtils::MM_Any::metafile_target at line 983, avg 4.06s/call
# 3 times (0s+3.88s) by ExtUtils::MM_Unix::ppd at line 3062 of ExtUtils/MM_Unix.pm, avg 1.29s/call
# 3 times (0s+562ms) by ExtUtils::MM_Unix::ppd at line 2985 of ExtUtils/MM_Unix.pm, avg 187ms/call | ||||
366 | 12 | 0s | my($self, $text, $file, $opts) = @_; | ||
367 | |||||
368 | # Compatibility with old options | ||||
369 | 12 | 0s | if( !ref $opts ) { | ||
370 | 6 | 0s | my $append = $opts; | ||
371 | 6 | 0s | $opts = { append => $append || 0 }; | ||
372 | } | ||||
373 | 12 | 0s | $opts->{allow_variables} = 0 unless defined $opts->{allow_variables}; | ||
374 | |||||
375 | 12 | 0s | my $ql_opts = { allow_variables => $opts->{allow_variables} }; | ||
376 | 225 | 0s | 213 | 39.7s | my @cmds = map { '$(NOECHO) $(ECHO) '.$self->quote_literal($_, $ql_opts) } # spent 39.7s making 213 calls to ExtUtils::MM_Win32::quote_literal, avg 186ms/call |
377 | split /\n/, $text; | ||||
378 | 12 | 0s | if( $file ) { | ||
379 | 12 | 0s | my $redirect = $opts->{append} ? '>>' : '>'; | ||
380 | 12 | 0s | $cmds[0] .= " $redirect $file"; | ||
381 | 12 | 0s | $_ .= " >> $file" foreach @cmds[1..$#cmds]; | ||
382 | } | ||||
383 | |||||
384 | 12 | 0s | return @cmds; | ||
385 | } | ||||
386 | |||||
387 | |||||
388 | =head3 wraplist | ||||
389 | |||||
390 | my $args = $mm->wraplist(@list); | ||||
391 | |||||
392 | Takes an array of items and turns them into a well-formatted list of | ||||
393 | arguments. In most cases this is simply something like: | ||||
394 | |||||
395 | FOO \ | ||||
396 | BAR \ | ||||
397 | BAZ | ||||
398 | |||||
399 | =cut | ||||
400 | |||||
401 | # spent 0s within ExtUtils::MM_Any::wraplist which was called 24 times, avg 0s/call:
# 18 times (0s+0s) by ExtUtils::MM_Unix::constants at line 461 of ExtUtils/MM_Unix.pm, avg 0s/call
# 6 times (0s+0s) by ExtUtils::MM_Unix::constants at line 496 of ExtUtils/MM_Unix.pm, avg 0s/call | ||||
402 | 24 | 0s | my $self = shift; | ||
403 | 24 | 0s | return join " \\\n\t", @_; | ||
404 | } | ||||
405 | |||||
406 | |||||
407 | =head3 maketext_filter | ||||
408 | |||||
409 | my $filter_make_text = $mm->maketext_filter($make_text); | ||||
410 | |||||
411 | The text of the Makefile is run through this method before writing to | ||||
412 | disk. It allows systems a chance to make portability fixes to the | ||||
413 | Makefile. | ||||
414 | |||||
415 | By default it does nothing. | ||||
416 | |||||
417 | This method is protected and not intended to be called outside of | ||||
418 | MakeMaker. | ||||
419 | |||||
420 | =cut | ||||
421 | |||||
422 | 154 | 0s | # spent 0s within ExtUtils::MM_Any::maketext_filter which was called 154 times, avg 0s/call:
# 154 times (0s+0s) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 0s/call | ||
423 | |||||
424 | |||||
425 | =head3 cd I<Abstract> | ||||
426 | |||||
427 | my $subdir_cmd = $MM->cd($subdir, @cmds); | ||||
428 | |||||
429 | This will generate a make fragment which runs the @cmds in the given | ||||
430 | $dir. The rough equivalent to this, except cross platform. | ||||
431 | |||||
432 | cd $subdir && $cmd | ||||
433 | |||||
434 | Currently $dir can only go down one level. "foo" is fine. "foo/bar" is | ||||
435 | not. "../foo" is right out. | ||||
436 | |||||
437 | The resulting $subdir_cmd has no leading tab nor trailing newline. This | ||||
438 | makes it easier to embed in a make string. For example. | ||||
439 | |||||
440 | my $make = sprintf <<'CODE', $subdir_cmd; | ||||
441 | foo : | ||||
442 | $(ECHO) what | ||||
443 | %s | ||||
444 | $(ECHO) mouche | ||||
445 | CODE | ||||
446 | |||||
447 | |||||
448 | =head3 oneliner I<Abstract> | ||||
449 | |||||
450 | my $oneliner = $MM->oneliner($perl_code); | ||||
451 | my $oneliner = $MM->oneliner($perl_code, \@switches); | ||||
452 | |||||
453 | This will generate a perl one-liner safe for the particular platform | ||||
454 | you're on based on the given $perl_code and @switches (a -e is | ||||
455 | assumed) suitable for using in a make target. It will use the proper | ||||
456 | shell quoting and escapes. | ||||
457 | |||||
458 | $(PERLRUN) will be used as perl. | ||||
459 | |||||
460 | Any newlines in $perl_code will be escaped. Leading and trailing | ||||
461 | newlines will be stripped. Makes this idiom much easier: | ||||
462 | |||||
463 | my $code = $MM->oneliner(<<'CODE', [...switches...]); | ||||
464 | some code here | ||||
465 | another line here | ||||
466 | CODE | ||||
467 | |||||
468 | Usage might be something like: | ||||
469 | |||||
470 | # an echo emulation | ||||
471 | $oneliner = $MM->oneliner('print "Foo\n"'); | ||||
472 | $make = '$oneliner > somefile'; | ||||
473 | |||||
474 | All dollar signs must be doubled in the $perl_code if you expect them | ||||
475 | to be interpreted normally, otherwise it will be considered a make | ||||
476 | macro. Also remember to quote make macros else it might be used as a | ||||
477 | bareword. For example: | ||||
478 | |||||
479 | # Assign the value of the $(VERSION_FROM) make macro to $vf. | ||||
480 | $oneliner = $MM->oneliner('$$vf = "$(VERSION_FROM)"'); | ||||
481 | |||||
482 | Its currently very simple and may be expanded sometime in the figure | ||||
483 | to include more flexible code and switches. | ||||
484 | |||||
485 | |||||
486 | =head3 quote_literal I<Abstract> | ||||
487 | |||||
488 | my $safe_text = $MM->quote_literal($text); | ||||
489 | my $safe_text = $MM->quote_literal($text, \%options); | ||||
490 | |||||
491 | This will quote $text so it is interpreted literally in the shell. | ||||
492 | |||||
493 | For example, on Unix this would escape any single-quotes in $text and | ||||
494 | put single-quotes around the whole thing. | ||||
495 | |||||
496 | If $options{allow_variables} is true it will leave C<'$(FOO)'> make | ||||
497 | variables untouched. If false they will be escaped like any other | ||||
498 | C<$>. Defaults to true. | ||||
499 | |||||
500 | =head3 escape_dollarsigns | ||||
501 | |||||
502 | my $escaped_text = $MM->escape_dollarsigns($text); | ||||
503 | |||||
504 | Escapes stray C<$> so they are not interpreted as make variables. | ||||
505 | |||||
506 | It lets by C<$(...)>. | ||||
507 | |||||
508 | =cut | ||||
509 | |||||
510 | # spent 0s within ExtUtils::MM_Any::escape_dollarsigns which was called 82 times, avg 0s/call:
# 82 times (0s+0s) by ExtUtils::MM_Win32::quote_literal at line 548 of ExtUtils/MM_Win32.pm, avg 0s/call | ||||
511 | 82 | 0s | my($self, $text) = @_; | ||
512 | |||||
513 | # Escape dollar signs which are not starting a variable | ||||
514 | 82 | 0s | 82 | 0s | $text =~ s{\$ (?!\() }{\$\$}gx; # spent 0s making 82 calls to ExtUtils::MM_Any::CORE:subst, avg 0s/call |
515 | |||||
516 | 82 | 0s | return $text; | ||
517 | } | ||||
518 | |||||
519 | |||||
520 | =head3 escape_all_dollarsigns | ||||
521 | |||||
522 | my $escaped_text = $MM->escape_all_dollarsigns($text); | ||||
523 | |||||
524 | Escapes all C<$> so they are not interpreted as make variables. | ||||
525 | |||||
526 | =cut | ||||
527 | |||||
528 | # spent 0s within ExtUtils::MM_Any::escape_all_dollarsigns which was called 210 times, avg 0s/call:
# 210 times (0s+0s) by ExtUtils::MM_Win32::quote_literal at line 548 of ExtUtils/MM_Win32.pm, avg 0s/call | ||||
529 | 210 | 0s | my($self, $text) = @_; | ||
530 | |||||
531 | # Escape dollar signs | ||||
532 | 210 | 0s | 210 | 0s | $text =~ s{\$}{\$\$}gx; # spent 0s making 210 calls to ExtUtils::MM_Any::CORE:subst, avg 0s/call |
533 | |||||
534 | 210 | 0s | return $text; | ||
535 | } | ||||
536 | |||||
537 | |||||
538 | =head3 escape_newlines I<Abstract> | ||||
539 | |||||
540 | my $escaped_text = $MM->escape_newlines($text); | ||||
541 | |||||
542 | Shell escapes newlines in $text. | ||||
543 | |||||
544 | |||||
545 | =head3 max_exec_len I<Abstract> | ||||
546 | |||||
547 | my $max_exec_len = $MM->max_exec_len; | ||||
548 | |||||
549 | Calculates the maximum command size the OS can exec. Effectively, | ||||
550 | this is the max size of a shell command line. | ||||
551 | |||||
552 | =for _private | ||||
553 | $self->{_MAX_EXEC_LEN} is set by this method, but only for testing purposes. | ||||
554 | |||||
555 | |||||
556 | =head3 make | ||||
557 | |||||
558 | my $make = $MM->make; | ||||
559 | |||||
560 | Returns the make variant we're generating the Makefile for. This attempts | ||||
561 | to do some normalization on the information from %Config or the user. | ||||
562 | |||||
563 | =cut | ||||
564 | |||||
565 | # spent 16.6ms within ExtUtils::MM_Any::make which was called 672 times, avg 25µs/call:
# 336 times (16.6ms+0s) by ExtUtils::MM_Any::is_make_type at line 207, avg 49µs/call
# 333 times (0s+0s) by ExtUtils::MM_Any::is_make_type at line 212, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MakeMaker::flush at line 1159 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
566 | 672 | 0s | my $self = shift; | ||
567 | |||||
568 | 672 | 0s | my $make = lc $self->{MAKE}; | ||
569 | |||||
570 | # Truncate anything like foomake6 to just foomake. | ||||
571 | 672 | 1.00ms | 672 | 0s | $make =~ s/^(\w+make).*/$1/; # spent 0s making 672 calls to ExtUtils::MM_Any::CORE:subst, avg 0s/call |
572 | |||||
573 | # Turn gnumake into gmake. | ||||
574 | 672 | 0s | 672 | 0s | $make =~ s/^gnu/g/; # spent 0s making 672 calls to ExtUtils::MM_Any::CORE:subst, avg 0s/call |
575 | |||||
576 | 672 | 0s | return $make; | ||
577 | } | ||||
578 | |||||
579 | |||||
580 | =head2 Targets | ||||
581 | |||||
582 | These are methods which produce make targets. | ||||
583 | |||||
584 | |||||
585 | =head3 all_target | ||||
586 | |||||
587 | Generate the default target 'all'. | ||||
588 | |||||
589 | =cut | ||||
590 | |||||
591 | # spent 0s within ExtUtils::MM_Any::all_target which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Unix::top_targets at line 3669 of ExtUtils/MM_Unix.pm, avg 0s/call | ||||
592 | 3 | 0s | my $self = shift; | ||
593 | |||||
594 | 3 | 0s | return <<'MAKE_EXT'; | ||
595 | all :: pure_all | ||||
596 | $(NOECHO) $(NOOP) | ||||
597 | MAKE_EXT | ||||
598 | |||||
599 | } | ||||
600 | |||||
601 | |||||
602 | =head3 blibdirs_target | ||||
603 | |||||
604 | my $make_frag = $mm->blibdirs_target; | ||||
605 | |||||
606 | Creates the blibdirs target which creates all the directories we use | ||||
607 | in blib/. | ||||
608 | |||||
609 | The blibdirs.ts target is deprecated. Depend on blibdirs instead. | ||||
610 | |||||
611 | |||||
612 | =cut | ||||
613 | |||||
614 | # spent 0s within ExtUtils::MM_Any::blibdirs_target which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
615 | 3 | 0s | my $self = shift; | ||
616 | |||||
617 | 3 | 0s | my @dirs = map { uc "\$(INST_$_)" } qw(libdir archlib | ||
618 | autodir archautodir | ||||
619 | bin script | ||||
620 | man1dir man3dir | ||||
621 | ); | ||||
622 | |||||
623 | 3 | 0s | my @exists = map { $_.'$(DFSEP).exists' } @dirs; | ||
624 | |||||
625 | 3 | 0s | my $make = sprintf <<'MAKE', join(' ', @exists); | ||
626 | blibdirs : %s | ||||
627 | $(NOECHO) $(NOOP) | ||||
628 | |||||
629 | # Backwards compat with 6.18 through 6.25 | ||||
630 | blibdirs.ts : blibdirs | ||||
631 | $(NOECHO) $(NOOP) | ||||
632 | |||||
633 | MAKE | ||||
634 | |||||
635 | 3 | 0s | 3 | 0s | $make .= $self->dir_target(@dirs); # spent 0s making 3 calls to ExtUtils::MM_Any::dir_target, avg 0s/call |
636 | |||||
637 | 3 | 0s | return $make; | ||
638 | } | ||||
639 | |||||
640 | |||||
641 | =head3 clean (o) | ||||
642 | |||||
643 | Defines the clean target. | ||||
644 | |||||
645 | =cut | ||||
646 | |||||
647 | # spent 0s within ExtUtils::MM_Any::clean which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
648 | # --- Cleanup and Distribution Sections --- | ||||
649 | |||||
650 | 3 | 0s | my($self, %attribs) = @_; | ||
651 | 3 | 0s | my @m; | ||
652 | 3 | 0s | push(@m, ' | ||
653 | # Delete temporary files but do not touch installed files. We don\'t delete | ||||
654 | # the Makefile here so a later make realclean still has a makefile to use. | ||||
655 | |||||
656 | clean :: clean_subdirs | ||||
657 | '); | ||||
658 | |||||
659 | 3 | 0s | 3 | 0s | my @files = sort values %{$self->{XS}}; # .c files from *.xs files # spent 0s making 3 calls to ExtUtils::MM_Any::CORE:sort, avg 0s/call |
660 | 3 | 0s | my @dirs = qw(blib); | ||
661 | |||||
662 | # Normally these are all under blib but they might have been | ||||
663 | # redefined. | ||||
664 | # XXX normally this would be a good idea, but the Perl core sets | ||||
665 | # INST_LIB = ../../lib rather than actually installing the files. | ||||
666 | # So a "make clean" in an ext/ directory would blow away lib. | ||||
667 | # Until the core is adjusted let's leave this out. | ||||
668 | # push @dirs, qw($(INST_ARCHLIB) $(INST_LIB) | ||||
669 | # $(INST_BIN) $(INST_SCRIPT) | ||||
670 | # $(INST_MAN1DIR) $(INST_MAN3DIR) | ||||
671 | # $(INST_LIBDIR) $(INST_ARCHLIBDIR) $(INST_AUTODIR) | ||||
672 | # $(INST_STATIC) $(INST_DYNAMIC) | ||||
673 | # ); | ||||
674 | |||||
675 | |||||
676 | 3 | 0s | if( $attribs{FILES} ) { | ||
677 | # Use @dirs because we don't know what's in here. | ||||
678 | push @dirs, ref $attribs{FILES} ? | ||||
679 | 1 | 0s | @{$attribs{FILES}} : | ||
680 | split /\s+/, $attribs{FILES} ; | ||||
681 | } | ||||
682 | |||||
683 | 3 | 0s | push(@files, qw[$(MAKE_APERL_FILE) | ||
684 | MYMETA.json MYMETA.yml perlmain.c tmon.out mon.out so_locations | ||||
685 | blibdirs.ts pm_to_blib pm_to_blib.ts | ||||
686 | *$(OBJ_EXT) *$(LIB_EXT) perl.exe perl perl$(EXE_EXT) | ||||
687 | $(BOOTSTRAP) $(BASEEXT).bso | ||||
688 | $(BASEEXT).def lib$(BASEEXT).def | ||||
689 | $(BASEEXT).exp $(BASEEXT).x | ||||
690 | ]); | ||||
691 | |||||
692 | 3 | 0s | 3 | 0s | push(@files, $self->catfile('$(INST_ARCHAUTODIR)','extralibs.all')); # spent 0s making 3 calls to ExtUtils::MM_Any::catfile, avg 0s/call |
693 | 3 | 0s | 3 | 0s | push(@files, $self->catfile('$(INST_ARCHAUTODIR)','extralibs.ld')); # spent 0s making 3 calls to ExtUtils::MM_Any::catfile, avg 0s/call |
694 | |||||
695 | # core files | ||||
696 | 3 | 0s | if ($^O eq 'vos') { | ||
697 | push(@files, qw[perl*.kp]); | ||||
698 | } | ||||
699 | else { | ||||
700 | 3 | 0s | push(@files, qw[core core.*perl.*.? *perl.core]); | ||
701 | } | ||||
702 | |||||
703 | 3 | 0s | push(@files, map { "core." . "[0-9]"x$_ } (1..5)); | ||
704 | |||||
705 | # OS specific things to clean up. Use @dirs since we don't know | ||||
706 | # what might be in here. | ||||
707 | 3 | 0s | 3 | 0s | push @dirs, $self->extra_clean_files; # spent 0s making 3 calls to ExtUtils::MM_Win32::extra_clean_files, avg 0s/call |
708 | |||||
709 | # Occasionally files are repeated several times from different sources | ||||
710 | 9 | 0s | 3 | 0s | { my(%f) = map { ($_ => 1) } @files; @files = sort keys %f; } # spent 0s making 3 calls to ExtUtils::MM_Any::CORE:sort, avg 0s/call |
711 | 9 | 0s | 3 | 0s | { my(%d) = map { ($_ => 1) } @dirs; @dirs = sort keys %d; } # spent 0s making 3 calls to ExtUtils::MM_Any::CORE:sort, avg 0s/call |
712 | |||||
713 | 3 | 0s | 3 | 0s | push @m, map "\t$_\n", $self->split_command('- $(RM_F)', @files); # spent 0s making 3 calls to ExtUtils::MM_Any::split_command, avg 0s/call |
714 | 3 | 0s | 3 | 0s | push @m, map "\t$_\n", $self->split_command('- $(RM_RF)', @dirs); # spent 0s making 3 calls to ExtUtils::MM_Any::split_command, avg 0s/call |
715 | |||||
716 | # Leave Makefile.old around for realclean | ||||
717 | 3 | 0s | push @m, <<'MAKE'; | ||
718 | $(NOECHO) $(RM_F) $(MAKEFILE_OLD) | ||||
719 | - $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) | ||||
720 | MAKE | ||||
721 | |||||
722 | 3 | 0s | push(@m, "\t$attribs{POSTOP}\n") if $attribs{POSTOP}; | ||
723 | |||||
724 | 3 | 0s | join("", @m); | ||
725 | } | ||||
726 | |||||
727 | |||||
728 | =head3 clean_subdirs_target | ||||
729 | |||||
730 | my $make_frag = $MM->clean_subdirs_target; | ||||
731 | |||||
732 | Returns the clean_subdirs target. This is used by the clean target to | ||||
733 | call clean on any subdirectories which contain Makefiles. | ||||
734 | |||||
735 | =cut | ||||
736 | |||||
737 | # spent 359ms (0s+359) within ExtUtils::MM_Any::clean_subdirs_target which was called 3 times, avg 120ms/call:
# 3 times (0s+359ms) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 120ms/call | ||||
738 | 3 | 0s | my($self) = shift; | ||
739 | |||||
740 | # No subdirectories, no cleaning. | ||||
741 | 3 | 0s | return <<'NOOP_FRAG' unless @{$self->{DIR}}; | ||
742 | clean_subdirs : | ||||
743 | $(NOECHO) $(NOOP) | ||||
744 | NOOP_FRAG | ||||
745 | |||||
746 | |||||
747 | 1 | 0s | my $clean = "clean_subdirs :\n"; | ||
748 | |||||
749 | 1 | 0s | for my $dir (@{$self->{DIR}}) { | ||
750 | 2 | 0s | 2 | 359ms | my $subclean = $self->oneliner(sprintf <<'CODE', $dir); # spent 359ms making 2 calls to ExtUtils::MM_Win32::oneliner, avg 179ms/call |
751 | exit 0 unless chdir '%s'; system '$(MAKE) clean' if -f '$(FIRST_MAKEFILE)'; | ||||
752 | CODE | ||||
753 | |||||
754 | 2 | 0s | $clean .= "\t$subclean\n"; | ||
755 | } | ||||
756 | |||||
757 | 1 | 0s | return $clean; | ||
758 | } | ||||
759 | |||||
760 | |||||
761 | =head3 dir_target | ||||
762 | |||||
763 | my $make_frag = $mm->dir_target(@directories); | ||||
764 | |||||
765 | Generates targets to create the specified directories and set its | ||||
766 | permission to PERM_DIR. | ||||
767 | |||||
768 | Because depending on a directory to just ensure it exists doesn't work | ||||
769 | too well (the modified time changes too often) dir_target() creates a | ||||
770 | .exists file in the created directory. It is this you should depend on. | ||||
771 | For portability purposes you should use the $(DIRFILESEP) macro rather | ||||
772 | than a '/' to separate the directory from the file. | ||||
773 | |||||
774 | yourdirectory$(DIRFILESEP).exists | ||||
775 | |||||
776 | =cut | ||||
777 | |||||
778 | # spent 0s within ExtUtils::MM_Any::dir_target which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Any::blibdirs_target at line 635, avg 0s/call | ||||
779 | 3 | 0s | my($self, @dirs) = @_; | ||
780 | |||||
781 | 3 | 0s | my $make = ''; | ||
782 | 3 | 0s | foreach my $dir (@dirs) { | ||
783 | 24 | 0s | $make .= sprintf <<'MAKE', ($dir) x 4; | ||
784 | %s$(DFSEP).exists :: Makefile.PL | ||||
785 | $(NOECHO) $(MKPATH) %s | ||||
786 | $(NOECHO) $(CHMOD) $(PERM_DIR) %s | ||||
787 | $(NOECHO) $(TOUCH) %s$(DFSEP).exists | ||||
788 | |||||
789 | MAKE | ||||
790 | |||||
791 | } | ||||
792 | |||||
793 | 3 | 0s | return $make; | ||
794 | } | ||||
795 | |||||
796 | |||||
797 | =head3 distdir | ||||
798 | |||||
799 | Defines the scratch directory target that will hold the distribution | ||||
800 | before tar-ing (or shar-ing). | ||||
801 | |||||
802 | =cut | ||||
803 | |||||
804 | # For backwards compatibility. | ||||
805 | 1 | 0s | *dist_dir = *distdir; | ||
806 | |||||
807 | # spent 0s within ExtUtils::MM_Any::distdir which was called:
# once (0s+0s) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm | ||||
808 | 1 | 0s | my($self) = shift; | ||
809 | |||||
810 | 1 | 0s | my $meta_target = $self->{NO_META} ? '' : 'distmeta'; | ||
811 | 1 | 0s | my $sign_target = !$self->{SIGN} ? '' : 'distsignature'; | ||
812 | |||||
813 | 1 | 0s | return sprintf <<'MAKE_FRAG', $meta_target, $sign_target; | ||
814 | create_distdir : | ||||
815 | $(RM_RF) $(DISTVNAME) | ||||
816 | $(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \ | ||||
817 | -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');" | ||||
818 | |||||
819 | distdir : create_distdir %s %s | ||||
820 | $(NOECHO) $(NOOP) | ||||
821 | |||||
822 | MAKE_FRAG | ||||
823 | |||||
824 | } | ||||
825 | |||||
826 | |||||
827 | =head3 dist_test | ||||
828 | |||||
829 | Defines a target that produces the distribution in the | ||||
830 | scratch directory, and runs 'perl Makefile.PL; make ;make test' in that | ||||
831 | subdirectory. | ||||
832 | |||||
833 | =cut | ||||
834 | |||||
835 | # spent 187ms (0s+187) within ExtUtils::MM_Any::dist_test which was called:
# once (0s+187ms) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm | ||||
836 | 1 | 0s | my($self) = shift; | ||
837 | |||||
838 | 1 | 0s | my $mpl_args = join " ", map qq["$_"], @ARGV; | ||
839 | |||||
840 | 1 | 0s | 1 | 187ms | my $test = $self->cd('$(DISTVNAME)', # spent 187ms making 1 call to ExtUtils::MM_Win32::cd |
841 | '$(ABSPERLRUN) Makefile.PL '.$mpl_args, | ||||
842 | '$(MAKE) $(PASTHRU)', | ||||
843 | '$(MAKE) test $(PASTHRU)' | ||||
844 | ); | ||||
845 | |||||
846 | 1 | 0s | return sprintf <<'MAKE_FRAG', $test; | ||
847 | disttest : distdir | ||||
848 | %s | ||||
849 | |||||
850 | MAKE_FRAG | ||||
851 | |||||
852 | |||||
853 | } | ||||
854 | |||||
855 | |||||
856 | =head3 dynamic (o) | ||||
857 | |||||
858 | Defines the dynamic target. | ||||
859 | |||||
860 | =cut | ||||
861 | |||||
862 | # spent 0s within ExtUtils::MM_Any::dynamic which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
863 | # --- Dynamic Loading Sections --- | ||||
864 | |||||
865 | 3 | 0s | my($self) = shift; | ||
866 | 3 | 0s | ' | ||
867 | dynamic :: $(FIRST_MAKEFILE) $(BOOTSTRAP) $(INST_DYNAMIC) | ||||
868 | $(NOECHO) $(NOOP) | ||||
869 | '; | ||||
870 | } | ||||
871 | |||||
872 | |||||
873 | =head3 makemakerdflt_target | ||||
874 | |||||
875 | my $make_frag = $mm->makemakerdflt_target | ||||
876 | |||||
877 | Returns a make fragment with the makemakerdeflt_target specified. | ||||
878 | This target is the first target in the Makefile, is the default target | ||||
879 | and simply points off to 'all' just in case any make variant gets | ||||
880 | confused or something gets snuck in before the real 'all' target. | ||||
881 | |||||
882 | =cut | ||||
883 | |||||
884 | # spent 0s within ExtUtils::MM_Any::makemakerdflt_target which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
885 | 3 | 0s | return <<'MAKE_FRAG'; | ||
886 | makemakerdflt : all | ||||
887 | $(NOECHO) $(NOOP) | ||||
888 | MAKE_FRAG | ||||
889 | |||||
890 | } | ||||
891 | |||||
892 | |||||
893 | =head3 manifypods_target | ||||
894 | |||||
895 | my $manifypods_target = $self->manifypods_target; | ||||
896 | |||||
897 | Generates the manifypods target. This target generates man pages from | ||||
898 | all POD files in MAN1PODS and MAN3PODS. | ||||
899 | |||||
900 | =cut | ||||
901 | |||||
902 | # spent 0s within ExtUtils::MM_Any::manifypods_target which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Any::manifypods at line 2451, avg 0s/call | ||||
903 | 3 | 0s | my($self) = shift; | ||
904 | |||||
905 | 3 | 0s | my $man1pods = ''; | ||
906 | 3 | 0s | my $man3pods = ''; | ||
907 | 3 | 0s | my $dependencies = ''; | ||
908 | |||||
909 | # populate manXpods & dependencies: | ||||
910 | 3 | 0s | 6 | 0s | foreach my $name (sort keys %{$self->{MAN1PODS}}, sort keys %{$self->{MAN3PODS}}) { # spent 0s making 6 calls to ExtUtils::MM_Any::CORE:sort, avg 0s/call |
911 | $dependencies .= " \\\n\t$name"; | ||||
912 | } | ||||
913 | |||||
914 | 3 | 0s | my $manify = <<END; | ||
915 | manifypods : pure_all $dependencies | ||||
916 | END | ||||
917 | |||||
918 | 3 | 0s | my @man_cmds; | ||
919 | 3 | 0s | foreach my $section (qw(1 3)) { | ||
920 | 6 | 0s | my $pods = $self->{"MAN${section}PODS"}; | ||
921 | 6 | 0s | my $p2m = sprintf <<CMD, $] > 5.008 ? " -u" : ""; | ||
922 | \$(NOECHO) \$(POD2MAN) --section=$section --perm_rw=\$(PERM_RW)%s | ||||
923 | CMD | ||||
924 | 6 | 0s | 12 | 0s | push @man_cmds, $self->split_command($p2m, map {($_,$pods->{$_})} sort keys %$pods); # spent 0s making 6 calls to ExtUtils::MM_Any::CORE:sort, avg 0s/call
# spent 0s making 6 calls to ExtUtils::MM_Any::split_command, avg 0s/call |
925 | } | ||||
926 | |||||
927 | 3 | 0s | $manify .= "\t\$(NOECHO) \$(NOOP)\n" unless @man_cmds; | ||
928 | 3 | 0s | $manify .= join '', map { "$_\n" } @man_cmds; | ||
929 | |||||
930 | 3 | 0s | return $manify; | ||
931 | } | ||||
932 | |||||
933 | # spent 31.2ms (0s+31.2) within ExtUtils::MM_Any::_has_cpan_meta which was called 15 times, avg 2.08ms/call:
# 6 times (0s+0s) by ExtUtils::MM_Any::_fix_metadata_before_conversion at line 1024, avg 0s/call
# 3 times (0s+31.2ms) by ExtUtils::MM_Any::metafile_target at line 955, avg 10.4ms/call
# 3 times (0s+0s) by ExtUtils::MM_Any::write_mymeta at line 1522, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::_mymeta_from_meta at line 1484, avg 0s/call | ||||
934 | 15 | 0s | return eval { | ||
935 | 15 | 0s | require CPAN::Meta; | ||
936 | 15 | 0s | 15 | 0s | CPAN::Meta->VERSION(2.112150); # spent 0s making 15 calls to version::vxs::_VERSION, avg 0s/call |
937 | 15 | 0s | 1; | ||
938 | }; | ||||
939 | } | ||||
940 | |||||
941 | =head3 metafile_target | ||||
942 | |||||
943 | my $target = $mm->metafile_target; | ||||
944 | |||||
945 | Generate the metafile target. | ||||
946 | |||||
947 | Writes the file META.yml (YAML encoded meta-data) and META.json | ||||
948 | (JSON encoded meta-data) about the module in the distdir. | ||||
949 | The format follows Module::Build's as closely as possible. | ||||
950 | |||||
951 | =cut | ||||
952 | |||||
953 | # spent 35.4s (0+35.4) within ExtUtils::MM_Any::metafile_target which was called 3 times, avg 11.8s/call:
# 3 times (0s+35.4s) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 11.8s/call | ||||
954 | 3 | 0s | my $self = shift; | ||
955 | 3 | 0s | 3 | 31.2ms | return <<'MAKE_FRAG' if $self->{NO_META} or ! _has_cpan_meta(); # spent 31.2ms making 3 calls to ExtUtils::MM_Any::_has_cpan_meta, avg 10.4ms/call |
956 | metafile : | ||||
957 | $(NOECHO) $(NOOP) | ||||
958 | MAKE_FRAG | ||||
959 | |||||
960 | 3 | 0s | 3 | 0s | my %metadata = $self->metafile_data( # spent 0s making 3 calls to ExtUtils::MM_Any::metafile_data, avg 0s/call |
961 | $self->{META_ADD} || {}, | ||||
962 | $self->{META_MERGE} || {}, | ||||
963 | ); | ||||
964 | |||||
965 | 3 | 0s | 3 | 0s | _fix_metadata_before_conversion( \%metadata ); # spent 0s making 3 calls to ExtUtils::MM_Any::_fix_metadata_before_conversion, avg 0s/call |
966 | |||||
967 | # paper over validation issues, but still complain, necessary because | ||||
968 | # there's no guarantee that the above will fix ALL errors | ||||
969 | 6 | 0s | 3 | 46.8ms | my $meta = eval { CPAN::Meta->create( \%metadata, { lazy_validation => 1 } ) }; # spent 46.8ms making 3 calls to CPAN::Meta::create, avg 15.6ms/call |
970 | 3 | 0s | warn $@ if $@ and | ||
971 | $@ !~ /encountered CODE.*, but JSON can only represent references to arrays or hashes/; | ||||
972 | |||||
973 | # use the original metadata straight if the conversion failed | ||||
974 | # or if it can't be stringified. | ||||
975 | 3 | 0s | if( !$meta || | ||
976 | 3 | 0s | 3 | 31.2ms | !eval { $meta->as_string( { version => "1.4" } ) } || # spent 31.2ms making 3 calls to CPAN::Meta::as_string, avg 10.4ms/call |
977 | 3 | 0s | 3 | 0s | !eval { $meta->as_string } # spent 0s making 3 calls to CPAN::Meta::as_string, avg 0s/call |
978 | ) | ||||
979 | { | ||||
980 | $meta = bless \%metadata, 'CPAN::Meta'; | ||||
981 | } | ||||
982 | |||||
983 | 3 | 0s | 6 | 12.2s | my @write_metayml = $self->echo( # spent 12.2s making 3 calls to ExtUtils::MM_Any::echo, avg 4.06s/call
# spent 31.2ms making 3 calls to CPAN::Meta::as_string, avg 10.4ms/call |
984 | $meta->as_string({version => "1.4"}), 'META_new.yml' | ||||
985 | ); | ||||
986 | 3 | 0s | 6 | 23.1s | my @write_metajson = $self->echo( # spent 23.1s making 3 calls to ExtUtils::MM_Any::echo, avg 7.69s/call
# spent 15.6ms making 3 calls to CPAN::Meta::as_string, avg 5.20ms/call |
987 | $meta->as_string(), 'META_new.json' | ||||
988 | ); | ||||
989 | |||||
990 | 3 | 0s | my $metayml = join("\n\t", @write_metayml); | ||
991 | 3 | 0s | my $metajson = join("\n\t", @write_metajson); | ||
992 | 3 | 0s | return sprintf <<'MAKE_FRAG', $metayml, $metajson; | ||
993 | metafile : create_distdir | ||||
994 | $(NOECHO) $(ECHO) Generating META.yml | ||||
995 | %s | ||||
996 | -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml | ||||
997 | $(NOECHO) $(ECHO) Generating META.json | ||||
998 | %s | ||||
999 | -$(NOECHO) $(MV) META_new.json $(DISTVNAME)/META.json | ||||
1000 | MAKE_FRAG | ||||
1001 | |||||
1002 | } | ||||
1003 | |||||
1004 | =begin private | ||||
1005 | |||||
1006 | =head3 _fix_metadata_before_conversion | ||||
1007 | |||||
1008 | _fix_metadata_before_conversion( \%metadata ); | ||||
1009 | |||||
1010 | Fixes errors in the metadata before it's handed off to CPAN::Meta for | ||||
1011 | conversion. This hopefully results in something that can be used further | ||||
1012 | on, no guarantee is made though. | ||||
1013 | |||||
1014 | =end private | ||||
1015 | |||||
1016 | =cut | ||||
1017 | |||||
1018 | sub _fix_metadata_before_conversion { | ||||
1019 | 6 | 0s | my ( $metadata ) = @_; | ||
1020 | |||||
1021 | # we should never be called unless this already passed but | ||||
1022 | # prefer to be defensive in case somebody else calls this | ||||
1023 | |||||
1024 | 6 | 0s | 6 | 0s | return unless _has_cpan_meta; # spent 0s making 6 calls to ExtUtils::MM_Any::_has_cpan_meta, avg 0s/call |
1025 | |||||
1026 | 6 | 0s | 12 | 0s | my $bad_version = $metadata->{version} && # spent 0s making 6 calls to CPAN::Meta::Validator::new, avg 0s/call
# spent 0s making 6 calls to CPAN::Meta::Validator::version, avg 0s/call |
1027 | !CPAN::Meta::Validator->new->version( 'version', $metadata->{version} ); | ||||
1028 | |||||
1029 | # just delete all invalid versions | ||||
1030 | 6 | 0s | if( $bad_version ) { | ||
1031 | warn "Can't parse version '$metadata->{version}'\n"; | ||||
1032 | $metadata->{version} = ''; | ||||
1033 | } | ||||
1034 | |||||
1035 | 6 | 0s | 6 | 0s | my $validator = CPAN::Meta::Validator->new( $metadata ); # spent 0s making 6 calls to CPAN::Meta::Validator::new, avg 0s/call |
1036 | 6 | 0s | 6 | 0s | return if $validator->is_valid; # spent 0s making 6 calls to CPAN::Meta::Validator::is_valid, avg 0s/call |
1037 | |||||
1038 | # fix non-camelcase custom resource keys (only other trick we know) | ||||
1039 | 1 | 0s | 1 | 0s | for my $error ( $validator->errors ) { # spent 0s making 1 call to CPAN::Meta::Validator::errors |
1040 | 3 | 0s | 3 | 0s | my ( $key ) = ( $error =~ /Custom resource '(.*)' must be in CamelCase./ ); # spent 0s making 3 calls to ExtUtils::MM_Any::CORE:match, avg 0s/call |
1041 | 3 | 0s | next if !$key; | ||
1042 | |||||
1043 | # first try to remove all non-alphabetic chars | ||||
1044 | ( my $new_key = $key ) =~ s/[^_a-zA-Z]//g; | ||||
1045 | |||||
1046 | # if that doesn't work, uppercase first one | ||||
1047 | $new_key = ucfirst $new_key if !$validator->custom_1( $new_key ); | ||||
1048 | |||||
1049 | # copy to new key if that worked | ||||
1050 | $metadata->{resources}{$new_key} = $metadata->{resources}{$key} | ||||
1051 | if $validator->custom_1( $new_key ); | ||||
1052 | |||||
1053 | # and delete old one in any case | ||||
1054 | delete $metadata->{resources}{$key}; | ||||
1055 | } | ||||
1056 | |||||
1057 | 1 | 0s | return; | ||
1058 | } | ||||
1059 | |||||
1060 | |||||
1061 | =begin private | ||||
1062 | |||||
1063 | =head3 _sort_pairs | ||||
1064 | |||||
1065 | my @pairs = _sort_pairs($sort_sub, \%hash); | ||||
1066 | |||||
1067 | Sorts the pairs of a hash based on keys ordered according | ||||
1068 | to C<$sort_sub>. | ||||
1069 | |||||
1070 | =end private | ||||
1071 | |||||
1072 | =cut | ||||
1073 | |||||
1074 | sub _sort_pairs { | ||||
1075 | my $sort = shift; | ||||
1076 | my $pairs = shift; | ||||
1077 | return map { $_ => $pairs->{$_} } | ||||
1078 | sort $sort | ||||
1079 | keys %$pairs; | ||||
1080 | } | ||||
1081 | |||||
1082 | |||||
1083 | # Taken from Module::Build::Base | ||||
1084 | sub _hash_merge { | ||||
1085 | 3 | 0s | my ($self, $h, $k, $v) = @_; | ||
1086 | 3 | 0s | if (ref $h->{$k} eq 'ARRAY') { | ||
1087 | push @{$h->{$k}}, ref $v ? @$v : $v; | ||||
1088 | } elsif (ref $h->{$k} eq 'HASH') { | ||||
1089 | 1 | 0s | 1 | 0s | $self->_hash_merge($h->{$k}, $_, $v->{$_}) foreach keys %$v; # spent 0s making 1 call to ExtUtils::MM_Any::_hash_merge, recursion: max depth 1, sum of overlapping time 0s |
1090 | } else { | ||||
1091 | 2 | 0s | $h->{$k} = $v; | ||
1092 | } | ||||
1093 | } | ||||
1094 | |||||
1095 | |||||
1096 | =head3 metafile_data | ||||
1097 | |||||
1098 | my @metadata_pairs = $mm->metafile_data(\%meta_add, \%meta_merge); | ||||
1099 | |||||
1100 | Returns the data which MakeMaker turns into the META.yml file | ||||
1101 | and the META.json file. | ||||
1102 | |||||
1103 | Values of %meta_add will overwrite any existing metadata in those | ||||
1104 | keys. %meta_merge will be merged with them. | ||||
1105 | |||||
1106 | =cut | ||||
1107 | |||||
1108 | sub metafile_data { | ||||
1109 | 5 | 0s | my $self = shift; | ||
1110 | 5 | 0s | my($meta_add, $meta_merge) = @_; | ||
1111 | |||||
1112 | 5 | 0s | 5 | 0s | my %meta = ( # spent 0s making 5 calls to ExtUtils::MM_Any::_normalize_version, avg 0s/call |
1113 | # required | ||||
1114 | name => $self->{DISTNAME}, | ||||
1115 | version => _normalize_version($self->{VERSION}), | ||||
1116 | abstract => $self->{ABSTRACT} || 'unknown', | ||||
1117 | license => $self->{LICENSE} || 'unknown', | ||||
1118 | dynamic_config => 1, | ||||
1119 | |||||
1120 | # optional | ||||
1121 | distribution_type => $self->{PM} ? 'module' : 'script', | ||||
1122 | |||||
1123 | no_index => { | ||||
1124 | directory => [qw(t inc)] | ||||
1125 | }, | ||||
1126 | |||||
1127 | generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION", | ||||
1128 | 'meta-spec' => { | ||||
1129 | url => 'http://module-build.sourceforge.net/META-spec-v1.4.html', | ||||
1130 | version => 1.4 | ||||
1131 | }, | ||||
1132 | ); | ||||
1133 | |||||
1134 | # The author key is required and it takes a list. | ||||
1135 | 5 | 0s | $meta{author} = defined $self->{AUTHOR} ? $self->{AUTHOR} : []; | ||
1136 | |||||
1137 | { | ||||
1138 | 10 | 0s | 5 | 0s | my $vers = _metaspec_version( $meta_add, $meta_merge ); # spent 0s making 5 calls to ExtUtils::MM_Any::_metaspec_version, avg 0s/call |
1139 | 5 | 0s | 5 | 0s | my $method = $vers =~ m!^2! # spent 0s making 5 calls to ExtUtils::MM_Any::CORE:match, avg 0s/call |
1140 | ? '_add_requirements_to_meta_v2' | ||||
1141 | : '_add_requirements_to_meta_v1_4'; | ||||
1142 | 5 | 0s | 5 | 0s | %meta = $self->$method( %meta ); # spent 0s making 4 calls to ExtUtils::MM_Any::_add_requirements_to_meta_v1_4, avg 0s/call
# spent 0s making 1 call to ExtUtils::MM_Any::_add_requirements_to_meta_v2 |
1143 | } | ||||
1144 | |||||
1145 | 5 | 0s | while( my($key, $val) = each %$meta_add ) { | ||
1146 | $meta{$key} = $val; | ||||
1147 | } | ||||
1148 | |||||
1149 | 5 | 0s | 2 | 0s | while( my($key, $val) = each %$meta_merge ) { # spent 0s making 2 calls to ExtUtils::MM_Any::_hash_merge, avg 0s/call |
1150 | $self->_hash_merge(\%meta, $key, $val); | ||||
1151 | } | ||||
1152 | |||||
1153 | 5 | 0s | return %meta; | ||
1154 | } | ||||
1155 | |||||
1156 | |||||
1157 | =begin private | ||||
1158 | |||||
1159 | =cut | ||||
1160 | |||||
1161 | # spent 0s within ExtUtils::MM_Any::_metaspec_version which was called 5 times, avg 0s/call:
# 5 times (0s+0s) by ExtUtils::MM_Any::metafile_data at line 1138, avg 0s/call | ||||
1162 | 5 | 0s | my ( $meta_add, $meta_merge ) = @_; | ||
1163 | 5 | 0s | return $meta_add->{'meta-spec'}->{version} | ||
1164 | if defined $meta_add->{'meta-spec'} | ||||
1165 | and defined $meta_add->{'meta-spec'}->{version}; | ||||
1166 | 5 | 0s | return $meta_merge->{'meta-spec'}->{version} | ||
1167 | if defined $meta_merge->{'meta-spec'} | ||||
1168 | and defined $meta_merge->{'meta-spec'}->{version}; | ||||
1169 | 4 | 0s | return '1.4'; | ||
1170 | } | ||||
1171 | |||||
1172 | sub _add_requirements_to_meta_v1_4 { | ||||
1173 | 6 | 0s | my ( $self, %meta ) = @_; | ||
1174 | |||||
1175 | # Check the original args so we can tell between the user setting it | ||||
1176 | # to an empty hash and it just being initialized. | ||||
1177 | 6 | 0s | if( $self->{ARGS}{CONFIGURE_REQUIRES} ) { | ||
1178 | $meta{configure_requires} = $self->{CONFIGURE_REQUIRES}; | ||||
1179 | } else { | ||||
1180 | 6 | 0s | $meta{configure_requires} = { | ||
1181 | 'ExtUtils::MakeMaker' => 0, | ||||
1182 | }; | ||||
1183 | } | ||||
1184 | |||||
1185 | 6 | 0s | if( $self->{ARGS}{BUILD_REQUIRES} ) { | ||
1186 | $meta{build_requires} = $self->{BUILD_REQUIRES}; | ||||
1187 | } else { | ||||
1188 | 6 | 0s | $meta{build_requires} = { | ||
1189 | 'ExtUtils::MakeMaker' => 0, | ||||
1190 | }; | ||||
1191 | } | ||||
1192 | |||||
1193 | 6 | 0s | if( $self->{ARGS}{TEST_REQUIRES} ) { | ||
1194 | $meta{build_requires} = { | ||||
1195 | %{ $meta{build_requires} }, | ||||
1196 | %{ $self->{TEST_REQUIRES} }, | ||||
1197 | }; | ||||
1198 | } | ||||
1199 | |||||
1200 | 6 | 0s | $meta{requires} = $self->{PREREQ_PM} | ||
1201 | if defined $self->{PREREQ_PM}; | ||||
1202 | 6 | 0s | $meta{requires}{perl} = _normalize_version($self->{MIN_PERL_VERSION}) | ||
1203 | if $self->{MIN_PERL_VERSION}; | ||||
1204 | |||||
1205 | 6 | 0s | return %meta; | ||
1206 | } | ||||
1207 | |||||
1208 | sub _add_requirements_to_meta_v2 { | ||||
1209 | 2 | 0s | my ( $self, %meta ) = @_; | ||
1210 | |||||
1211 | # Check the original args so we can tell between the user setting it | ||||
1212 | # to an empty hash and it just being initialized. | ||||
1213 | 2 | 0s | if( $self->{ARGS}{CONFIGURE_REQUIRES} ) { | ||
1214 | $meta{prereqs}{configure}{requires} = $self->{CONFIGURE_REQUIRES}; | ||||
1215 | } else { | ||||
1216 | 2 | 0s | $meta{prereqs}{configure}{requires} = { | ||
1217 | 'ExtUtils::MakeMaker' => 0, | ||||
1218 | }; | ||||
1219 | } | ||||
1220 | |||||
1221 | 2 | 0s | if( $self->{ARGS}{BUILD_REQUIRES} ) { | ||
1222 | $meta{prereqs}{build}{requires} = $self->{BUILD_REQUIRES}; | ||||
1223 | } else { | ||||
1224 | 2 | 0s | $meta{prereqs}{build}{requires} = { | ||
1225 | 'ExtUtils::MakeMaker' => 0, | ||||
1226 | }; | ||||
1227 | } | ||||
1228 | |||||
1229 | 2 | 0s | if( $self->{ARGS}{TEST_REQUIRES} ) { | ||
1230 | $meta{prereqs}{test}{requires} = $self->{TEST_REQUIRES}; | ||||
1231 | } | ||||
1232 | |||||
1233 | 2 | 0s | $meta{prereqs}{runtime}{requires} = $self->{PREREQ_PM} | ||
1234 | if $self->{ARGS}{PREREQ_PM}; | ||||
1235 | 2 | 0s | $meta{prereqs}{runtime}{requires}{perl} = _normalize_version($self->{MIN_PERL_VERSION}) | ||
1236 | if $self->{MIN_PERL_VERSION}; | ||||
1237 | |||||
1238 | 2 | 0s | return %meta; | ||
1239 | } | ||||
1240 | |||||
1241 | # Adapted from Module::Build::Base | ||||
1242 | # spent 0s within ExtUtils::MM_Any::_normalize_version which was called 5 times, avg 0s/call:
# 5 times (0s+0s) by ExtUtils::MM_Any::metafile_data at line 1112, avg 0s/call | ||||
1243 | 5 | 0s | my ($version) = @_; | ||
1244 | 5 | 0s | $version = 0 unless defined $version; | ||
1245 | |||||
1246 | 5 | 0s | 5 | 0s | if ( ref $version eq 'version' ) { # version objects # spent 0s making 5 calls to ExtUtils::MM_Any::CORE:match, avg 0s/call |
1247 | $version = $version->is_qv ? $version->normal : $version->stringify; | ||||
1248 | } | ||||
1249 | elsif ( $version =~ /^[^v][^.]*\.[^.]+\./ ) { # no leading v, multiple dots | ||||
1250 | # normalize string tuples without "v": "1.2.3" -> "v1.2.3" | ||||
1251 | $version = "v$version"; | ||||
1252 | } | ||||
1253 | else { | ||||
1254 | # leave alone | ||||
1255 | } | ||||
1256 | 5 | 0s | return $version; | ||
1257 | } | ||||
1258 | |||||
1259 | =head3 _dump_hash | ||||
1260 | |||||
1261 | $yaml = _dump_hash(\%options, %hash); | ||||
1262 | |||||
1263 | Implements a fake YAML dumper for a hash given | ||||
1264 | as a list of pairs. No quoting/escaping is done. Keys | ||||
1265 | are supposed to be strings. Values are undef, strings, | ||||
1266 | hash refs or array refs of strings. | ||||
1267 | |||||
1268 | Supported options are: | ||||
1269 | |||||
1270 | delta => STR - indentation delta | ||||
1271 | use_header => BOOL - whether to include a YAML header | ||||
1272 | indent => STR - a string of spaces | ||||
1273 | default: '' | ||||
1274 | |||||
1275 | max_key_length => INT - maximum key length used to align | ||||
1276 | keys and values of the same hash | ||||
1277 | default: 20 | ||||
1278 | key_sort => CODE - a sort sub | ||||
1279 | It may be undef, which means no sorting by keys | ||||
1280 | default: sub { lc $a cmp lc $b } | ||||
1281 | |||||
1282 | customs => HASH - special options for certain keys | ||||
1283 | (whose values are hashes themselves) | ||||
1284 | may contain: max_key_length, key_sort, customs | ||||
1285 | |||||
1286 | =end private | ||||
1287 | |||||
1288 | =cut | ||||
1289 | |||||
1290 | sub _dump_hash { | ||||
1291 | croak "first argument should be a hash ref" unless ref $_[0] eq 'HASH'; | ||||
1292 | my $options = shift; | ||||
1293 | my %hash = @_; | ||||
1294 | |||||
1295 | # Use a list to preserve order. | ||||
1296 | my @pairs; | ||||
1297 | |||||
1298 | my $k_sort | ||||
1299 | = exists $options->{key_sort} ? $options->{key_sort} | ||||
1300 | : sub { lc $a cmp lc $b }; | ||||
1301 | if ($k_sort) { | ||||
1302 | croak "'key_sort' should be a coderef" unless ref $k_sort eq 'CODE'; | ||||
1303 | @pairs = _sort_pairs($k_sort, \%hash); | ||||
1304 | } else { # list of pairs, no sorting | ||||
1305 | @pairs = @_; | ||||
1306 | } | ||||
1307 | |||||
1308 | my $yaml = $options->{use_header} ? "--- #YAML:1.0\n" : ''; | ||||
1309 | my $indent = $options->{indent} || ''; | ||||
1310 | my $k_length = min( | ||||
1311 | ($options->{max_key_length} || 20), | ||||
1312 | max(map { length($_) + 1 } grep { !ref $hash{$_} } keys %hash) | ||||
1313 | ); | ||||
1314 | my $customs = $options->{customs} || {}; | ||||
1315 | |||||
1316 | # printf format for key | ||||
1317 | my $k_format = "%-${k_length}s"; | ||||
1318 | |||||
1319 | while( @pairs ) { | ||||
1320 | my($key, $val) = splice @pairs, 0, 2; | ||||
1321 | $val = '~' unless defined $val; | ||||
1322 | if(ref $val eq 'HASH') { | ||||
1323 | if ( keys %$val ) { | ||||
1324 | my %k_options = ( # options for recursive call | ||||
1325 | delta => $options->{delta}, | ||||
1326 | use_header => 0, | ||||
1327 | indent => $indent . $options->{delta}, | ||||
1328 | ); | ||||
1329 | if (exists $customs->{$key}) { | ||||
1330 | my %k_custom = %{$customs->{$key}}; | ||||
1331 | foreach my $k (qw(key_sort max_key_length customs)) { | ||||
1332 | $k_options{$k} = $k_custom{$k} if exists $k_custom{$k}; | ||||
1333 | } | ||||
1334 | } | ||||
1335 | $yaml .= $indent . "$key:\n" | ||||
1336 | . _dump_hash(\%k_options, %$val); | ||||
1337 | } | ||||
1338 | else { | ||||
1339 | $yaml .= $indent . "$key: {}\n"; | ||||
1340 | } | ||||
1341 | } | ||||
1342 | elsif (ref $val eq 'ARRAY') { | ||||
1343 | if( @$val ) { | ||||
1344 | $yaml .= $indent . "$key:\n"; | ||||
1345 | |||||
1346 | for (@$val) { | ||||
1347 | croak "only nested arrays of non-refs are supported" if ref $_; | ||||
1348 | $yaml .= $indent . $options->{delta} . "- $_\n"; | ||||
1349 | } | ||||
1350 | } | ||||
1351 | else { | ||||
1352 | $yaml .= $indent . "$key: []\n"; | ||||
1353 | } | ||||
1354 | } | ||||
1355 | elsif( ref $val and !blessed($val) ) { | ||||
1356 | croak "only nested hashes, arrays and objects are supported"; | ||||
1357 | } | ||||
1358 | else { # if it's an object, just stringify it | ||||
1359 | $yaml .= $indent . sprintf "$k_format %s\n", "$key:", $val; | ||||
1360 | } | ||||
1361 | }; | ||||
1362 | |||||
1363 | return $yaml; | ||||
1364 | |||||
1365 | } | ||||
1366 | |||||
1367 | sub blessed { | ||||
1368 | return eval { $_[0]->isa("UNIVERSAL"); }; | ||||
1369 | } | ||||
1370 | |||||
1371 | sub max { | ||||
1372 | return (sort { $b <=> $a } @_)[0]; | ||||
1373 | } | ||||
1374 | |||||
1375 | sub min { | ||||
1376 | return (sort { $a <=> $b } @_)[0]; | ||||
1377 | } | ||||
1378 | |||||
1379 | =head3 metafile_file | ||||
1380 | |||||
1381 | my $meta_yml = $mm->metafile_file(@metadata_pairs); | ||||
1382 | |||||
1383 | Turns the @metadata_pairs into YAML. | ||||
1384 | |||||
1385 | This method does not implement a complete YAML dumper, being limited | ||||
1386 | to dump a hash with values which are strings, undef's or nested hashes | ||||
1387 | and arrays of strings. No quoting/escaping is done. | ||||
1388 | |||||
1389 | =cut | ||||
1390 | |||||
1391 | sub metafile_file { | ||||
1392 | my $self = shift; | ||||
1393 | |||||
1394 | my %dump_options = ( | ||||
1395 | use_header => 1, | ||||
1396 | delta => ' ' x 4, | ||||
1397 | key_sort => undef, | ||||
1398 | ); | ||||
1399 | return _dump_hash(\%dump_options, @_); | ||||
1400 | |||||
1401 | } | ||||
1402 | |||||
1403 | |||||
1404 | =head3 distmeta_target | ||||
1405 | |||||
1406 | my $make_frag = $mm->distmeta_target; | ||||
1407 | |||||
1408 | Generates the distmeta target to add META.yml and META.json to the MANIFEST | ||||
1409 | in the distdir. | ||||
1410 | |||||
1411 | =cut | ||||
1412 | |||||
1413 | # spent 2.22s (0+2.22) within ExtUtils::MM_Any::distmeta_target which was called 3 times, avg 738ms/call:
# 3 times (0s+2.22s) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 738ms/call | ||||
1414 | 3 | 0s | my $self = shift; | ||
1415 | |||||
1416 | 3 | 0s | 6 | 1.11s | my @add_meta = ( # spent 1.11s making 6 calls to ExtUtils::MM_Win32::oneliner, avg 185ms/call |
1417 | $self->oneliner(<<'CODE', ['-MExtUtils::Manifest=maniadd']), | ||||
1418 | exit unless -e q{META.yml}; | ||||
1419 | eval { maniadd({q{META.yml} => q{Module YAML meta-data (added by MakeMaker)}}) } | ||||
1420 | or print "Could not add META.yml to MANIFEST: $${'@'}\n" | ||||
1421 | CODE | ||||
1422 | $self->oneliner(<<'CODE', ['-MExtUtils::Manifest=maniadd']) | ||||
1423 | exit unless -f q{META.json}; | ||||
1424 | eval { maniadd({q{META.json} => q{Module JSON meta-data (added by MakeMaker)}}) } | ||||
1425 | or print "Could not add META.json to MANIFEST: $${'@'}\n" | ||||
1426 | CODE | ||||
1427 | ); | ||||
1428 | |||||
1429 | 9 | 0s | 6 | 1.11s | my @add_meta_to_distdir = map { $self->cd('$(DISTVNAME)', $_) } @add_meta; # spent 1.11s making 6 calls to ExtUtils::MM_Win32::cd, avg 185ms/call |
1430 | |||||
1431 | 3 | 0s | return sprintf <<'MAKE', @add_meta_to_distdir; | ||
1432 | distmeta : create_distdir metafile | ||||
1433 | $(NOECHO) %s | ||||
1434 | $(NOECHO) %s | ||||
1435 | |||||
1436 | MAKE | ||||
1437 | |||||
1438 | } | ||||
1439 | |||||
1440 | |||||
1441 | =head3 mymeta | ||||
1442 | |||||
1443 | my $mymeta = $mm->mymeta; | ||||
1444 | |||||
1445 | Generate MYMETA information as a hash either from an existing CPAN Meta file | ||||
1446 | (META.json or META.yml) or from internal data. | ||||
1447 | |||||
1448 | =cut | ||||
1449 | |||||
1450 | # spent 15.6ms (0s+15.6) within ExtUtils::MM_Any::mymeta which was called 3 times, avg 5.20ms/call:
# 3 times (0s+15.6ms) by ExtUtils::MakeMaker::flush at line 1192 of ExtUtils/MakeMaker.pm, avg 5.20ms/call | ||||
1451 | 3 | 0s | my $self = shift; | ||
1452 | 3 | 0s | my $file = shift || ''; # for testing | ||
1453 | |||||
1454 | 3 | 0s | 3 | 15.6ms | my $mymeta = $self->_mymeta_from_meta($file); # spent 15.6ms making 3 calls to ExtUtils::MM_Any::_mymeta_from_meta, avg 5.20ms/call |
1455 | 3 | 0s | my $v2 = 1; | ||
1456 | |||||
1457 | 3 | 0s | unless ( $mymeta ) { | ||
1458 | 2 | 0s | 2 | 0s | my @metadata = $self->metafile_data( # spent 0s making 2 calls to ExtUtils::MM_Any::metafile_data, avg 0s/call |
1459 | $self->{META_ADD} || {}, | ||||
1460 | $self->{META_MERGE} || {}, | ||||
1461 | ); | ||||
1462 | 2 | 0s | $mymeta = {@metadata}; | ||
1463 | 2 | 0s | $v2 = 0; | ||
1464 | } | ||||
1465 | |||||
1466 | # Overwrite the non-configure dependency hashes | ||||
1467 | |||||
1468 | 3 | 0s | my $method = $v2 | ||
1469 | ? '_add_requirements_to_meta_v2' | ||||
1470 | : '_add_requirements_to_meta_v1_4'; | ||||
1471 | |||||
1472 | 3 | 0s | 3 | 0s | $mymeta = { $self->$method( %$mymeta ) }; # spent 0s making 2 calls to ExtUtils::MM_Any::_add_requirements_to_meta_v1_4, avg 0s/call
# spent 0s making 1 call to ExtUtils::MM_Any::_add_requirements_to_meta_v2 |
1473 | |||||
1474 | 3 | 0s | $mymeta->{dynamic_config} = 0; | ||
1475 | |||||
1476 | 3 | 0s | return $mymeta; | ||
1477 | } | ||||
1478 | |||||
1479 | |||||
1480 | # spent 15.6ms (0s+15.6) within ExtUtils::MM_Any::_mymeta_from_meta which was called 3 times, avg 5.20ms/call:
# 3 times (0s+15.6ms) by ExtUtils::MM_Any::mymeta at line 1454, avg 5.20ms/call | ||||
1481 | 3 | 0s | my $self = shift; | ||
1482 | 3 | 0s | my $metafile = shift || ''; # for testing | ||
1483 | |||||
1484 | 3 | 0s | 3 | 0s | return unless _has_cpan_meta(); # spent 0s making 3 calls to ExtUtils::MM_Any::_has_cpan_meta, avg 0s/call |
1485 | |||||
1486 | 3 | 0s | my $meta; | ||
1487 | 3 | 0s | for my $file ( $metafile, "META.json", "META.yml" ) { | ||
1488 | 8 | 0s | 8 | 0s | next unless -e $file; # spent 0s making 8 calls to ExtUtils::MM_Any::CORE:ftis, avg 0s/call |
1489 | 1 | 0s | eval { | ||
1490 | 1 | 0s | 2 | 15.6ms | $meta = CPAN::Meta->load_file($file)->as_struct( { version => 2 } ); # spent 15.6ms making 1 call to CPAN::Meta::load_file
# spent 0s making 1 call to CPAN::Meta::as_struct |
1491 | }; | ||||
1492 | 1 | 0s | last if $meta; | ||
1493 | } | ||||
1494 | 3 | 0s | return unless $meta; | ||
1495 | |||||
1496 | # META.yml before 6.25_01 cannot be trusted. META.yml lived in the source directory. | ||||
1497 | # There was a good chance the author accidentally uploaded a stale META.yml if they | ||||
1498 | # rolled their own tarball rather than using "make dist". | ||||
1499 | 1 | 0s | 1 | 0s | if ($meta->{generated_by} && # spent 0s making 1 call to ExtUtils::MM_Any::CORE:match |
1500 | $meta->{generated_by} =~ /ExtUtils::MakeMaker version ([\d\._]+)/) { | ||||
1501 | 3 | 0s | my $eummv = do { local $^W = 0; $1+0; }; | ||
1502 | 1 | 0s | if ($eummv < 6.2501) { | ||
1503 | return; | ||||
1504 | } | ||||
1505 | } | ||||
1506 | |||||
1507 | 1 | 0s | return $meta; | ||
1508 | } | ||||
1509 | |||||
1510 | =head3 write_mymeta | ||||
1511 | |||||
1512 | $self->write_mymeta( $mymeta ); | ||||
1513 | |||||
1514 | Write MYMETA information to MYMETA.json and MYMETA.yml. | ||||
1515 | |||||
1516 | =cut | ||||
1517 | |||||
1518 | # spent 109ms (0s+109) within ExtUtils::MM_Any::write_mymeta which was called 3 times, avg 36.4ms/call:
# 3 times (0s+109ms) by ExtUtils::MakeMaker::flush at line 1192 of ExtUtils/MakeMaker.pm, avg 36.4ms/call | ||||
1519 | 3 | 0s | my $self = shift; | ||
1520 | 3 | 0s | my $mymeta = shift; | ||
1521 | |||||
1522 | 3 | 0s | 3 | 0s | return unless _has_cpan_meta(); # spent 0s making 3 calls to ExtUtils::MM_Any::_has_cpan_meta, avg 0s/call |
1523 | |||||
1524 | 3 | 0s | 3 | 0s | _fix_metadata_before_conversion( $mymeta ); # spent 0s making 3 calls to ExtUtils::MM_Any::_fix_metadata_before_conversion, avg 0s/call |
1525 | |||||
1526 | # this can still blow up | ||||
1527 | # not sure if i should just eval this and skip file creation if it | ||||
1528 | # blows up | ||||
1529 | 3 | 0s | 3 | 46.8ms | my $meta_obj = CPAN::Meta->new( $mymeta, { lazy_validation => 1 } ); # spent 46.8ms making 3 calls to CPAN::Meta::new, avg 15.6ms/call |
1530 | 3 | 0s | 3 | 15.6ms | $meta_obj->save( 'MYMETA.json' ); # spent 15.6ms making 3 calls to CPAN::Meta::save, avg 5.20ms/call |
1531 | 3 | 0s | 3 | 46.8ms | $meta_obj->save( 'MYMETA.yml', { version => "1.4" } ); # spent 46.8ms making 3 calls to CPAN::Meta::save, avg 15.6ms/call |
1532 | 3 | 0s | return 1; | ||
1533 | } | ||||
1534 | |||||
1535 | =head3 realclean (o) | ||||
1536 | |||||
1537 | Defines the realclean target. | ||||
1538 | |||||
1539 | =cut | ||||
1540 | |||||
1541 | # spent 0s within ExtUtils::MM_Any::realclean which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
1542 | 3 | 0s | my($self, %attribs) = @_; | ||
1543 | |||||
1544 | 3 | 0s | my @dirs = qw($(DISTVNAME)); | ||
1545 | 3 | 0s | my @files = qw($(FIRST_MAKEFILE) $(MAKEFILE_OLD)); | ||
1546 | |||||
1547 | # Special exception for the perl core where INST_* is not in blib. | ||||
1548 | # This cleans up the files built from the ext/ directory (all XS). | ||||
1549 | 3 | 0s | if( $self->{PERL_CORE} ) { | ||
1550 | push @dirs, qw($(INST_AUTODIR) $(INST_ARCHAUTODIR)); | ||||
1551 | push @files, values %{$self->{PM}}; | ||||
1552 | } | ||||
1553 | |||||
1554 | 3 | 0s | 3 | 0s | if( $self->has_link_code ){ # spent 0s making 3 calls to ExtUtils::MM_Unix::has_link_code, avg 0s/call |
1555 | push @files, qw($(OBJECT)); | ||||
1556 | } | ||||
1557 | |||||
1558 | 3 | 0s | if( $attribs{FILES} ) { | ||
1559 | if( ref $attribs{FILES} ) { | ||||
1560 | push @dirs, @{ $attribs{FILES} }; | ||||
1561 | } | ||||
1562 | else { | ||||
1563 | push @dirs, split /\s+/, $attribs{FILES}; | ||||
1564 | } | ||||
1565 | } | ||||
1566 | |||||
1567 | # Occasionally files are repeated several times from different sources | ||||
1568 | 9 | 0s | { my(%f) = map { ($_ => 1) } @files; @files = keys %f; } | ||
1569 | 9 | 0s | { my(%d) = map { ($_ => 1) } @dirs; @dirs = keys %d; } | ||
1570 | |||||
1571 | 3 | 0s | 3 | 0s | my $rm_cmd = join "\n\t", map { "$_" } # spent 0s making 3 calls to ExtUtils::MM_Any::split_command, avg 0s/call |
1572 | $self->split_command('- $(RM_F)', @files); | ||||
1573 | 3 | 0s | 3 | 0s | my $rmf_cmd = join "\n\t", map { "$_" } # spent 0s making 3 calls to ExtUtils::MM_Any::split_command, avg 0s/call |
1574 | $self->split_command('- $(RM_RF)', @dirs); | ||||
1575 | |||||
1576 | 3 | 0s | my $m = sprintf <<'MAKE', $rm_cmd, $rmf_cmd; | ||
1577 | # Delete temporary files (via clean) and also delete dist files | ||||
1578 | realclean purge :: clean realclean_subdirs | ||||
1579 | %s | ||||
1580 | %s | ||||
1581 | MAKE | ||||
1582 | |||||
1583 | 3 | 0s | $m .= "\t$attribs{POSTOP}\n" if $attribs{POSTOP}; | ||
1584 | |||||
1585 | 3 | 0s | return $m; | ||
1586 | } | ||||
1587 | |||||
1588 | |||||
1589 | =head3 realclean_subdirs_target | ||||
1590 | |||||
1591 | my $make_frag = $MM->realclean_subdirs_target; | ||||
1592 | |||||
1593 | Returns the realclean_subdirs target. This is used by the realclean | ||||
1594 | target to call realclean on any subdirectories which contain Makefiles. | ||||
1595 | |||||
1596 | =cut | ||||
1597 | |||||
1598 | # spent 749ms (0s+749) within ExtUtils::MM_Any::realclean_subdirs_target which was called 3 times, avg 250ms/call:
# 3 times (0s+749ms) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 250ms/call | ||||
1599 | 3 | 0s | my $self = shift; | ||
1600 | |||||
1601 | 3 | 0s | return <<'NOOP_FRAG' unless @{$self->{DIR}}; | ||
1602 | realclean_subdirs : | ||||
1603 | $(NOECHO) $(NOOP) | ||||
1604 | NOOP_FRAG | ||||
1605 | |||||
1606 | 1 | 0s | my $rclean = "realclean_subdirs :\n"; | ||
1607 | |||||
1608 | 1 | 0s | foreach my $dir (@{$self->{DIR}}) { | ||
1609 | 2 | 0s | foreach my $makefile ('$(MAKEFILE_OLD)', '$(FIRST_MAKEFILE)' ) { | ||
1610 | 4 | 0s | 4 | 749ms | my $subrclean .= $self->oneliner(sprintf <<'CODE', $dir, ($makefile) x 2); # spent 749ms making 4 calls to ExtUtils::MM_Win32::oneliner, avg 187ms/call |
1611 | chdir '%s'; system '$(MAKE) $(USEMAKEFILE) %s realclean' if -f '%s'; | ||||
1612 | CODE | ||||
1613 | |||||
1614 | 4 | 0s | $rclean .= sprintf <<'RCLEAN', $subrclean; | ||
1615 | - %s | ||||
1616 | RCLEAN | ||||
1617 | |||||
1618 | } | ||||
1619 | } | ||||
1620 | |||||
1621 | 1 | 0s | return $rclean; | ||
1622 | } | ||||
1623 | |||||
1624 | |||||
1625 | =head3 signature_target | ||||
1626 | |||||
1627 | my $target = $mm->signature_target; | ||||
1628 | |||||
1629 | Generate the signature target. | ||||
1630 | |||||
1631 | Writes the file SIGNATURE with "cpansign -s". | ||||
1632 | |||||
1633 | =cut | ||||
1634 | |||||
1635 | # spent 0s within ExtUtils::MM_Any::signature_target which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
1636 | 3 | 0s | my $self = shift; | ||
1637 | |||||
1638 | 3 | 0s | return <<'MAKE_FRAG'; | ||
1639 | signature : | ||||
1640 | cpansign -s | ||||
1641 | MAKE_FRAG | ||||
1642 | |||||
1643 | } | ||||
1644 | |||||
1645 | |||||
1646 | =head3 distsignature_target | ||||
1647 | |||||
1648 | my $make_frag = $mm->distsignature_target; | ||||
1649 | |||||
1650 | Generates the distsignature target to add SIGNATURE to the MANIFEST in the | ||||
1651 | distdir. | ||||
1652 | |||||
1653 | =cut | ||||
1654 | |||||
1655 | # spent 2.22s (0+2.22) within ExtUtils::MM_Any::distsignature_target which was called 3 times, avg 738ms/call:
# 3 times (0s+2.22s) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 738ms/call | ||||
1656 | 3 | 0s | my $self = shift; | ||
1657 | |||||
1658 | 3 | 0s | 3 | 546ms | my $add_sign = $self->oneliner(<<'CODE', ['-MExtUtils::Manifest=maniadd']); # spent 546ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 182ms/call |
1659 | eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) } | ||||
1660 | or print "Could not add SIGNATURE to MANIFEST: $${'@'}\n" | ||||
1661 | CODE | ||||
1662 | |||||
1663 | 3 | 0s | 3 | 562ms | my $sign_dist = $self->cd('$(DISTVNAME)' => 'cpansign -s'); # spent 562ms making 3 calls to ExtUtils::MM_Win32::cd, avg 187ms/call |
1664 | |||||
1665 | # cpansign -s complains if SIGNATURE is in the MANIFEST yet does not | ||||
1666 | # exist | ||||
1667 | 3 | 0s | 3 | 562ms | my $touch_sig = $self->cd('$(DISTVNAME)' => '$(TOUCH) SIGNATURE'); # spent 562ms making 3 calls to ExtUtils::MM_Win32::cd, avg 187ms/call |
1668 | 3 | 0s | 3 | 546ms | my $add_sign_to_dist = $self->cd('$(DISTVNAME)' => $add_sign ); # spent 546ms making 3 calls to ExtUtils::MM_Win32::cd, avg 182ms/call |
1669 | |||||
1670 | 3 | 0s | return sprintf <<'MAKE', $add_sign_to_dist, $touch_sig, $sign_dist | ||
1671 | distsignature : create_distdir | ||||
1672 | $(NOECHO) %s | ||||
1673 | $(NOECHO) %s | ||||
1674 | %s | ||||
1675 | |||||
1676 | MAKE | ||||
1677 | |||||
1678 | } | ||||
1679 | |||||
1680 | |||||
1681 | =head3 special_targets | ||||
1682 | |||||
1683 | my $make_frag = $mm->special_targets | ||||
1684 | |||||
1685 | Returns a make fragment containing any targets which have special | ||||
1686 | meaning to make. For example, .SUFFIXES and .PHONY. | ||||
1687 | |||||
1688 | =cut | ||||
1689 | |||||
1690 | # spent 0s within ExtUtils::MM_Any::special_targets which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Win32::special_targets at line 275 of ExtUtils/MM_Win32.pm, avg 0s/call | ||||
1691 | 3 | 0s | my $make_frag = <<'MAKE_FRAG'; | ||
1692 | .SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) | ||||
1693 | |||||
1694 | .PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir | ||||
1695 | |||||
1696 | MAKE_FRAG | ||||
1697 | |||||
1698 | 3 | 0s | $make_frag .= <<'MAKE_FRAG' if $ENV{CLEARCASE_ROOT}; | ||
1699 | .NO_CONFIG_REC: Makefile | ||||
1700 | |||||
1701 | MAKE_FRAG | ||||
1702 | |||||
1703 | 3 | 0s | return $make_frag; | ||
1704 | } | ||||
1705 | |||||
- - | |||||
1709 | =head2 Init methods | ||||
1710 | |||||
1711 | Methods which help initialize the MakeMaker object and macros. | ||||
1712 | |||||
1713 | |||||
1714 | =head3 init_ABSTRACT | ||||
1715 | |||||
1716 | $mm->init_ABSTRACT | ||||
1717 | |||||
1718 | =cut | ||||
1719 | |||||
1720 | # spent 0s within ExtUtils::MM_Any::init_ABSTRACT which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 663 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
1721 | 3 | 0s | my $self = shift; | ||
1722 | |||||
1723 | 3 | 0s | if( $self->{ABSTRACT_FROM} and $self->{ABSTRACT} ) { | ||
1724 | warn "Both ABSTRACT_FROM and ABSTRACT are set. ". | ||||
1725 | "Ignoring ABSTRACT_FROM.\n"; | ||||
1726 | return; | ||||
1727 | } | ||||
1728 | |||||
1729 | 3 | 0s | if ($self->{ABSTRACT_FROM}){ | ||
1730 | $self->{ABSTRACT} = $self->parse_abstract($self->{ABSTRACT_FROM}) or | ||||
1731 | carp "WARNING: Setting ABSTRACT via file ". | ||||
1732 | "'$self->{ABSTRACT_FROM}' failed\n"; | ||||
1733 | } | ||||
1734 | |||||
1735 | 3 | 0s | 1 | 0s | if ($self->{ABSTRACT} && $self->{ABSTRACT} =~ m![[:cntrl:]]+!) { # spent 0s making 1 call to ExtUtils::MM_Any::CORE:match |
1736 | warn "WARNING: ABSTRACT contains control character(s),". | ||||
1737 | " they will be removed\n"; | ||||
1738 | $self->{ABSTRACT} =~ s![[:cntrl:]]+!!g; | ||||
1739 | return; | ||||
1740 | } | ||||
1741 | } | ||||
1742 | |||||
1743 | =head3 init_INST | ||||
1744 | |||||
1745 | $mm->init_INST; | ||||
1746 | |||||
1747 | Called by init_main. Sets up all INST_* variables except those related | ||||
1748 | to XS code. Those are handled in init_xs. | ||||
1749 | |||||
1750 | =cut | ||||
1751 | |||||
1752 | # spent 0s within ExtUtils::MM_Any::init_INST which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 653 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
1753 | 3 | 0s | my($self) = shift; | ||
1754 | |||||
1755 | 3 | 0s | 1 | 0s | $self->{INST_ARCHLIB} ||= $self->catdir($Curdir,"blib","arch"); # spent 0s making 1 call to File::Spec::Win32::catdir |
1756 | 3 | 0s | 1 | 0s | $self->{INST_BIN} ||= $self->catdir($Curdir,'blib','bin'); # spent 0s making 1 call to File::Spec::Win32::catdir |
1757 | |||||
1758 | # INST_LIB typically pre-set if building an extension after | ||||
1759 | # perl has been built and installed. Setting INST_LIB allows | ||||
1760 | # you to build directly into, say $Config{privlibexp}. | ||||
1761 | 3 | 0s | unless ($self->{INST_LIB}){ | ||
1762 | if ($self->{PERL_CORE}) { | ||||
1763 | $self->{INST_LIB} = $self->{INST_ARCHLIB} = $self->{PERL_LIB}; | ||||
1764 | } else { | ||||
1765 | 1 | 0s | 1 | 0s | $self->{INST_LIB} = $self->catdir($Curdir,"blib","lib"); # spent 0s making 1 call to File::Spec::Win32::catdir |
1766 | } | ||||
1767 | } | ||||
1768 | |||||
1769 | 3 | 0s | my @parentdir = split(/::/, $self->{PARENT_NAME}); | ||
1770 | 3 | 0s | 3 | 0s | $self->{INST_LIBDIR} = $self->catdir('$(INST_LIB)', @parentdir); # spent 0s making 3 calls to File::Spec::Win32::catdir, avg 0s/call |
1771 | 3 | 0s | 3 | 0s | $self->{INST_ARCHLIBDIR} = $self->catdir('$(INST_ARCHLIB)', @parentdir); # spent 0s making 3 calls to File::Spec::Win32::catdir, avg 0s/call |
1772 | 3 | 0s | 3 | 0s | $self->{INST_AUTODIR} = $self->catdir('$(INST_LIB)', 'auto', # spent 0s making 3 calls to File::Spec::Win32::catdir, avg 0s/call |
1773 | '$(FULLEXT)'); | ||||
1774 | 3 | 0s | 3 | 0s | $self->{INST_ARCHAUTODIR} = $self->catdir('$(INST_ARCHLIB)', 'auto', # spent 0s making 3 calls to File::Spec::Win32::catdir, avg 0s/call |
1775 | '$(FULLEXT)'); | ||||
1776 | |||||
1777 | 3 | 0s | 1 | 0s | $self->{INST_SCRIPT} ||= $self->catdir($Curdir,'blib','script'); # spent 0s making 1 call to File::Spec::Win32::catdir |
1778 | |||||
1779 | 3 | 0s | 1 | 0s | $self->{INST_MAN1DIR} ||= $self->catdir($Curdir,'blib','man1'); # spent 0s making 1 call to File::Spec::Win32::catdir |
1780 | 3 | 0s | 1 | 0s | $self->{INST_MAN3DIR} ||= $self->catdir($Curdir,'blib','man3'); # spent 0s making 1 call to File::Spec::Win32::catdir |
1781 | |||||
1782 | 3 | 0s | return 1; | ||
1783 | } | ||||
1784 | |||||
1785 | |||||
1786 | =head3 init_INSTALL | ||||
1787 | |||||
1788 | $mm->init_INSTALL; | ||||
1789 | |||||
1790 | Called by init_main. Sets up all INSTALL_* variables (except | ||||
1791 | INSTALLDIRS) and *PREFIX. | ||||
1792 | |||||
1793 | =cut | ||||
1794 | |||||
1795 | # spent 0s within ExtUtils::MM_Any::init_INSTALL which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 654 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
1796 | 3 | 0s | my($self) = shift; | ||
1797 | |||||
1798 | 3 | 0s | if( $self->{ARGS}{INSTALL_BASE} and $self->{ARGS}{PREFIX} ) { | ||
1799 | die "Only one of PREFIX or INSTALL_BASE can be given. Not both.\n"; | ||||
1800 | } | ||||
1801 | |||||
1802 | 3 | 0s | if( $self->{ARGS}{INSTALL_BASE} ) { | ||
1803 | $self->init_INSTALL_from_INSTALL_BASE; | ||||
1804 | } | ||||
1805 | else { | ||||
1806 | 3 | 0s | 3 | 0s | $self->init_INSTALL_from_PREFIX; # spent 0s making 3 calls to ExtUtils::MM_Any::init_INSTALL_from_PREFIX, avg 0s/call |
1807 | } | ||||
1808 | } | ||||
1809 | |||||
1810 | |||||
1811 | =head3 init_INSTALL_from_PREFIX | ||||
1812 | |||||
1813 | $mm->init_INSTALL_from_PREFIX; | ||||
1814 | |||||
1815 | =cut | ||||
1816 | |||||
1817 | # spent 0s within ExtUtils::MM_Any::init_INSTALL_from_PREFIX which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Any::init_INSTALL at line 1806, avg 0s/call | ||||
1818 | 3 | 0s | my $self = shift; | ||
1819 | |||||
1820 | 3 | 0s | 3 | 0s | $self->init_lib2arch; # spent 0s making 3 calls to ExtUtils::MM_Unix::init_lib2arch, avg 0s/call |
1821 | |||||
1822 | # There are often no Config.pm defaults for these new man variables so | ||||
1823 | # we fall back to the old behavior which is to use installman*dir | ||||
1824 | 3 | 0s | foreach my $num (1, 3) { | ||
1825 | 6 | 0s | my $k = 'installsiteman'.$num.'dir'; | ||
1826 | |||||
1827 | 6 | 0s | $self->{uc $k} ||= uc "\$(installman${num}dir)" | ||
1828 | unless $Config{$k}; | ||||
1829 | } | ||||
1830 | |||||
1831 | 3 | 0s | foreach my $num (1, 3) { | ||
1832 | 6 | 0s | my $k = 'installvendorman'.$num.'dir'; | ||
1833 | |||||
1834 | 6 | 0s | unless( $Config{$k} ) { | ||
1835 | $self->{uc $k} ||= $Config{usevendorprefix} | ||||
1836 | ? uc "\$(installman${num}dir)" | ||||
1837 | : ''; | ||||
1838 | } | ||||
1839 | } | ||||
1840 | |||||
1841 | 3 | 0s | $self->{INSTALLSITEBIN} ||= '$(INSTALLBIN)' | ||
1842 | unless $Config{installsitebin}; | ||||
1843 | 3 | 0s | $self->{INSTALLSITESCRIPT} ||= '$(INSTALLSCRIPT)' | ||
1844 | unless $Config{installsitescript}; | ||||
1845 | |||||
1846 | 3 | 0s | unless( $Config{installvendorbin} ) { | ||
1847 | $self->{INSTALLVENDORBIN} ||= $Config{usevendorprefix} | ||||
1848 | ? $Config{installbin} | ||||
1849 | : ''; | ||||
1850 | } | ||||
1851 | 3 | 0s | unless( $Config{installvendorscript} ) { | ||
1852 | $self->{INSTALLVENDORSCRIPT} ||= $Config{usevendorprefix} | ||||
1853 | ? $Config{installscript} | ||||
1854 | : ''; | ||||
1855 | } | ||||
1856 | |||||
1857 | |||||
1858 | 3 | 0s | my $iprefix = $Config{installprefixexp} || $Config{installprefix} || | ||
1859 | $Config{prefixexp} || $Config{prefix} || ''; | ||||
1860 | 3 | 0s | my $vprefix = $Config{usevendorprefix} ? $Config{vendorprefixexp} : ''; | ||
1861 | 3 | 0s | my $sprefix = $Config{siteprefixexp} || ''; | ||
1862 | |||||
1863 | # 5.005_03 doesn't have a siteprefix. | ||||
1864 | 3 | 0s | $sprefix = $iprefix unless $sprefix; | ||
1865 | |||||
1866 | |||||
1867 | 3 | 0s | $self->{PREFIX} ||= ''; | ||
1868 | |||||
1869 | 3 | 0s | if( $self->{PREFIX} ) { | ||
1870 | @{$self}{qw(PERLPREFIX SITEPREFIX VENDORPREFIX)} = | ||||
1871 | ('$(PREFIX)') x 3; | ||||
1872 | } | ||||
1873 | else { | ||||
1874 | 3 | 0s | $self->{PERLPREFIX} ||= $iprefix; | ||
1875 | 3 | 0s | $self->{SITEPREFIX} ||= $sprefix; | ||
1876 | 3 | 0s | $self->{VENDORPREFIX} ||= $vprefix; | ||
1877 | |||||
1878 | # Lots of MM extension authors like to use $(PREFIX) so we | ||||
1879 | # put something sensible in there no matter what. | ||||
1880 | 3 | 0s | $self->{PREFIX} = '$('.uc $self->{INSTALLDIRS}.'PREFIX)'; | ||
1881 | } | ||||
1882 | |||||
1883 | 3 | 0s | my $arch = $Config{archname}; | ||
1884 | 3 | 0s | my $version = $Config{version}; | ||
1885 | |||||
1886 | # default style | ||||
1887 | 3 | 0s | my $libstyle = $Config{installstyle} || 'lib/perl5'; | ||
1888 | 3 | 0s | my $manstyle = ''; | ||
1889 | |||||
1890 | 3 | 0s | if( $self->{LIBSTYLE} ) { | ||
1891 | $libstyle = $self->{LIBSTYLE}; | ||||
1892 | $manstyle = $self->{LIBSTYLE} eq 'lib/perl5' ? 'lib/perl5' : ''; | ||||
1893 | } | ||||
1894 | |||||
1895 | # Some systems, like VOS, set installman*dir to '' if they can't | ||||
1896 | # read man pages. | ||||
1897 | 3 | 0s | for my $num (1, 3) { | ||
1898 | 6 | 0s | $self->{'INSTALLMAN'.$num.'DIR'} ||= 'none' | ||
1899 | unless $Config{'installman'.$num.'dir'}; | ||||
1900 | } | ||||
1901 | |||||
1902 | 3 | 0s | my %bin_layouts = | ||
1903 | ( | ||||
1904 | bin => { s => $iprefix, | ||||
1905 | t => 'perl', | ||||
1906 | d => 'bin' }, | ||||
1907 | vendorbin => { s => $vprefix, | ||||
1908 | t => 'vendor', | ||||
1909 | d => 'bin' }, | ||||
1910 | sitebin => { s => $sprefix, | ||||
1911 | t => 'site', | ||||
1912 | d => 'bin' }, | ||||
1913 | script => { s => $iprefix, | ||||
1914 | t => 'perl', | ||||
1915 | d => 'bin' }, | ||||
1916 | vendorscript=> { s => $vprefix, | ||||
1917 | t => 'vendor', | ||||
1918 | d => 'bin' }, | ||||
1919 | sitescript => { s => $sprefix, | ||||
1920 | t => 'site', | ||||
1921 | d => 'bin' }, | ||||
1922 | ); | ||||
1923 | |||||
1924 | 3 | 0s | my %man_layouts = | ||
1925 | ( | ||||
1926 | man1dir => { s => $iprefix, | ||||
1927 | t => 'perl', | ||||
1928 | d => 'man/man1', | ||||
1929 | style => $manstyle, }, | ||||
1930 | siteman1dir => { s => $sprefix, | ||||
1931 | t => 'site', | ||||
1932 | d => 'man/man1', | ||||
1933 | style => $manstyle, }, | ||||
1934 | vendorman1dir => { s => $vprefix, | ||||
1935 | t => 'vendor', | ||||
1936 | d => 'man/man1', | ||||
1937 | style => $manstyle, }, | ||||
1938 | |||||
1939 | man3dir => { s => $iprefix, | ||||
1940 | t => 'perl', | ||||
1941 | d => 'man/man3', | ||||
1942 | style => $manstyle, }, | ||||
1943 | siteman3dir => { s => $sprefix, | ||||
1944 | t => 'site', | ||||
1945 | d => 'man/man3', | ||||
1946 | style => $manstyle, }, | ||||
1947 | vendorman3dir => { s => $vprefix, | ||||
1948 | t => 'vendor', | ||||
1949 | d => 'man/man3', | ||||
1950 | style => $manstyle, }, | ||||
1951 | ); | ||||
1952 | |||||
1953 | 3 | 0s | my %lib_layouts = | ||
1954 | ( | ||||
1955 | privlib => { s => $iprefix, | ||||
1956 | t => 'perl', | ||||
1957 | d => '', | ||||
1958 | style => $libstyle, }, | ||||
1959 | vendorlib => { s => $vprefix, | ||||
1960 | t => 'vendor', | ||||
1961 | d => '', | ||||
1962 | style => $libstyle, }, | ||||
1963 | sitelib => { s => $sprefix, | ||||
1964 | t => 'site', | ||||
1965 | d => 'site_perl', | ||||
1966 | style => $libstyle, }, | ||||
1967 | |||||
1968 | archlib => { s => $iprefix, | ||||
1969 | t => 'perl', | ||||
1970 | d => "$version/$arch", | ||||
1971 | style => $libstyle }, | ||||
1972 | vendorarch => { s => $vprefix, | ||||
1973 | t => 'vendor', | ||||
1974 | d => "$version/$arch", | ||||
1975 | style => $libstyle }, | ||||
1976 | sitearch => { s => $sprefix, | ||||
1977 | t => 'site', | ||||
1978 | d => "site_perl/$version/$arch", | ||||
1979 | style => $libstyle }, | ||||
1980 | ); | ||||
1981 | |||||
1982 | |||||
1983 | # Special case for LIB. | ||||
1984 | 3 | 0s | if( $self->{LIB} ) { | ||
1985 | foreach my $var (keys %lib_layouts) { | ||||
1986 | my $Installvar = uc "install$var"; | ||||
1987 | |||||
1988 | if( $var =~ /arch/ ) { | ||||
1989 | $self->{$Installvar} ||= | ||||
1990 | $self->catdir($self->{LIB}, $Config{archname}); | ||||
1991 | } | ||||
1992 | else { | ||||
1993 | $self->{$Installvar} ||= $self->{LIB}; | ||||
1994 | } | ||||
1995 | } | ||||
1996 | } | ||||
1997 | |||||
1998 | 3 | 0s | my %type2prefix = ( perl => 'PERLPREFIX', | ||
1999 | site => 'SITEPREFIX', | ||||
2000 | vendor => 'VENDORPREFIX' | ||||
2001 | ); | ||||
2002 | |||||
2003 | 3 | 0s | my %layouts = (%bin_layouts, %man_layouts, %lib_layouts); | ||
2004 | 3 | 0s | while( my($var, $layout) = each(%layouts) ) { | ||
2005 | 54 | 0s | my($s, $t, $d, $style) = @{$layout}{qw(s t d style)}; | ||
2006 | 54 | 0s | my $r = '$('.$type2prefix{$t}.')'; | ||
2007 | |||||
2008 | 54 | 0s | warn "Prefixing $var\n" if $Verbose >= 2; | ||
2009 | |||||
2010 | 54 | 0s | my $installvar = "install$var"; | ||
2011 | 54 | 0s | my $Installvar = uc $installvar; | ||
2012 | 54 | 0s | next if $self->{$Installvar}; | ||
2013 | |||||
2014 | 36 | 0s | $d = "$style/$d" if $style; | ||
2015 | 36 | 0s | 36 | 0s | $self->prefixify($installvar, $s, $r, $d); # spent 0s making 36 calls to ExtUtils::MM_Unix::prefixify, avg 0s/call |
2016 | |||||
2017 | 36 | 0s | warn " $Installvar == $self->{$Installvar}\n" | ||
2018 | if $Verbose >= 2; | ||||
2019 | } | ||||
2020 | |||||
2021 | # Generate these if they weren't figured out. | ||||
2022 | 3 | 0s | $self->{VENDORARCHEXP} ||= $self->{INSTALLVENDORARCH}; | ||
2023 | 3 | 0s | $self->{VENDORLIBEXP} ||= $self->{INSTALLVENDORLIB}; | ||
2024 | |||||
2025 | 3 | 0s | return 1; | ||
2026 | } | ||||
2027 | |||||
2028 | |||||
2029 | =head3 init_from_INSTALL_BASE | ||||
2030 | |||||
2031 | $mm->init_from_INSTALL_BASE | ||||
2032 | |||||
2033 | =cut | ||||
2034 | |||||
2035 | 1 | 0s | my %map = ( | ||
2036 | lib => [qw(lib perl5)], | ||||
2037 | arch => [('lib', 'perl5', $Config{archname})], | ||||
2038 | bin => [qw(bin)], | ||||
2039 | man1dir => [qw(man man1)], | ||||
2040 | man3dir => [qw(man man3)] | ||||
2041 | ); | ||||
2042 | 1 | 0s | $map{script} = $map{bin}; | ||
2043 | |||||
2044 | sub init_INSTALL_from_INSTALL_BASE { | ||||
2045 | my $self = shift; | ||||
2046 | |||||
2047 | @{$self}{qw(PREFIX VENDORPREFIX SITEPREFIX PERLPREFIX)} = | ||||
2048 | '$(INSTALL_BASE)'; | ||||
2049 | |||||
2050 | my %install; | ||||
2051 | foreach my $thing (keys %map) { | ||||
2052 | foreach my $dir (('', 'SITE', 'VENDOR')) { | ||||
2053 | my $uc_thing = uc $thing; | ||||
2054 | my $key = "INSTALL".$dir.$uc_thing; | ||||
2055 | |||||
2056 | $install{$key} ||= | ||||
2057 | $self->catdir('$(INSTALL_BASE)', @{$map{$thing}}); | ||||
2058 | } | ||||
2059 | } | ||||
2060 | |||||
2061 | # Adjust for variable quirks. | ||||
2062 | $install{INSTALLARCHLIB} ||= delete $install{INSTALLARCH}; | ||||
2063 | $install{INSTALLPRIVLIB} ||= delete $install{INSTALLLIB}; | ||||
2064 | |||||
2065 | foreach my $key (keys %install) { | ||||
2066 | $self->{$key} ||= $install{$key}; | ||||
2067 | } | ||||
2068 | |||||
2069 | return 1; | ||||
2070 | } | ||||
2071 | |||||
2072 | |||||
2073 | =head3 init_VERSION I<Abstract> | ||||
2074 | |||||
2075 | $mm->init_VERSION | ||||
2076 | |||||
2077 | Initialize macros representing versions of MakeMaker and other tools | ||||
2078 | |||||
2079 | MAKEMAKER: path to the MakeMaker module. | ||||
2080 | |||||
2081 | MM_VERSION: ExtUtils::MakeMaker Version | ||||
2082 | |||||
2083 | MM_REVISION: ExtUtils::MakeMaker version control revision (for backwards | ||||
2084 | compat) | ||||
2085 | |||||
2086 | VERSION: version of your module | ||||
2087 | |||||
2088 | VERSION_MACRO: which macro represents the version (usually 'VERSION') | ||||
2089 | |||||
2090 | VERSION_SYM: like version but safe for use as an RCS revision number | ||||
2091 | |||||
2092 | DEFINE_VERSION: -D line to set the module version when compiling | ||||
2093 | |||||
2094 | XS_VERSION: version in your .xs file. Defaults to $(VERSION) | ||||
2095 | |||||
2096 | XS_VERSION_MACRO: which macro represents the XS version. | ||||
2097 | |||||
2098 | XS_DEFINE_VERSION: -D line to set the xs version when compiling. | ||||
2099 | |||||
2100 | Called by init_main. | ||||
2101 | |||||
2102 | =cut | ||||
2103 | |||||
2104 | # spent 15.6ms (0s+15.6) within ExtUtils::MM_Any::init_VERSION which was called 3 times, avg 5.20ms/call:
# 3 times (0s+15.6ms) by ExtUtils::MakeMaker::new at line 651 of ExtUtils/MakeMaker.pm, avg 5.20ms/call | ||||
2105 | 3 | 0s | my($self) = shift; | ||
2106 | |||||
2107 | 3 | 0s | $self->{MAKEMAKER} = $ExtUtils::MakeMaker::Filename; | ||
2108 | 3 | 0s | $self->{MM_VERSION} = $ExtUtils::MakeMaker::VERSION; | ||
2109 | 3 | 0s | $self->{MM_REVISION}= $ExtUtils::MakeMaker::Revision; | ||
2110 | 3 | 0s | $self->{VERSION_FROM} ||= ''; | ||
2111 | |||||
2112 | 3 | 0s | if ($self->{VERSION_FROM}){ | ||
2113 | 3 | 0s | 3 | 15.6ms | $self->{VERSION} = $self->parse_version($self->{VERSION_FROM}); # spent 15.6ms making 3 calls to ExtUtils::MM_Unix::parse_version, avg 5.20ms/call |
2114 | 3 | 0s | if( $self->{VERSION} eq 'undef' ) { | ||
2115 | carp("WARNING: Setting VERSION via file ". | ||||
2116 | "'$self->{VERSION_FROM}' failed\n"); | ||||
2117 | } | ||||
2118 | } | ||||
2119 | |||||
2120 | 3 | 0s | if (defined $self->{VERSION}) { | ||
2121 | 3 | 0s | 3 | 0s | if ( $self->{VERSION} !~ /^\s*v?[\d_\.]+\s*$/ ) { # spent 0s making 3 calls to ExtUtils::MM_Any::CORE:match, avg 0s/call |
2122 | require version; | ||||
2123 | my $normal = eval { version->new( $self->{VERSION} ) }; | ||||
2124 | $self->{VERSION} = $normal if defined $normal; | ||||
2125 | } | ||||
2126 | 3 | 0s | 3 | 0s | $self->{VERSION} =~ s/^\s+//; # spent 0s making 3 calls to ExtUtils::MM_Any::CORE:subst, avg 0s/call |
2127 | 3 | 0s | 3 | 0s | $self->{VERSION} =~ s/\s+$//; # spent 0s making 3 calls to ExtUtils::MM_Any::CORE:subst, avg 0s/call |
2128 | } | ||||
2129 | else { | ||||
2130 | $self->{VERSION} = ''; | ||||
2131 | } | ||||
2132 | |||||
2133 | |||||
2134 | 3 | 0s | $self->{VERSION_MACRO} = 'VERSION'; | ||
2135 | 3 | 0s | 3 | 0s | ($self->{VERSION_SYM} = $self->{VERSION}) =~ s/\W/_/g; # spent 0s making 3 calls to ExtUtils::MM_Any::CORE:subst, avg 0s/call |
2136 | 3 | 0s | $self->{DEFINE_VERSION} = '-D$(VERSION_MACRO)=\"$(VERSION)\"'; | ||
2137 | |||||
2138 | |||||
2139 | # Graham Barr and Paul Marquess had some ideas how to ensure | ||||
2140 | # version compatibility between the *.pm file and the | ||||
2141 | # corresponding *.xs file. The bottom line was, that we need an | ||||
2142 | # XS_VERSION macro that defaults to VERSION: | ||||
2143 | 3 | 0s | $self->{XS_VERSION} ||= $self->{VERSION}; | ||
2144 | |||||
2145 | 3 | 0s | $self->{XS_VERSION_MACRO} = 'XS_VERSION'; | ||
2146 | 3 | 0s | $self->{XS_DEFINE_VERSION} = '-D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"'; | ||
2147 | |||||
2148 | } | ||||
2149 | |||||
2150 | |||||
2151 | =head3 init_tools | ||||
2152 | |||||
2153 | $MM->init_tools(); | ||||
2154 | |||||
2155 | Initializes the simple macro definitions used by tools_other() and | ||||
2156 | places them in the $MM object. These use conservative cross platform | ||||
2157 | versions and should be overridden with platform specific versions for | ||||
2158 | performance. | ||||
2159 | |||||
2160 | Defines at least these macros. | ||||
2161 | |||||
2162 | Macro Description | ||||
2163 | |||||
2164 | NOOP Do nothing | ||||
2165 | NOECHO Tell make not to display the command itself | ||||
2166 | |||||
2167 | SHELL Program used to run shell commands | ||||
2168 | |||||
2169 | ECHO Print text adding a newline on the end | ||||
2170 | RM_F Remove a file | ||||
2171 | RM_RF Remove a directory | ||||
2172 | TOUCH Update a file's timestamp | ||||
2173 | TEST_F Test for a file's existence | ||||
2174 | TEST_S Test the size of a file | ||||
2175 | CP Copy a file | ||||
2176 | CP_NONEMPTY Copy a file if it is not empty | ||||
2177 | MV Move a file | ||||
2178 | CHMOD Change permissions on a file | ||||
2179 | FALSE Exit with non-zero | ||||
2180 | TRUE Exit with zero | ||||
2181 | |||||
2182 | UMASK_NULL Nullify umask | ||||
2183 | DEV_NULL Suppress all command output | ||||
2184 | |||||
2185 | =cut | ||||
2186 | |||||
2187 | # spent 10.4s (0+10.4) within ExtUtils::MM_Any::init_tools which was called 3 times, avg 3.46s/call:
# 3 times (0s+10.4s) by ExtUtils::MM_Win32::init_tools at line 161 of ExtUtils/MM_Win32.pm, avg 3.46s/call | ||||
2188 | 3 | 0s | my $self = shift; | ||
2189 | |||||
2190 | 3 | 0s | 3 | 562ms | $self->{ECHO} ||= $self->oneliner('binmode STDOUT, qq{:raw}; print qq{@ARGV}', ['-l']); # spent 562ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 187ms/call |
2191 | 3 | 0s | 3 | 530ms | $self->{ECHO_N} ||= $self->oneliner('print qq{@ARGV}'); # spent 530ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 177ms/call |
2192 | |||||
2193 | 3 | 0s | 3 | 562ms | $self->{TOUCH} ||= $self->oneliner('touch', ["-MExtUtils::Command"]); # spent 562ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 187ms/call |
2194 | 3 | 0s | 3 | 546ms | $self->{CHMOD} ||= $self->oneliner('chmod', ["-MExtUtils::Command"]); # spent 546ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 182ms/call |
2195 | 3 | 0s | 3 | 530ms | $self->{RM_F} ||= $self->oneliner('rm_f', ["-MExtUtils::Command"]); # spent 530ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 177ms/call |
2196 | 3 | 0s | 3 | 562ms | $self->{RM_RF} ||= $self->oneliner('rm_rf', ["-MExtUtils::Command"]); # spent 562ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 187ms/call |
2197 | 3 | 0s | 3 | 546ms | $self->{TEST_F} ||= $self->oneliner('test_f', ["-MExtUtils::Command"]); # spent 546ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 182ms/call |
2198 | 3 | 0s | 3 | 546ms | $self->{TEST_S} ||= $self->oneliner('test_s', ["-MExtUtils::Command::MM"]); # spent 546ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 182ms/call |
2199 | 3 | 0s | 3 | 546ms | $self->{CP_NONEMPTY} ||= $self->oneliner('cp_nonempty', ["-MExtUtils::Command::MM"]); # spent 546ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 182ms/call |
2200 | 3 | 0s | 3 | 562ms | $self->{FALSE} ||= $self->oneliner('exit 1'); # spent 562ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 187ms/call |
2201 | 3 | 0s | 3 | 530ms | $self->{TRUE} ||= $self->oneliner('exit 0'); # spent 530ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 177ms/call |
2202 | |||||
2203 | 3 | 0s | 3 | 546ms | $self->{MKPATH} ||= $self->oneliner('mkpath', ["-MExtUtils::Command"]); # spent 546ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 182ms/call |
2204 | |||||
2205 | 3 | 0s | 3 | 546ms | $self->{CP} ||= $self->oneliner('cp', ["-MExtUtils::Command"]); # spent 546ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 182ms/call |
2206 | 3 | 0s | 3 | 562ms | $self->{MV} ||= $self->oneliner('mv', ["-MExtUtils::Command"]); # spent 562ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 187ms/call |
2207 | |||||
2208 | 3 | 0s | 3 | 546ms | $self->{MOD_INSTALL} ||= # spent 546ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 182ms/call |
2209 | $self->oneliner(<<'CODE', ['-MExtUtils::Install']); | ||||
2210 | install([ from_to => {@ARGV}, verbose => '$(VERBINST)', uninstall_shadows => '$(UNINST)', dir_mode => '$(PERM_DIR)' ]); | ||||
2211 | CODE | ||||
2212 | 3 | 0s | 3 | 546ms | $self->{DOC_INSTALL} ||= $self->oneliner('perllocal_install', ["-MExtUtils::Command::MM"]); # spent 546ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 182ms/call |
2213 | 3 | 0s | 3 | 530ms | $self->{UNINSTALL} ||= $self->oneliner('uninstall', ["-MExtUtils::Command::MM"]); # spent 530ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 177ms/call |
2214 | 3 | 0s | 3 | 562ms | $self->{WARN_IF_OLD_PACKLIST} ||= # spent 562ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 187ms/call |
2215 | $self->oneliner('warn_if_old_packlist', ["-MExtUtils::Command::MM"]); | ||||
2216 | 3 | 0s | $self->{FIXIN} ||= $self->oneliner('MY->fixin(shift)', ["-MExtUtils::MY"]); | ||
2217 | 3 | 0s | 3 | 530ms | $self->{EQUALIZE_TIMESTAMP} ||= $self->oneliner('eqtime', ["-MExtUtils::Command"]); # spent 530ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 177ms/call |
2218 | |||||
2219 | 3 | 0s | $self->{UNINST} ||= 0; | ||
2220 | 3 | 0s | $self->{VERBINST} ||= 0; | ||
2221 | |||||
2222 | 3 | 0s | $self->{SHELL} ||= $Config{sh}; | ||
2223 | |||||
2224 | # UMASK_NULL is not used by MakeMaker but some CPAN modules | ||||
2225 | # make use of it. | ||||
2226 | 3 | 0s | $self->{UMASK_NULL} ||= "umask 0"; | ||
2227 | |||||
2228 | # Not the greatest default, but its something. | ||||
2229 | 3 | 0s | $self->{DEV_NULL} ||= "> /dev/null 2>&1"; | ||
2230 | |||||
2231 | 3 | 0s | $self->{NOOP} ||= '$(TRUE)'; | ||
2232 | 3 | 0s | $self->{NOECHO} = '@' unless defined $self->{NOECHO}; | ||
2233 | |||||
2234 | 3 | 0s | $self->{FIRST_MAKEFILE} ||= $self->{MAKEFILE} || 'Makefile'; | ||
2235 | 3 | 0s | $self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE}; | ||
2236 | 3 | 0s | $self->{MAKEFILE_OLD} ||= $self->{MAKEFILE}.'.old'; | ||
2237 | 3 | 0s | $self->{MAKE_APERL_FILE} ||= $self->{MAKEFILE}.'.aperl'; | ||
2238 | |||||
2239 | # Not everybody uses -f to indicate "use this Makefile instead" | ||||
2240 | 3 | 0s | $self->{USEMAKEFILE} ||= '-f'; | ||
2241 | |||||
2242 | # Some makes require a wrapper around macros passed in on the command | ||||
2243 | # line. | ||||
2244 | 3 | 0s | $self->{MACROSTART} ||= ''; | ||
2245 | 3 | 0s | $self->{MACROEND} ||= ''; | ||
2246 | |||||
2247 | 3 | 0s | return; | ||
2248 | } | ||||
2249 | |||||
2250 | |||||
2251 | =head3 init_others | ||||
2252 | |||||
2253 | $MM->init_others(); | ||||
2254 | |||||
2255 | Initializes the macro definitions having to do with compiling and | ||||
2256 | linking used by tools_other() and places them in the $MM object. | ||||
2257 | |||||
2258 | If there is no description, its the same as the parameter to | ||||
2259 | WriteMakefile() documented in ExtUtils::MakeMaker. | ||||
2260 | |||||
2261 | =cut | ||||
2262 | |||||
2263 | # spent 46.8ms (0s+46.8) within ExtUtils::MM_Any::init_others which was called 3 times, avg 15.6ms/call:
# 3 times (0s+46.8ms) by ExtUtils::MM_Win32::init_others at line 186 of ExtUtils/MM_Win32.pm, avg 15.6ms/call | ||||
2264 | 3 | 0s | my $self = shift; | ||
2265 | |||||
2266 | 3 | 0s | $self->{LD_RUN_PATH} = ""; | ||
2267 | |||||
2268 | 3 | 0s | 3 | 0s | $self->{LIBS} = $self->_fix_libs($self->{LIBS}); # spent 0s making 3 calls to ExtUtils::MM_Any::_fix_libs, avg 0s/call |
2269 | |||||
2270 | # Compute EXTRALIBS, BSLOADLIBS and LDLOADLIBS from $self->{LIBS} | ||||
2271 | 3 | 0s | foreach my $libs ( @{$self->{LIBS}} ){ | ||
2272 | 3 | 0s | 3 | 0s | $libs =~ s/^\s*(.*\S)\s*$/$1/; # remove leading and trailing whitespace # spent 0s making 3 calls to ExtUtils::MM_Any::CORE:subst, avg 0s/call |
2273 | 3 | 0s | 3 | 46.8ms | my(@libs) = $self->extliblist($libs); # spent 46.8ms making 3 calls to ExtUtils::MM_Unix::extliblist, avg 15.6ms/call |
2274 | 3 | 0s | if ($libs[0] or $libs[1] or $libs[2]){ | ||
2275 | # LD_RUN_PATH now computed by ExtUtils::Liblist | ||||
2276 | 3 | 0s | ($self->{EXTRALIBS}, $self->{BSLOADLIBS}, | ||
2277 | $self->{LDLOADLIBS}, $self->{LD_RUN_PATH}) = @libs; | ||||
2278 | 3 | 0s | last; | ||
2279 | } | ||||
2280 | } | ||||
2281 | |||||
2282 | 3 | 0s | if ( $self->{OBJECT} ) { | ||
2283 | $self->{OBJECT} = join(" ", @{$self->{OBJECT}}) if ref $self->{OBJECT}; | ||||
2284 | $self->{OBJECT} =~ s!\.o(bj)?\b!\$(OBJ_EXT)!g; | ||||
2285 | } elsif ( $self->{MAGICXS} && @{$self->{O_FILES}||[]} ) { | ||||
2286 | $self->{OBJECT} = join(" ", @{$self->{O_FILES}}); | ||||
2287 | $self->{OBJECT} =~ s!\.o(bj)?\b!\$(OBJ_EXT)!g; | ||||
2288 | } else { | ||||
2289 | # init_dirscan should have found out, if we have C files | ||||
2290 | 3 | 0s | $self->{OBJECT} = ""; | ||
2291 | 3 | 0s | $self->{OBJECT} = '$(BASEEXT)$(OBJ_EXT)' if @{$self->{C}||[]}; | ||
2292 | } | ||||
2293 | 3 | 0s | 3 | 0s | $self->{OBJECT} =~ s/\n+/ \\\n\t/g; # spent 0s making 3 calls to ExtUtils::MM_Any::CORE:subst, avg 0s/call |
2294 | |||||
2295 | 3 | 0s | 3 | 0s | $self->{BOOTDEP} = (-f "$self->{BASEEXT}_BS") ? "$self->{BASEEXT}_BS" : ""; # spent 0s making 3 calls to ExtUtils::MM_Any::CORE:ftfile, avg 0s/call |
2296 | 3 | 0s | $self->{PERLMAINCC} ||= '$(CC)'; | ||
2297 | 3 | 0s | $self->{LDFROM} = '$(OBJECT)' unless $self->{LDFROM}; | ||
2298 | |||||
2299 | # Sanity check: don't define LINKTYPE = dynamic if we're skipping | ||||
2300 | # the 'dynamic' section of MM. We don't have this problem with | ||||
2301 | # 'static', since we either must use it (%Config says we can't | ||||
2302 | # use dynamic loading) or the caller asked for it explicitly. | ||||
2303 | 3 | 0s | if (!$self->{LINKTYPE}) { | ||
2304 | $self->{LINKTYPE} = $self->{SKIPHASH}{'dynamic'} | ||||
2305 | ? 'static' | ||||
2306 | : ($Config{usedl} ? 'dynamic' : 'static'); | ||||
2307 | } | ||||
2308 | |||||
2309 | 3 | 0s | return; | ||
2310 | } | ||||
2311 | |||||
2312 | |||||
2313 | # Lets look at $self->{LIBS} carefully: It may be an anon array, a string or | ||||
2314 | # undefined. In any case we turn it into an anon array | ||||
2315 | # spent 0s within ExtUtils::MM_Any::_fix_libs which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Any::init_others at line 2268, avg 0s/call | ||||
2316 | 3 | 0s | my($self, $libs) = @_; | ||
2317 | |||||
2318 | 3 | 0s | return !defined $libs ? [''] : | ||
2319 | !ref $libs ? [$libs] : | ||||
2320 | !defined $libs->[0] ? [''] : | ||||
2321 | $libs ; | ||||
2322 | } | ||||
2323 | |||||
2324 | |||||
2325 | =head3 tools_other | ||||
2326 | |||||
2327 | my $make_frag = $MM->tools_other; | ||||
2328 | |||||
2329 | Returns a make fragment containing definitions for the macros init_others() | ||||
2330 | initializes. | ||||
2331 | |||||
2332 | =cut | ||||
2333 | |||||
2334 | # spent 0s within ExtUtils::MM_Any::tools_other which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
2335 | 3 | 0s | my($self) = shift; | ||
2336 | 3 | 0s | my @m; | ||
2337 | |||||
2338 | # We set PM_FILTER as late as possible so it can see all the earlier | ||||
2339 | # on macro-order sensitive makes such as nmake. | ||||
2340 | 3 | 0s | for my $tool (qw{ SHELL CHMOD CP MV NOOP NOECHO RM_F RM_RF TEST_F TOUCH | ||
2341 | UMASK_NULL DEV_NULL MKPATH EQUALIZE_TIMESTAMP | ||||
2342 | FALSE TRUE | ||||
2343 | ECHO ECHO_N | ||||
2344 | UNINST VERBINST | ||||
2345 | MOD_INSTALL DOC_INSTALL UNINSTALL | ||||
2346 | WARN_IF_OLD_PACKLIST | ||||
2347 | MACROSTART MACROEND | ||||
2348 | USEMAKEFILE | ||||
2349 | PM_FILTER | ||||
2350 | FIXIN | ||||
2351 | CP_NONEMPTY | ||||
2352 | } ) | ||||
2353 | { | ||||
2354 | 90 | 0s | next unless defined $self->{$tool}; | ||
2355 | 84 | 0s | push @m, "$tool = $self->{$tool}\n"; | ||
2356 | } | ||||
2357 | |||||
2358 | 3 | 0s | return join "", @m; | ||
2359 | } | ||||
2360 | |||||
2361 | |||||
2362 | =head3 init_DIRFILESEP I<Abstract> | ||||
2363 | |||||
2364 | $MM->init_DIRFILESEP; | ||||
2365 | my $dirfilesep = $MM->{DIRFILESEP}; | ||||
2366 | |||||
2367 | Initializes the DIRFILESEP macro which is the separator between the | ||||
2368 | directory and filename in a filepath. ie. / on Unix, \ on Win32 and | ||||
2369 | nothing on VMS. | ||||
2370 | |||||
2371 | For example: | ||||
2372 | |||||
2373 | # instead of $(INST_ARCHAUTODIR)/extralibs.ld | ||||
2374 | $(INST_ARCHAUTODIR)$(DIRFILESEP)extralibs.ld | ||||
2375 | |||||
2376 | Something of a hack but it prevents a lot of code duplication between | ||||
2377 | MM_* variants. | ||||
2378 | |||||
2379 | Do not use this as a separator between directories. Some operating | ||||
2380 | systems use different separators between subdirectories as between | ||||
2381 | directories and filenames (for example: VOLUME:[dir1.dir2]file on VMS). | ||||
2382 | |||||
2383 | =head3 init_linker I<Abstract> | ||||
2384 | |||||
2385 | $mm->init_linker; | ||||
2386 | |||||
2387 | Initialize macros which have to do with linking. | ||||
2388 | |||||
2389 | PERL_ARCHIVE: path to libperl.a equivalent to be linked to dynamic | ||||
2390 | extensions. | ||||
2391 | |||||
2392 | PERL_ARCHIVE_AFTER: path to a library which should be put on the | ||||
2393 | linker command line I<after> the external libraries to be linked to | ||||
2394 | dynamic extensions. This may be needed if the linker is one-pass, and | ||||
2395 | Perl includes some overrides for C RTL functions, such as malloc(). | ||||
2396 | |||||
2397 | EXPORT_LIST: name of a file that is passed to linker to define symbols | ||||
2398 | to be exported. | ||||
2399 | |||||
2400 | Some OSes do not need these in which case leave it blank. | ||||
2401 | |||||
2402 | |||||
2403 | =head3 init_platform | ||||
2404 | |||||
2405 | $mm->init_platform | ||||
2406 | |||||
2407 | Initialize any macros which are for platform specific use only. | ||||
2408 | |||||
2409 | A typical one is the version number of your OS specific module. | ||||
2410 | (ie. MM_Unix_VERSION or MM_VMS_VERSION). | ||||
2411 | |||||
2412 | =cut | ||||
2413 | |||||
2414 | sub init_platform { | ||||
2415 | return ''; | ||||
2416 | } | ||||
2417 | |||||
2418 | |||||
2419 | =head3 init_MAKE | ||||
2420 | |||||
2421 | $mm->init_MAKE | ||||
2422 | |||||
2423 | Initialize MAKE from either a MAKE environment variable or $Config{make}. | ||||
2424 | |||||
2425 | =cut | ||||
2426 | |||||
2427 | # spent 0s within ExtUtils::MM_Any::init_MAKE which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 649 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
2428 | 3 | 0s | my $self = shift; | ||
2429 | |||||
2430 | 3 | 0s | $self->{MAKE} ||= $ENV{MAKE} || $Config{make}; | ||
2431 | } | ||||
2432 | |||||
2433 | |||||
2434 | =head2 Tools | ||||
2435 | |||||
2436 | A grab bag of methods to generate specific macros and commands. | ||||
2437 | |||||
- - | |||||
2440 | =head3 manifypods | ||||
2441 | |||||
2442 | Defines targets and routines to translate the pods into manpages and | ||||
2443 | put them into the INST_* directories. | ||||
2444 | |||||
2445 | =cut | ||||
2446 | |||||
2447 | # spent 0s within ExtUtils::MM_Any::manifypods which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
2448 | 3 | 0s | my $self = shift; | ||
2449 | |||||
2450 | 3 | 0s | 3 | 0s | my $POD2MAN_macro = $self->POD2MAN_macro(); # spent 0s making 3 calls to ExtUtils::MM_Any::POD2MAN_macro, avg 0s/call |
2451 | 3 | 0s | 3 | 0s | my $manifypods_target = $self->manifypods_target(); # spent 0s making 3 calls to ExtUtils::MM_Any::manifypods_target, avg 0s/call |
2452 | |||||
2453 | 3 | 0s | return <<END_OF_TARGET; | ||
2454 | |||||
2455 | $POD2MAN_macro | ||||
2456 | |||||
2457 | $manifypods_target | ||||
2458 | |||||
2459 | END_OF_TARGET | ||||
2460 | |||||
2461 | } | ||||
2462 | |||||
2463 | |||||
2464 | =head3 POD2MAN_macro | ||||
2465 | |||||
2466 | my $pod2man_macro = $self->POD2MAN_macro | ||||
2467 | |||||
2468 | Returns a definition for the POD2MAN macro. This is a program | ||||
2469 | which emulates the pod2man utility. You can add more switches to the | ||||
2470 | command by simply appending them on the macro. | ||||
2471 | |||||
2472 | Typical usage: | ||||
2473 | |||||
2474 | $(POD2MAN) --section=3 --perm_rw=$(PERM_RW) podfile1 man_page1 ... | ||||
2475 | |||||
2476 | =cut | ||||
2477 | |||||
2478 | # spent 0s within ExtUtils::MM_Any::POD2MAN_macro which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Any::manifypods at line 2450, avg 0s/call | ||||
2479 | 3 | 0s | my $self = shift; | ||
2480 | |||||
2481 | # Need the trailing '--' so perl stops gobbling arguments and - happens | ||||
2482 | # to be an alternative end of line separator on VMS so we quote it | ||||
2483 | 3 | 0s | return <<'END_OF_DEF'; | ||
2484 | POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" | ||||
2485 | POD2MAN = $(POD2MAN_EXE) | ||||
2486 | END_OF_DEF | ||||
2487 | } | ||||
2488 | |||||
2489 | |||||
2490 | =head3 test_via_harness | ||||
2491 | |||||
2492 | my $command = $mm->test_via_harness($perl, $tests); | ||||
2493 | |||||
2494 | Returns a $command line which runs the given set of $tests with | ||||
2495 | Test::Harness and the given $perl. | ||||
2496 | |||||
2497 | Used on the t/*.t files. | ||||
2498 | |||||
2499 | =cut | ||||
2500 | |||||
2501 | # spent 0s within ExtUtils::MM_Any::test_via_harness which was called 2 times, avg 0s/call:
# once (0s+0s) by ExtUtils::MM_Unix::test at line 3534 of ExtUtils/MM_Unix.pm
# once (0s+0s) by ExtUtils::MM_Unix::test at line 3518 of ExtUtils/MM_Unix.pm | ||||
2502 | 2 | 0s | my($self, $perl, $tests) = @_; | ||
2503 | |||||
2504 | 2 | 0s | return qq{\t$perl "-MExtUtils::Command::MM" "-MTest::Harness" }. | ||
2505 | qq{"-e" "undef *Test::Harness::Switches; test_harness(\$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $tests\n}; | ||||
2506 | } | ||||
2507 | |||||
2508 | =head3 test_via_script | ||||
2509 | |||||
2510 | my $command = $mm->test_via_script($perl, $script); | ||||
2511 | |||||
2512 | Returns a $command line which just runs a single test without | ||||
2513 | Test::Harness. No checks are done on the results, they're just | ||||
2514 | printed. | ||||
2515 | |||||
2516 | Used for test.pl, since they don't always follow Test::Harness | ||||
2517 | formatting. | ||||
2518 | |||||
2519 | =cut | ||||
2520 | |||||
2521 | # spent 0s within ExtUtils::MM_Any::test_via_script which was called 6 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Unix::test at line 3525 of ExtUtils/MM_Unix.pm, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Unix::test at line 3538 of ExtUtils/MM_Unix.pm, avg 0s/call | ||||
2522 | 6 | 0s | my($self, $perl, $script) = @_; | ||
2523 | 6 | 0s | return qq{\t$perl "-I\$(INST_LIB)" "-I\$(INST_ARCHLIB)" $script\n}; | ||
2524 | } | ||||
2525 | |||||
2526 | |||||
2527 | =head3 tool_autosplit | ||||
2528 | |||||
2529 | Defines a simple perl call that runs autosplit. May be deprecated by | ||||
2530 | pm_to_blib soon. | ||||
2531 | |||||
2532 | =cut | ||||
2533 | |||||
2534 | # spent 562ms (0s+562) within ExtUtils::MM_Any::tool_autosplit which was called 3 times, avg 187ms/call:
# 3 times (0s+562ms) by ExtUtils::MakeMaker::new at line 745 of ExtUtils/MakeMaker.pm, avg 187ms/call | ||||
2535 | 3 | 0s | my($self, %attribs) = @_; | ||
2536 | |||||
2537 | 3 | 0s | my $maxlen = $attribs{MAXLEN} ? '$$AutoSplit::Maxlen=$attribs{MAXLEN};' | ||
2538 | : ''; | ||||
2539 | |||||
2540 | 3 | 0s | 3 | 562ms | my $asplit = $self->oneliner(sprintf <<'PERL_CODE', $maxlen); # spent 562ms making 3 calls to ExtUtils::MM_Win32::oneliner, avg 187ms/call |
2541 | use AutoSplit; %s autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) | ||||
2542 | PERL_CODE | ||||
2543 | |||||
2544 | 3 | 0s | return sprintf <<'MAKE_FRAG', $asplit; | ||
2545 | # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto | ||||
2546 | AUTOSPLITFILE = %s | ||||
2547 | |||||
2548 | MAKE_FRAG | ||||
2549 | |||||
2550 | } | ||||
2551 | |||||
2552 | |||||
2553 | =head3 arch_check | ||||
2554 | |||||
2555 | my $arch_ok = $mm->arch_check( | ||||
2556 | $INC{"Config.pm"}, | ||||
2557 | File::Spec->catfile($Config{archlibexp}, "Config.pm") | ||||
2558 | ); | ||||
2559 | |||||
2560 | A sanity check that what Perl thinks the architecture is and what | ||||
2561 | Config thinks the architecture is are the same. If they're not it | ||||
2562 | will return false and show a diagnostic message. | ||||
2563 | |||||
2564 | When building Perl it will always return true, as nothing is installed | ||||
2565 | yet. | ||||
2566 | |||||
2567 | The interface is a bit odd because this is the result of a | ||||
2568 | quick refactoring. Don't rely on it. | ||||
2569 | |||||
2570 | =cut | ||||
2571 | |||||
2572 | # spent 0s within ExtUtils::MM_Any::arch_check which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Win32::arch_check at line 486 of ExtUtils/MM_Win32.pm, avg 0s/call | ||||
2573 | 3 | 0s | my $self = shift; | ||
2574 | 3 | 0s | my($pconfig, $cconfig) = @_; | ||
2575 | |||||
2576 | 3 | 0s | return 1 if $self->{PERL_SRC}; | ||
2577 | |||||
2578 | 3 | 0s | 3 | 0s | my($pvol, $pthinks) = $self->splitpath($pconfig); # spent 0s making 3 calls to File::Spec::Win32::splitpath, avg 0s/call |
2579 | 3 | 0s | 3 | 0s | my($cvol, $cthinks) = $self->splitpath($cconfig); # spent 0s making 3 calls to File::Spec::Win32::splitpath, avg 0s/call |
2580 | |||||
2581 | 3 | 0s | 3 | 0s | $pthinks = $self->canonpath($pthinks); # spent 0s making 3 calls to File::Spec::Win32::canonpath, avg 0s/call |
2582 | 3 | 0s | 3 | 0s | $cthinks = $self->canonpath($cthinks); # spent 0s making 3 calls to File::Spec::Win32::canonpath, avg 0s/call |
2583 | |||||
2584 | 3 | 0s | my $ret = 1; | ||
2585 | 3 | 0s | if ($pthinks ne $cthinks) { | ||
2586 | print "Have $pthinks\n"; | ||||
2587 | print "Want $cthinks\n"; | ||||
2588 | |||||
2589 | $ret = 0; | ||||
2590 | |||||
2591 | my $arch = (grep length, $self->splitdir($pthinks))[-1]; | ||||
2592 | |||||
2593 | print <<END unless $self->{UNINSTALLED_PERL}; | ||||
2594 | Your perl and your Config.pm seem to have different ideas about the | ||||
2595 | architecture they are running on. | ||||
2596 | Perl thinks: [$arch] | ||||
2597 | Config says: [$Config{archname}] | ||||
2598 | This may or may not cause problems. Please check your installation of perl | ||||
2599 | if you have problems building this extension. | ||||
2600 | END | ||||
2601 | } | ||||
2602 | |||||
2603 | 3 | 0s | return $ret; | ||
2604 | } | ||||
2605 | |||||
- - | |||||
2608 | =head2 File::Spec wrappers | ||||
2609 | |||||
2610 | ExtUtils::MM_Any is a subclass of File::Spec. The methods noted here | ||||
2611 | override File::Spec. | ||||
2612 | |||||
- - | |||||
2615 | =head3 catfile | ||||
2616 | |||||
2617 | File::Spec <= 0.83 has a bug where the file part of catfile is not | ||||
2618 | canonicalized. This override fixes that bug. | ||||
2619 | |||||
2620 | =cut | ||||
2621 | |||||
2622 | # spent 15.6ms (0s+15.6) within ExtUtils::MM_Any::catfile which was called 83 times, avg 188µs/call:
# 24 times (0s+0s) by ExtUtils::MM_Unix::init_main at line 1644 of ExtUtils/MM_Unix.pm, avg 0s/call
# 12 times (0s+0s) by ExtUtils::MM_Unix::tool_xsubpp at line 3590 of ExtUtils/MM_Unix.pm, avg 0s/call
# 3 times (0s+15.6ms) by ExtUtils::MM_Unix::init_xs at line 2072 of ExtUtils/MM_Unix.pm, avg 5.20ms/call
# 3 times (0s+0s) by ExtUtils::MM_Unix::install at line 2224 of ExtUtils/MM_Unix.pm, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Unix::init_main at line 1696 of ExtUtils/MM_Unix.pm, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Unix::install at line 2188 of ExtUtils/MM_Unix.pm, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Unix::tool_xsubpp at line 3598 of ExtUtils/MM_Unix.pm, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Unix::staticmake at line 3389 of ExtUtils/MM_Unix.pm, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Unix::init_main at line 1778 of ExtUtils/MM_Unix.pm, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Unix::init_xs at line 2074 of ExtUtils/MM_Unix.pm, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Unix::init_xs at line 2076 of ExtUtils/MM_Unix.pm, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Unix::init_dirscan at line 1315 of ExtUtils/MM_Unix.pm, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::clean at line 692, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::clean at line 693, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 665 of ExtUtils/MakeMaker.pm, avg 0s/call
# 2 times (0s+0s) by ExtUtils::MM_Unix::install at line 2124 of ExtUtils/MM_Unix.pm, avg 0s/call
# 2 times (0s+0s) by ExtUtils::MM_Unix::init_dirscan at line 1318 of ExtUtils/MM_Unix.pm, avg 0s/call
# 2 times (0s+0s) by ExtUtils::MM_Unix::install at line 2161 of ExtUtils/MM_Unix.pm, avg 0s/call
# 2 times (0s+0s) by ExtUtils::MM_Unix::install at line 2143 of ExtUtils/MM_Unix.pm, avg 0s/call | ||||
2623 | 83 | 0s | my $self = shift; | ||
2624 | 83 | 0s | 166 | 15.6ms | return $self->canonpath($self->SUPER::catfile(@_)); # spent 15.6ms making 83 calls to File::Spec::Win32::catfile, avg 188µs/call
# spent 0s making 83 calls to File::Spec::Win32::canonpath, avg 0s/call |
2625 | } | ||||
2626 | |||||
- - | |||||
2629 | =head2 Misc | ||||
2630 | |||||
2631 | Methods I can't really figure out where they should go yet. | ||||
2632 | |||||
2633 | |||||
2634 | =head3 find_tests | ||||
2635 | |||||
2636 | my $test = $mm->find_tests; | ||||
2637 | |||||
2638 | Returns a string suitable for feeding to the shell to return all | ||||
2639 | tests in t/*.t. | ||||
2640 | |||||
2641 | =cut | ||||
2642 | |||||
2643 | # spent 0s within ExtUtils::MM_Any::find_tests which was called:
# once (0s+0s) by ExtUtils::MM_Unix::test at line 3477 of ExtUtils/MM_Unix.pm | ||||
2644 | 1 | 0s | my($self) = shift; | ||
2645 | 1 | 0s | 1 | 0s | return -d 't' ? 't/*.t' : ''; # spent 0s making 1 call to ExtUtils::MM_Any::CORE:ftdir |
2646 | } | ||||
2647 | |||||
2648 | =head3 find_tests_recursive | ||||
2649 | |||||
2650 | my $tests = $mm->find_tests_recursive; | ||||
2651 | |||||
2652 | Returns a string suitable for feeding to the shell to return all | ||||
2653 | tests in t/ but recursively. | ||||
2654 | |||||
2655 | =cut | ||||
2656 | |||||
2657 | sub find_tests_recursive { | ||||
2658 | my($self) = shift; | ||||
2659 | return '' unless -d 't'; | ||||
2660 | |||||
2661 | require File::Find; | ||||
2662 | |||||
2663 | my %testfiles; | ||||
2664 | |||||
2665 | my $wanted = sub { | ||||
2666 | return unless m!\.t$!; | ||||
2667 | my ($volume,$directories,$file) = | ||||
2668 | File::Spec->splitpath( $File::Find::name ); | ||||
2669 | my @dirs = File::Spec->splitdir( $directories ); | ||||
2670 | for ( @dirs ) { | ||||
2671 | next if $_ eq 't'; | ||||
2672 | unless ( $_ ) { | ||||
2673 | $_ = '*.t'; | ||||
2674 | next; | ||||
2675 | } | ||||
2676 | $_ = '*'; | ||||
2677 | } | ||||
2678 | my $testfile = join '/', @dirs; | ||||
2679 | $testfiles{ $testfile } = 1; | ||||
2680 | }; | ||||
2681 | |||||
2682 | File::Find::find( $wanted, 't' ); | ||||
2683 | |||||
2684 | return join ' ', sort keys %testfiles; | ||||
2685 | } | ||||
2686 | |||||
2687 | =head3 extra_clean_files | ||||
2688 | |||||
2689 | my @files_to_clean = $MM->extra_clean_files; | ||||
2690 | |||||
2691 | Returns a list of OS specific files to be removed in the clean target in | ||||
2692 | addition to the usual set. | ||||
2693 | |||||
2694 | =cut | ||||
2695 | |||||
2696 | # An empty method here tickled a perl 5.8.1 bug and would return its object. | ||||
2697 | sub extra_clean_files { | ||||
2698 | return; | ||||
2699 | } | ||||
2700 | |||||
2701 | |||||
2702 | =head3 installvars | ||||
2703 | |||||
2704 | my @installvars = $mm->installvars; | ||||
2705 | |||||
2706 | A list of all the INSTALL* variables without the INSTALL prefix. Useful | ||||
2707 | for iteration or building related variable sets. | ||||
2708 | |||||
2709 | =cut | ||||
2710 | |||||
2711 | # spent 0s within ExtUtils::MM_Any::installvars which was called 6 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Unix::constants at line 392 of ExtUtils/MM_Unix.pm, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Unix::init_DEST at line 535 of ExtUtils/MM_Unix.pm, avg 0s/call | ||||
2712 | 6 | 0s | return qw(PRIVLIB SITELIB VENDORLIB | ||
2713 | ARCHLIB SITEARCH VENDORARCH | ||||
2714 | BIN SITEBIN VENDORBIN | ||||
2715 | SCRIPT SITESCRIPT VENDORSCRIPT | ||||
2716 | MAN1DIR SITEMAN1DIR VENDORMAN1DIR | ||||
2717 | MAN3DIR SITEMAN3DIR VENDORMAN3DIR | ||||
2718 | ); | ||||
2719 | } | ||||
2720 | |||||
2721 | |||||
2722 | =head3 libscan | ||||
2723 | |||||
2724 | my $wanted = $self->libscan($path); | ||||
2725 | |||||
2726 | Takes a path to a file or dir and returns an empty string if we don't | ||||
2727 | want to include this file in the library. Otherwise it returns the | ||||
2728 | the $path unchanged. | ||||
2729 | |||||
2730 | Mainly used to exclude version control administrative directories from | ||||
2731 | installation. | ||||
2732 | |||||
2733 | =cut | ||||
2734 | |||||
2735 | # spent 0s within ExtUtils::MM_Any::libscan which was called 15 times, avg 0s/call:
# 15 times (0s+0s) by ExtUtils::MM_Unix::init_dirscan at line 1314 of ExtUtils/MM_Unix.pm, avg 0s/call | ||||
2736 | 15 | 0s | my($self,$path) = @_; | ||
2737 | 15 | 0s | 15 | 0s | my($dirs,$file) = ($self->splitpath($path))[1,2]; # spent 0s making 15 calls to File::Spec::Win32::splitpath, avg 0s/call |
2738 | 15 | 0s | 30 | 0s | return '' if grep /^(?:RCS|CVS|SCCS|\.svn|_darcs)$/, # spent 0s making 15 calls to ExtUtils::MM_Any::CORE:match, avg 0s/call
# spent 0s making 15 calls to File::Spec::Win32::splitdir, avg 0s/call |
2739 | $self->splitdir($dirs), $file; | ||||
2740 | |||||
2741 | 15 | 0s | return $path; | ||
2742 | } | ||||
2743 | |||||
2744 | |||||
2745 | =head3 platform_constants | ||||
2746 | |||||
2747 | my $make_frag = $mm->platform_constants | ||||
2748 | |||||
2749 | Returns a make fragment defining all the macros initialized in | ||||
2750 | init_platform() rather than put them in constants(). | ||||
2751 | |||||
2752 | =cut | ||||
2753 | |||||
2754 | sub platform_constants { | ||||
2755 | return ''; | ||||
2756 | } | ||||
2757 | |||||
2758 | =begin private | ||||
2759 | |||||
2760 | =head3 _PREREQ_PRINT | ||||
2761 | |||||
2762 | $self->_PREREQ_PRINT; | ||||
2763 | |||||
2764 | Implements PREREQ_PRINT. | ||||
2765 | |||||
2766 | Refactored out of MakeMaker->new(). | ||||
2767 | |||||
2768 | =end private | ||||
2769 | |||||
2770 | =cut | ||||
2771 | |||||
2772 | sub _PREREQ_PRINT { | ||||
2773 | my $self = shift; | ||||
2774 | |||||
2775 | require Data::Dumper; | ||||
2776 | my @what = ('PREREQ_PM'); | ||||
2777 | push @what, 'MIN_PERL_VERSION' if $self->{MIN_PERL_VERSION}; | ||||
2778 | push @what, 'BUILD_REQUIRES' if $self->{BUILD_REQUIRES}; | ||||
2779 | print Data::Dumper->Dump([@{$self}{@what}], \@what); | ||||
2780 | exit 0; | ||||
2781 | } | ||||
2782 | |||||
2783 | |||||
2784 | =begin private | ||||
2785 | |||||
2786 | =head3 _PRINT_PREREQ | ||||
2787 | |||||
2788 | $mm->_PRINT_PREREQ; | ||||
2789 | |||||
2790 | Implements PRINT_PREREQ, a slightly different version of PREREQ_PRINT | ||||
2791 | added by Redhat to, I think, support generating RPMs from Perl modules. | ||||
2792 | |||||
2793 | Should not include BUILD_REQUIRES as RPMs do not incluide them. | ||||
2794 | |||||
2795 | Refactored out of MakeMaker->new(). | ||||
2796 | |||||
2797 | =end private | ||||
2798 | |||||
2799 | =cut | ||||
2800 | |||||
2801 | sub _PRINT_PREREQ { | ||||
2802 | my $self = shift; | ||||
2803 | |||||
2804 | my $prereqs= $self->{PREREQ_PM}; | ||||
2805 | my @prereq = map { [$_, $prereqs->{$_}] } keys %$prereqs; | ||||
2806 | |||||
2807 | if ( $self->{MIN_PERL_VERSION} ) { | ||||
2808 | push @prereq, ['perl' => $self->{MIN_PERL_VERSION}]; | ||||
2809 | } | ||||
2810 | |||||
2811 | print join(" ", map { "perl($_->[0])>=$_->[1] " } | ||||
2812 | sort { $a->[0] cmp $b->[0] } @prereq), "\n"; | ||||
2813 | exit 0; | ||||
2814 | } | ||||
2815 | |||||
2816 | |||||
2817 | =begin private | ||||
2818 | |||||
2819 | =head3 _all_prereqs | ||||
2820 | |||||
2821 | my $prereqs = $self->_all_prereqs; | ||||
2822 | |||||
2823 | Returns a hash ref of both PREREQ_PM and BUILD_REQUIRES. | ||||
2824 | |||||
2825 | =end private | ||||
2826 | |||||
2827 | =cut | ||||
2828 | |||||
2829 | # spent 0s within ExtUtils::MM_Any::_all_prereqs which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MakeMaker::new at line 498 of ExtUtils/MakeMaker.pm, avg 0s/call | ||||
2830 | 3 | 0s | my $self = shift; | ||
2831 | |||||
2832 | 3 | 0s | return { %{$self->{PREREQ_PM}}, %{$self->{BUILD_REQUIRES}} }; | ||
2833 | } | ||||
2834 | |||||
2835 | =begin private | ||||
2836 | |||||
2837 | =head3 _perl_header_files | ||||
2838 | |||||
2839 | my $perl_header_files= $self->_perl_header_files; | ||||
2840 | |||||
2841 | returns a sorted list of header files as found in PERL_SRC or $archlibexp/CORE. | ||||
2842 | |||||
2843 | Used by perldepend() in MM_Unix and MM_VMS via _perl_header_files_fragment() | ||||
2844 | |||||
2845 | =end private | ||||
2846 | |||||
2847 | =cut | ||||
2848 | |||||
2849 | # spent 0s within ExtUtils::MM_Any::_perl_header_files which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Any::_perl_header_files_fragment at line 2889, avg 0s/call | ||||
2850 | 3 | 0s | my $self = shift; | ||
2851 | |||||
2852 | 3 | 0s | 3 | 0s | my $header_dir = $self->{PERL_SRC} || $ENV{PERL_SRC} || $self->catdir($Config{archlibexp}, 'CORE'); # spent 0s making 3 calls to File::Spec::Win32::catdir, avg 0s/call |
2853 | 3 | 0s | 3 | 0s | opendir my $dh, $header_dir # spent 0s making 3 calls to ExtUtils::MM_Any::CORE:open_dir, avg 0s/call |
2854 | or die "Failed to opendir '$header_dir' to find header files: $!"; | ||||
2855 | |||||
2856 | # we need to use a temporary here as the sort in scalar context would have undefined results. | ||||
2857 | 258 | 0s | 261 | 0s | my @perl_headers= sort grep { /\.h\z/ } readdir($dh); # spent 0s making 255 calls to ExtUtils::MM_Any::CORE:match, avg 0s/call
# spent 0s making 3 calls to ExtUtils::MM_Any::CORE:readdir, avg 0s/call
# spent 0s making 3 calls to ExtUtils::MM_Any::CORE:sort, avg 0s/call |
2858 | |||||
2859 | 3 | 0s | 3 | 0s | closedir $dh; # spent 0s making 3 calls to ExtUtils::MM_Any::CORE:closedir, avg 0s/call |
2860 | |||||
2861 | 3 | 0s | return @perl_headers; | ||
2862 | } | ||||
2863 | |||||
2864 | =begin private | ||||
2865 | |||||
2866 | =head3 _perl_header_files_fragment ($o, $separator) | ||||
2867 | |||||
2868 | my $perl_header_files_fragment= $self->_perl_header_files_fragment("/"); | ||||
2869 | |||||
2870 | return a Makefile fragment which holds the list of perl header files which | ||||
2871 | XS code depends on $(PERL_INC), and sets up the dependency for the $(OBJECT) file. | ||||
2872 | |||||
2873 | The $separator argument defaults to "". MM_VMS will set it to "" and MM_UNIX to "/" | ||||
2874 | in perldepend(). This reason child subclasses need to control this is that in | ||||
2875 | VMS the $(PERL_INC) directory will already have delimiters in it, but in | ||||
2876 | UNIX $(PERL_INC) will need a slash between it an the filename. Hypothetically | ||||
2877 | win32 could use "\\" (but it doesn't need to). | ||||
2878 | |||||
2879 | =end private | ||||
2880 | |||||
2881 | =cut | ||||
2882 | |||||
2883 | # spent 0s within ExtUtils::MM_Any::_perl_header_files_fragment which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Unix::perldepend at line 2883 of ExtUtils/MM_Unix.pm, avg 0s/call | ||||
2884 | 3 | 0s | my ($self, $separator)= @_; | ||
2885 | 3 | 0s | $separator ||= ""; | ||
2886 | 240 | 0s | return join("\\\n", | ||
2887 | "PERL_HDRS = ", | ||||
2888 | map { | ||||
2889 | 3 | 0s | 3 | 0s | sprintf( " \$(PERL_INCDEP)%s%s ", $separator, $_ ) # spent 0s making 3 calls to ExtUtils::MM_Any::_perl_header_files, avg 0s/call |
2890 | } $self->_perl_header_files() | ||||
2891 | ) . "\n\n" | ||||
2892 | . "\$(OBJECT) : \$(PERL_HDRS)\n"; | ||||
2893 | } | ||||
2894 | |||||
2895 | |||||
2896 | =head1 AUTHOR | ||||
2897 | |||||
2898 | Michael G Schwern <schwern@pobox.com> and the denizens of | ||||
2899 | makemaker@perl.org with code from ExtUtils::MM_Unix and | ||||
2900 | ExtUtils::MM_Win32. | ||||
2901 | |||||
2902 | |||||
2903 | =cut | ||||
2904 | |||||
2905 | 1 | 0s | 1; | ||
# spent 61.7s within ExtUtils::MM_Any::CORE:backtick which was called 333 times, avg 185ms/call:
# 333 times (61.7s+0s) by ExtUtils::MM_Any::is_make_type at line 213, avg 185ms/call | |||||
# spent 0s within ExtUtils::MM_Any::CORE:closedir which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Any::_perl_header_files at line 2859, avg 0s/call | |||||
# spent 0s within ExtUtils::MM_Any::CORE:ftdir which was called:
# once (0s+0s) by ExtUtils::MM_Any::find_tests at line 2645 | |||||
# spent 0s within ExtUtils::MM_Any::CORE:ftfile which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Any::init_others at line 2295, avg 0s/call | |||||
# spent 0s within ExtUtils::MM_Any::CORE:ftis which was called 8 times, avg 0s/call:
# 8 times (0s+0s) by ExtUtils::MM_Any::_mymeta_from_meta at line 1488, avg 0s/call | |||||
# spent 0s within ExtUtils::MM_Any::CORE:match which was called 970 times, avg 0s/call:
# 336 times (0s+0s) by ExtUtils::MM_Any::is_make_type at line 208, avg 0s/call
# 333 times (0s+0s) by ExtUtils::MM_Any::is_make_type at line 209, avg 0s/call
# 255 times (0s+0s) by ExtUtils::MM_Any::_perl_header_files at line 2857, avg 0s/call
# 15 times (0s+0s) by ExtUtils::MM_Any::libscan at line 2738, avg 0s/call
# 13 times (0s+0s) by ExtUtils::MM_Any::quote_dep at line 256, avg 0s/call
# 5 times (0s+0s) by ExtUtils::MM_Any::metafile_data at line 1139, avg 0s/call
# 5 times (0s+0s) by ExtUtils::MM_Any::_normalize_version at line 1246, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::_fix_metadata_before_conversion at line 1040, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::init_VERSION at line 2121, avg 0s/call
# once (0s+0s) by ExtUtils::MM_Any::_mymeta_from_meta at line 1499
# once (0s+0s) by ExtUtils::MM_Any::init_ABSTRACT at line 1735 | |||||
# spent 0s within ExtUtils::MM_Any::CORE:open_dir which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Any::_perl_header_files at line 2853, avg 0s/call | |||||
# spent 0s within ExtUtils::MM_Any::CORE:readdir which was called 3 times, avg 0s/call:
# 3 times (0s+0s) by ExtUtils::MM_Any::_perl_header_files at line 2857, avg 0s/call | |||||
# spent 0s within ExtUtils::MM_Any::CORE:regcomp which was called 336 times, avg 0s/call:
# 336 times (0s+0s) by ExtUtils::MM_Any::is_make_type at line 208, avg 0s/call | |||||
# spent 0s within ExtUtils::MM_Any::CORE:sort which was called 24 times, avg 0s/call:
# 6 times (0s+0s) by ExtUtils::MM_Any::manifypods_target at line 924, avg 0s/call
# 6 times (0s+0s) by ExtUtils::MM_Any::manifypods_target at line 910, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::clean at line 659, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::_perl_header_files at line 2857, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::clean at line 711, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::clean at line 710, avg 0s/call | |||||
# spent 0s within ExtUtils::MM_Any::CORE:subst which was called 1679 times, avg 0s/call:
# 672 times (0s+0s) by ExtUtils::MM_Any::make at line 571, avg 0s/call
# 672 times (0s+0s) by ExtUtils::MM_Any::make at line 574, avg 0s/call
# 210 times (0s+0s) by ExtUtils::MM_Any::escape_all_dollarsigns at line 532, avg 0s/call
# 82 times (0s+0s) by ExtUtils::MM_Any::escape_dollarsigns at line 514, avg 0s/call
# 15 times (0s+0s) by ExtUtils::MM_Any::_expand_macros at line 335, avg 0s/call
# 13 times (0s+0s) by ExtUtils::MM_Any::quote_dep at line 260, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::init_VERSION at line 2126, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::init_others at line 2272, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::init_VERSION at line 2135, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::init_VERSION at line 2127, avg 0s/call
# 3 times (0s+0s) by ExtUtils::MM_Any::init_others at line 2293, avg 0s/call | |||||
# spent 0s within ExtUtils::MM_Any::CORE:substcont which was called 30 times, avg 0s/call:
# 30 times (0s+0s) by ExtUtils::MM_Any::_expand_macros at line 335, avg 0s/call |