1*0Sstevel@tonic-gatepackage ExtUtils::MM_Cygwin;
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gateuse strict;
4*0Sstevel@tonic-gateuse vars qw($VERSION @ISA);
5*0Sstevel@tonic-gate
6*0Sstevel@tonic-gateuse Config;
7*0Sstevel@tonic-gateuse File::Spec;
8*0Sstevel@tonic-gate
9*0Sstevel@tonic-gaterequire ExtUtils::MM_Any;
10*0Sstevel@tonic-gaterequire ExtUtils::MM_Unix;
11*0Sstevel@tonic-gate@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
12*0Sstevel@tonic-gate
13*0Sstevel@tonic-gate$VERSION = 1.06;
14*0Sstevel@tonic-gate
15*0Sstevel@tonic-gate
16*0Sstevel@tonic-gate=head1 NAME
17*0Sstevel@tonic-gate
18*0Sstevel@tonic-gateExtUtils::MM_Cygwin - methods to override UN*X behaviour in ExtUtils::MakeMaker
19*0Sstevel@tonic-gate
20*0Sstevel@tonic-gate=head1 SYNOPSIS
21*0Sstevel@tonic-gate
22*0Sstevel@tonic-gate use ExtUtils::MM_Cygwin; # Done internally by ExtUtils::MakeMaker if needed
23*0Sstevel@tonic-gate
24*0Sstevel@tonic-gate=head1 DESCRIPTION
25*0Sstevel@tonic-gate
26*0Sstevel@tonic-gateSee ExtUtils::MM_Unix for a documentation of the methods provided there.
27*0Sstevel@tonic-gate
28*0Sstevel@tonic-gate=over 4
29*0Sstevel@tonic-gate
30*0Sstevel@tonic-gate=item os_flavor (o)
31*0Sstevel@tonic-gate
32*0Sstevel@tonic-gateWe're Unix and Cygwin.
33*0Sstevel@tonic-gate
34*0Sstevel@tonic-gate=cut
35*0Sstevel@tonic-gate
36*0Sstevel@tonic-gatesub os_flavor {
37*0Sstevel@tonic-gate    return('Unix', 'Cygwin');
38*0Sstevel@tonic-gate}
39*0Sstevel@tonic-gate
40*0Sstevel@tonic-gate=item cflags (o)
41*0Sstevel@tonic-gate
42*0Sstevel@tonic-gateif configured for dynamic loading, triggers #define EXT in EXTERN.h
43*0Sstevel@tonic-gate
44*0Sstevel@tonic-gate=cut
45*0Sstevel@tonic-gate
46*0Sstevel@tonic-gatesub cflags {
47*0Sstevel@tonic-gate    my($self,$libperl)=@_;
48*0Sstevel@tonic-gate    return $self->{CFLAGS} if $self->{CFLAGS};
49*0Sstevel@tonic-gate    return '' unless $self->needs_linking();
50*0Sstevel@tonic-gate
51*0Sstevel@tonic-gate    my $base = $self->SUPER::cflags($libperl);
52*0Sstevel@tonic-gate    foreach (split /\n/, $base) {
53*0Sstevel@tonic-gate        /^(\S*)\s*=\s*(\S*)$/ and $self->{$1} = $2;
54*0Sstevel@tonic-gate    };
55*0Sstevel@tonic-gate    $self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true');
56*0Sstevel@tonic-gate
57*0Sstevel@tonic-gate    return $self->{CFLAGS} = qq{
58*0Sstevel@tonic-gateCCFLAGS = $self->{CCFLAGS}
59*0Sstevel@tonic-gateOPTIMIZE = $self->{OPTIMIZE}
60*0Sstevel@tonic-gatePERLTYPE = $self->{PERLTYPE}
61*0Sstevel@tonic-gate};
62*0Sstevel@tonic-gate
63*0Sstevel@tonic-gate}
64*0Sstevel@tonic-gate
65*0Sstevel@tonic-gate
66*0Sstevel@tonic-gate=item replace_manpage_separator (o)
67*0Sstevel@tonic-gate
68*0Sstevel@tonic-gatereplaces strings '::' with '.' in MAN*POD man page names
69*0Sstevel@tonic-gate
70*0Sstevel@tonic-gate=cut
71*0Sstevel@tonic-gate
72*0Sstevel@tonic-gatesub replace_manpage_separator {
73*0Sstevel@tonic-gate    my($self, $man) = @_;
74*0Sstevel@tonic-gate    $man =~ s{/+}{.}g;
75*0Sstevel@tonic-gate    return $man;
76*0Sstevel@tonic-gate}
77*0Sstevel@tonic-gate
78*0Sstevel@tonic-gate=item init_linker
79*0Sstevel@tonic-gate
80*0Sstevel@tonic-gatepoints to libperl.a
81*0Sstevel@tonic-gate
82*0Sstevel@tonic-gate=cut
83*0Sstevel@tonic-gate
84*0Sstevel@tonic-gatesub init_linker {
85*0Sstevel@tonic-gate    my $self = shift;
86*0Sstevel@tonic-gate
87*0Sstevel@tonic-gate    if ($Config{useshrplib} eq 'true') {
88*0Sstevel@tonic-gate        my $libperl = '$(PERL_INC)' .'/'. "$Config{libperl}";
89*0Sstevel@tonic-gate        if( $] >= 5.007 ) {
90*0Sstevel@tonic-gate            $libperl =~ s/a$/dll.a/;
91*0Sstevel@tonic-gate        }
92*0Sstevel@tonic-gate        $self->{PERL_ARCHIVE} = $libperl;
93*0Sstevel@tonic-gate    } else {
94*0Sstevel@tonic-gate        $self->{PERL_ARCHIVE} =
95*0Sstevel@tonic-gate          '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a");
96*0Sstevel@tonic-gate    }
97*0Sstevel@tonic-gate
98*0Sstevel@tonic-gate    $self->{PERL_ARCHIVE_AFTER} ||= '';
99*0Sstevel@tonic-gate    $self->{EXPORT_LIST}  ||= '';
100*0Sstevel@tonic-gate}
101*0Sstevel@tonic-gate
102*0Sstevel@tonic-gate=back
103*0Sstevel@tonic-gate
104*0Sstevel@tonic-gate=cut
105*0Sstevel@tonic-gate
106*0Sstevel@tonic-gate1;
107