line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Install::Compiler; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1555
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
5
|
use File::Basename (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
13
|
|
5
|
1
|
|
|
1
|
|
20
|
use Module::Install::Base (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use vars qw{$VERSION @ISA $ISCORE}; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
69
|
|
8
|
|
|
|
|
|
|
BEGIN { |
9
|
1
|
|
|
1
|
|
3
|
$VERSION = '1.21'; |
10
|
1
|
|
|
|
|
17
|
@ISA = 'Module::Install::Base'; |
11
|
1
|
|
|
|
|
409
|
$ISCORE = 1; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub ppport { |
15
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
16
|
0
|
0
|
|
|
|
|
if ( $self->is_admin ) { |
17
|
0
|
|
|
|
|
|
return $self->admin->ppport(@_); |
18
|
|
|
|
|
|
|
} else { |
19
|
|
|
|
|
|
|
# Fallback to just a check |
20
|
0
|
|
0
|
|
|
|
my $file = shift || 'ppport.h'; |
21
|
0
|
0
|
|
|
|
|
unless ( -f $file ) { |
22
|
0
|
|
|
|
|
|
die "Packaging error, $file is missing"; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub cc_files { |
28
|
0
|
|
|
0
|
0
|
|
require Config; |
29
|
0
|
|
|
|
|
|
my $self = shift; |
30
|
|
|
|
|
|
|
$self->makemaker_args( |
31
|
0
|
|
|
|
|
|
OBJECT => join ' ', map { substr($_, 0, -2) . $Config::Config{_o} } @_ |
|
0
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub cc_inc_paths { |
36
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
37
|
|
|
|
|
|
|
$self->makemaker_args( |
38
|
0
|
|
|
|
|
|
INC => join ' ', map { "-I$_" } @_ |
|
0
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub cc_lib_paths { |
43
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
44
|
|
|
|
|
|
|
$self->makemaker_args( |
45
|
0
|
|
|
|
|
|
LIBS => join ' ', map { "-L$_" } @_ |
|
0
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub cc_lib_links { |
50
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
51
|
|
|
|
|
|
|
$self->makemaker_args( |
52
|
0
|
|
|
|
|
|
LIBS => join ' ', $self->makemaker_args->{LIBS}, map { "-l$_" } @_ |
|
0
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub cc_optimize_flags { |
57
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
58
|
0
|
|
|
|
|
|
$self->makemaker_args( |
59
|
|
|
|
|
|
|
OPTIMIZE => join ' ', @_ |
60
|
|
|
|
|
|
|
); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=pod |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 NAME |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Module::Install::Compiler - Commands for interacting with the C compiler |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SYNOPSIS |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
To be completed |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 DESCRIPTION |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Many Perl modules that contains C and XS code have fiendishly complex |
80
|
|
|
|
|
|
|
F<Makefile.PL> files, because L<ExtUtils::MakeMaker> doesn't itself provide |
81
|
|
|
|
|
|
|
a huge amount of assistance and automation in this area. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
B<Module::Install::Compiler> provides a number of commands that take care |
84
|
|
|
|
|
|
|
of common utility tasks, and try to take some of intricacy out of creating |
85
|
|
|
|
|
|
|
C and XS modules. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 COMMANDS |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
To be completed |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 TO DO |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
The current implementation is relatively fragile and minimalistic. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
It only handles some very basic wrapper around L<ExtUtils::MakeMaker>. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
It is currently undergoing extensive refactoring to provide a more |
98
|
|
|
|
|
|
|
generic compiler flag generation capability. This may take some time, |
99
|
|
|
|
|
|
|
and if anyone who maintains a Perl module that makes use of the compiler |
100
|
|
|
|
|
|
|
would like to help out, your assistance would be greatly appreciated. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 SEE ALSO |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
L<Module::Install>, L<ExtUtils::MakeMaker> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 AUTHORS |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Refactored by Adam Kennedy E<lt>adamk@cpan.orgE<gt> |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Mostly by Audrey Tang E<lt>autrijus@autrijus.orgE<gt> |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Based on original works by Brian Ingerson E<lt>ingy@cpan.orgE<gt> |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 COPYRIGHT |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Copyright 2002, 2003, 2004, 2006 by Adam Kennedy, Audrey Tang, Brian Ingerson. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
119
|
|
|
|
|
|
|
under the same terms as Perl itself. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
See L<http://www.perl.com/perl/misc/Artistic.html> |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |