ExtUtils::MakeMaker 6.03 -> 6.06_05ish
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / MM_Cygwin.pm
CommitLineData
f89d6eaa 1package ExtUtils::MM_Cygwin;
2
b75c8c73 3use strict;
f6d6199c 4use vars qw($VERSION @ISA);
b75c8c73 5
f89d6eaa 6use Config;
ecf68df6 7use File::Spec;
8
f6d6199c 9require ExtUtils::MM_Any;
10require ExtUtils::MM_Unix;
11@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
f89d6eaa 12
479d2113 13$VERSION = 1.05;
14
15
16=head1 NAME
17
18ExtUtils::MM_Cygwin - methods to override UN*X behaviour in ExtUtils::MakeMaker
19
20=head1 SYNOPSIS
21
22 use ExtUtils::MM_Cygwin; # Done internally by ExtUtils::MakeMaker if needed
23
24=head1 DESCRIPTION
25
26See ExtUtils::MM_Unix for a documentation of the methods provided there.
27
28=over 4
29
30=item cflags (o)
31
32if configured for dynamic loading, triggers #define EXT in EXTERN.h
33
34=cut
f89d6eaa 35
36sub cflags {
37 my($self,$libperl)=@_;
38 return $self->{CFLAGS} if $self->{CFLAGS};
e0678a30 39 return '' unless $self->needs_linking();
f6d6199c 40
41 my $base = $self->SUPER::cflags($libperl);
f89d6eaa 42 foreach (split /\n/, $base) {
45bc4d3a 43 /^(\S*)\s*=\s*(\S*)$/ and $self->{$1} = $2;
f89d6eaa 44 };
45 $self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true');
f89d6eaa 46
47 return $self->{CFLAGS} = qq{
48CCFLAGS = $self->{CCFLAGS}
49OPTIMIZE = $self->{OPTIMIZE}
50PERLTYPE = $self->{PERLTYPE}
f89d6eaa 51};
52
53}
54
f89d6eaa 55
479d2113 56=item replace_manpage_separator (o)
f89d6eaa 57
479d2113 58replaces strings '::' with '.' in MAN*POD man page names
59
60=cut
61
62sub replace_manpage_separator {
63 my($self, $man) = @_;
64 $man =~ s{/+}{.}g;
65 return $man;
f89d6eaa 66}
67
479d2113 68=item init_linker
69
70points to libperl.a
71
72=cut
73
74sub init_linker {
75 my $self = shift;
76
f6d6199c 77 if ($Config{useshrplib} eq 'true') {
78 my $libperl = '$(PERL_INC)' .'/'. "$Config{libperl}";
a884ca7c 79 if( $] >= 5.007 ) {
80 $libperl =~ s/a$/dll.a/;
81 }
479d2113 82 $self->{PERL_ARCHIVE} = $libperl;
f6d6199c 83 } else {
479d2113 84 $self->{PERL_ARCHIVE} =
85 '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a");
f6d6199c 86 }
f89d6eaa 87
479d2113 88 $self->{PERL_ARCHIVE_AFTER} ||= '';
89 $self->{EXPORT_LIST} ||= '';
90}
1cab015a 91
92=back
93
94=cut
95
479d2113 961;