This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don't try to export symbols that don't exist
[perl5.git] / lib / ExtUtils / MM_Cygwin.pm
CommitLineData
f89d6eaa
FE
1package ExtUtils::MM_Cygwin;
2
b75c8c73 3use strict;
f6d6199c 4use vars qw($VERSION @ISA);
b75c8c73 5
f89d6eaa 6use Config;
ecf68df6
DR
7use File::Spec;
8
f6d6199c
MS
9require ExtUtils::MM_Any;
10require ExtUtils::MM_Unix;
11@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
f89d6eaa 12
a7d1454b 13$VERSION = 1.07;
479d2113
MS
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
dedf98bc
MS
30=item os_flavor (o)
31
32We're Unix and Cygwin.
33
34=cut
35
36sub os_flavor {
37 return('Unix', 'Cygwin');
38}
39
479d2113
MS
40=item cflags (o)
41
42if configured for dynamic loading, triggers #define EXT in EXTERN.h
43
44=cut
f89d6eaa
FE
45
46sub cflags {
47 my($self,$libperl)=@_;
48 return $self->{CFLAGS} if $self->{CFLAGS};
e0678a30 49 return '' unless $self->needs_linking();
f6d6199c
MS
50
51 my $base = $self->SUPER::cflags($libperl);
f89d6eaa 52 foreach (split /\n/, $base) {
45bc4d3a 53 /^(\S*)\s*=\s*(\S*)$/ and $self->{$1} = $2;
f89d6eaa
FE
54 };
55 $self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true');
f89d6eaa
FE
56
57 return $self->{CFLAGS} = qq{
58CCFLAGS = $self->{CCFLAGS}
59OPTIMIZE = $self->{OPTIMIZE}
60PERLTYPE = $self->{PERLTYPE}
f89d6eaa
FE
61};
62
63}
64
f89d6eaa 65
479d2113 66=item replace_manpage_separator (o)
f89d6eaa 67
479d2113
MS
68replaces strings '::' with '.' in MAN*POD man page names
69
70=cut
71
72sub replace_manpage_separator {
73 my($self, $man) = @_;
74 $man =~ s{/+}{.}g;
75 return $man;
f89d6eaa
FE
76}
77
479d2113
MS
78=item init_linker
79
80points to libperl.a
81
82=cut
83
84sub init_linker {
85 my $self = shift;
86
f6d6199c
MS
87 if ($Config{useshrplib} eq 'true') {
88 my $libperl = '$(PERL_INC)' .'/'. "$Config{libperl}";
a7d1454b 89 if( $] >= 5.006002 ) {
a884ca7c
MS
90 $libperl =~ s/a$/dll.a/;
91 }
479d2113 92 $self->{PERL_ARCHIVE} = $libperl;
f6d6199c 93 } else {
479d2113
MS
94 $self->{PERL_ARCHIVE} =
95 '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a");
f6d6199c 96 }
f89d6eaa 97
479d2113
MS
98 $self->{PERL_ARCHIVE_AFTER} ||= '';
99 $self->{EXPORT_LIST} ||= '';
100}
1cab015a
FE
101
102=back
103
104=cut
105
479d2113 1061;