| 1 | package ExtUtils::MM_Cygwin; |
| 2 | |
| 3 | use strict; |
| 4 | use vars qw($VERSION @ISA); |
| 5 | |
| 6 | use ExtUtils::MakeMaker::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.08'; |
| 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 os_flavor |
| 31 | |
| 32 | We're Unix and Cygwin. |
| 33 | |
| 34 | =cut |
| 35 | |
| 36 | sub os_flavor { |
| 37 | return('Unix', 'Cygwin'); |
| 38 | } |
| 39 | |
| 40 | =item cflags |
| 41 | |
| 42 | if configured for dynamic loading, triggers #define EXT in EXTERN.h |
| 43 | |
| 44 | =cut |
| 45 | |
| 46 | sub cflags { |
| 47 | my($self,$libperl)=@_; |
| 48 | return $self->{CFLAGS} if $self->{CFLAGS}; |
| 49 | return '' unless $self->needs_linking(); |
| 50 | |
| 51 | my $base = $self->SUPER::cflags($libperl); |
| 52 | foreach (split /\n/, $base) { |
| 53 | /^(\S*)\s*=\s*(\S*)$/ and $self->{$1} = $2; |
| 54 | }; |
| 55 | $self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true'); |
| 56 | |
| 57 | return $self->{CFLAGS} = qq{ |
| 58 | CCFLAGS = $self->{CCFLAGS} |
| 59 | OPTIMIZE = $self->{OPTIMIZE} |
| 60 | PERLTYPE = $self->{PERLTYPE} |
| 61 | }; |
| 62 | |
| 63 | } |
| 64 | |
| 65 | |
| 66 | =item replace_manpage_separator |
| 67 | |
| 68 | replaces strings '::' with '.' in MAN*POD man page names |
| 69 | |
| 70 | =cut |
| 71 | |
| 72 | sub replace_manpage_separator { |
| 73 | my($self, $man) = @_; |
| 74 | $man =~ s{/+}{.}g; |
| 75 | return $man; |
| 76 | } |
| 77 | |
| 78 | =item init_linker |
| 79 | |
| 80 | points to libperl.a |
| 81 | |
| 82 | =cut |
| 83 | |
| 84 | sub init_linker { |
| 85 | my $self = shift; |
| 86 | |
| 87 | if ($Config{useshrplib} eq 'true') { |
| 88 | my $libperl = '$(PERL_INC)' .'/'. "$Config{libperl}"; |
| 89 | if( $] >= 5.006002 ) { |
| 90 | $libperl =~ s/a$/dll.a/; |
| 91 | } |
| 92 | $self->{PERL_ARCHIVE} = $libperl; |
| 93 | } else { |
| 94 | $self->{PERL_ARCHIVE} = |
| 95 | '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a"); |
| 96 | } |
| 97 | |
| 98 | $self->{PERL_ARCHIVE_AFTER} ||= ''; |
| 99 | $self->{EXPORT_LIST} ||= ''; |
| 100 | } |
| 101 | |
| 102 | =back |
| 103 | |
| 104 | =cut |
| 105 | |
| 106 | 1; |