Commit | Line | Data |
---|---|---|
f89d6eaa | 1 | package ExtUtils::MM_Cygwin; |
2 | ||
b75c8c73 | 3 | use strict; |
f6d6199c | 4 | use vars qw($VERSION @ISA); |
b75c8c73 | 5 | |
f89d6eaa | 6 | use Config; |
ecf68df6 | 7 | use File::Spec; |
8 | ||
f6d6199c | 9 | require ExtUtils::MM_Any; |
10 | require 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 | ||
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 | |
f89d6eaa | 35 | |
36 | sub 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{ | |
48 | CCFLAGS = $self->{CCFLAGS} | |
49 | OPTIMIZE = $self->{OPTIMIZE} | |
50 | PERLTYPE = $self->{PERLTYPE} | |
f89d6eaa | 51 | }; |
52 | ||
53 | } | |
54 | ||
f89d6eaa | 55 | |
479d2113 | 56 | =item replace_manpage_separator (o) |
f89d6eaa | 57 | |
479d2113 | 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; | |
f89d6eaa | 66 | } |
67 | ||
479d2113 | 68 | =item init_linker |
69 | ||
70 | points to libperl.a | |
71 | ||
72 | =cut | |
73 | ||
74 | sub 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 | 96 | 1; |