1 package ExtUtils::MM_Cygwin;
5 use ExtUtils::MakeMaker::Config;
8 require ExtUtils::MM_Unix;
9 require ExtUtils::MM_Win32;
10 our @ISA = qw( ExtUtils::MM_Unix );
12 our $VERSION = '6.58';
17 ExtUtils::MM_Cygwin - methods to override UN*X behaviour in ExtUtils::MakeMaker
21 use ExtUtils::MM_Cygwin; # Done internally by ExtUtils::MakeMaker if needed
25 See ExtUtils::MM_Unix for a documentation of the methods provided there.
31 We're Unix and Cygwin.
36 return('Unix', 'Cygwin');
41 if configured for dynamic loading, triggers #define EXT in EXTERN.h
46 my($self,$libperl)=@_;
47 return $self->{CFLAGS} if $self->{CFLAGS};
48 return '' unless $self->needs_linking();
50 my $base = $self->SUPER::cflags($libperl);
51 foreach (split /\n/, $base) {
52 /^(\S*)\s*=\s*(\S*)$/ and $self->{$1} = $2;
54 $self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true');
56 return $self->{CFLAGS} = qq{
57 CCFLAGS = $self->{CCFLAGS}
58 OPTIMIZE = $self->{OPTIMIZE}
59 PERLTYPE = $self->{PERLTYPE}
65 =item replace_manpage_separator
67 replaces strings '::' with '.' in MAN*POD man page names
71 sub replace_manpage_separator {
86 if ($Config{useshrplib} eq 'true') {
87 my $libperl = '$(PERL_INC)' .'/'. "$Config{libperl}";
88 if( $] >= 5.006002 ) {
89 $libperl =~ s/a$/dll.a/;
91 $self->{PERL_ARCHIVE} = $libperl;
93 $self->{PERL_ARCHIVE} =
94 '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a");
97 $self->{PERL_ARCHIVE_AFTER} ||= '';
98 $self->{EXPORT_LIST} ||= '';
103 If our path begins with F</cygdrive/> then we use C<ExtUtils::MM_Win32>
104 to determine if it may be a command. Otherwise we use the tests
105 from C<ExtUtils::MM_Unix>.
110 my ($self, $file) = @_;
112 if ($file =~ m{^/cygdrive/}i) {
113 return ExtUtils::MM_Win32->maybe_command($file);
116 return $self->SUPER::maybe_command($file);
121 Use the default to produce the *.dll's.
122 But for new archdir dll's use the same rebase address if the old exists.
127 my($self, %attribs) = @_;
128 my $s = ExtUtils::MM_Unix::dynamic_lib($self, %attribs);
129 my $ori = "$self->{INSTALLARCHLIB}/auto/$self->{FULLEXT}/$self->{BASEEXT}.$self->{DLEXT}";
131 my $imagebase = `/bin/objdump -p $ori | /bin/grep ImageBase | /bin/cut -c12-`;
133 if ($imagebase gt "40000000") {
134 my $LDDLFLAGS = $self->{LDDLFLAGS};
135 $LDDLFLAGS =~ s/-Wl,--enable-auto-image-base/-Wl,--image-base=0x$imagebase/;
136 $s =~ s/ \$\(LDDLFLAGS\) / $LDDLFLAGS /m;
149 ExtUtils::MM_Unix::all_target(shift);