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