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