X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FExtUtils%2FMM_Cygwin.pm;h=adb8d42047a576c612d156f8c47b2e1c0e158dbf;hb=907ce46c268395662feb0d30bc31726b9dbce916;hp=01928366e0f4d76cd99feb03f8b24e9cb6d43b6e;hpb=80a5d8e74b5512d4ab704d0e83466ae41247ce55;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/ExtUtils/MM_Cygwin.pm b/lib/ExtUtils/MM_Cygwin.pm index 0192836..adb8d42 100644 --- a/lib/ExtUtils/MM_Cygwin.pm +++ b/lib/ExtUtils/MM_Cygwin.pm @@ -3,14 +3,45 @@ package ExtUtils::MM_Cygwin; use strict; use vars qw($VERSION @ISA); -use Config; +use ExtUtils::MakeMaker::Config; use File::Spec; require ExtUtils::MM_Any; require ExtUtils::MM_Unix; @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix ); -$VERSION = 1.02_01; +$VERSION = '1.08'; + + +=head1 NAME + +ExtUtils::MM_Cygwin - methods to override UN*X behaviour in ExtUtils::MakeMaker + +=head1 SYNOPSIS + + use ExtUtils::MM_Cygwin; # Done internally by ExtUtils::MakeMaker if needed + +=head1 DESCRIPTION + +See ExtUtils::MM_Unix for a documentation of the methods provided there. + +=over 4 + +=item os_flavor + +We're Unix and Cygwin. + +=cut + +sub os_flavor { + return('Unix', 'Cygwin'); +} + +=item cflags + +if configured for dynamic loading, triggers #define EXT in EXTERN.h + +=cut sub cflags { my($self,$libperl)=@_; @@ -19,7 +50,7 @@ sub cflags { my $base = $self->SUPER::cflags($libperl); foreach (split /\n/, $base) { - / *= */ and $self->{$`} = $'; + /^(\S*)\s*=\s*(\S*)$/ and $self->{$1} = $2; }; $self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true'); @@ -27,101 +58,49 @@ sub cflags { CCFLAGS = $self->{CCFLAGS} OPTIMIZE = $self->{OPTIMIZE} PERLTYPE = $self->{PERLTYPE} -LARGE = $self->{LARGE} -SPLIT = $self->{SPLIT} }; } -sub manifypods { - my($self, %attribs) = @_; - return "\nmanifypods : pure_all\n\t$self->{NOECHO}\$(NOOP)\n" unless - %{$self->{MAN3PODS}} or %{$self->{MAN1PODS}}; - my($dist); - my($pod2man_exe); - if (defined $self->{PERL_SRC}) { - $pod2man_exe = File::Spec->catfile($self->{PERL_SRC},'pod','pod2man'); - } else { - $pod2man_exe = File::Spec->catfile($Config{scriptdirexp},'pod2man'); - } - unless ($self->perl_script($pod2man_exe)) { - # No pod2man but some MAN3PODS to be installed - print <{MAKEFILE}, q[";' \\ --e 'print "Manifying $$m{$$_}\n"; $$m{$$_} =~ s/::/./g;' \\ --e 'system(qq[$(PERLRUN) $(POD2MAN_EXE) ].qq[$$_>$$m{$$_}])==0 or warn "Couldn\\047t install $$m{$$_}\n";' \\ --e 'chmod(oct($(PERM_RW))), $$m{$$_} or warn "chmod $(PERM_RW) $$m{$$_}: $$!\n";}' -]; - push @m, "\nmanifypods : pure_all "; - push @m, join " \\\n\t", keys %{$self->{MAN1PODS}}, - keys %{$self->{MAN3PODS}}; - - push(@m,"\n"); - if (%{$self->{MAN1PODS}} || %{$self->{MAN3PODS}}) { - grep { $self->{MAN1PODS}{$_} =~ s/::/./g } keys %{$self->{MAN1PODS}}; - grep { $self->{MAN3PODS}{$_} =~ s/::/./g } keys %{$self->{MAN3PODS}}; - push @m, "\t$self->{NOECHO}\$(POD2MAN) \\\n\t"; - push @m, join " \\\n\t", %{$self->{MAN1PODS}}, %{$self->{MAN3PODS}}; - } - join('', @m); -} +replaces strings '::' with '.' in MAN*POD man page names -sub perl_archive { - if ($Config{useshrplib} eq 'true') { - my $libperl = '$(PERL_INC)' .'/'. "$Config{libperl}"; - $libperl =~ s/a$/dll.a/; - return $libperl; - } else { - return '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a"); - } -} - -1; -__END__ - -=head1 NAME - -ExtUtils::MM_Cygwin - methods to override UN*X behaviour in ExtUtils::MakeMaker - -=head1 SYNOPSIS - - use ExtUtils::MM_Cygwin; # Done internally by ExtUtils::MakeMaker if needed - -=head1 DESCRIPTION - -See ExtUtils::MM_Unix for a documentation of the methods provided there. - -=over 4 - -=item canonpath +=cut -replaces backslashes with forward ones. then acts as *nixish. +sub replace_manpage_separator { + my($self, $man) = @_; + $man =~ s{/+}{.}g; + return $man; +} -=item cflags +=item init_linker -if configured for dynamic loading, triggers #define EXT in EXTERN.h +points to libperl.a -=item manifypods +=cut -replaces strings '::' with '.' in man page names +sub init_linker { + my $self = shift; -=item perl_archive + if ($Config{useshrplib} eq 'true') { + my $libperl = '$(PERL_INC)' .'/'. "$Config{libperl}"; + if( $] >= 5.006002 ) { + $libperl =~ s/a$/dll.a/; + } + $self->{PERL_ARCHIVE} = $libperl; + } else { + $self->{PERL_ARCHIVE} = + '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a"); + } -points to libperl.a + $self->{PERL_ARCHIVE_AFTER} ||= ''; + $self->{EXPORT_LIST} ||= ''; +} =back =cut +1;