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