MM & Encode fixes
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / MM_Cygwin.pm
index a5ba410..3d72aec 100644 (file)
@@ -1,25 +1,22 @@
 package ExtUtils::MM_Cygwin;
 
-use Config;
-#use Cwd;
-#use File::Basename;
-require Exporter;
+use strict;
+use vars qw($VERSION @ISA);
 
-Exporter::import('ExtUtils::MakeMaker',
-       qw( $Verbose &neatvalue));
+use Config;
+use File::Spec;
 
-unshift @MM::ISA, 'ExtUtils::MM_Cygwin';
+require ExtUtils::MM_Any;
+require ExtUtils::MM_Unix;
+@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
 
-sub canonpath {
-    my($self,$path) = @_;
-    $path =~ s|\\|/|g;
-    return $self->ExtUtils::MM_Unix::canonpath($path);
-}
+$VERSION = 1.01_01;
 
 sub cflags {
     my($self,$libperl)=@_;
     return $self->{CFLAGS} if $self->{CFLAGS};
-    my $base =$self->ExtUtils::MM_Unix::cflags($libperl);
+
+    my $base = $self->SUPER::cflags($libperl);
     foreach (split /\n/, $base) {
       / *= */ and $self->{$`} = $';
     };
@@ -42,9 +39,9 @@ sub manifypods {
     my($dist);
     my($pod2man_exe);
     if (defined $self->{PERL_SRC}) {
-        $pod2man_exe = $self->catfile($self->{PERL_SRC},'pod','pod2man');
+        $pod2man_exe = File::Spec->catfile($self->{PERL_SRC},'pod','pod2man');
     } else {
-        $pod2man_exe = $self->catfile($Config{scriptdirexp},'pod2man');
+        $pod2man_exe = File::Spec->catfile($Config{scriptdirexp},'pod2man');
     }
     unless ($self->perl_script($pod2man_exe)) {
         # No pod2man but some MAN3PODS to be installed
@@ -56,30 +53,38 @@ Warning: I could not locate your pod2man program. Please make sure,
 END
         $pod2man_exe = "-S pod2man";
     }
-    my(@m);
+    my(@m) = ();
     push @m,
 qq[POD2MAN_EXE = $pod2man_exe\n],
 qq[POD2MAN = \$(PERL) -we '%m=\@ARGV;for (keys %m){' \\\n],
 q[-e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "],
  $self->{MAKEFILE}, q[";' \\
 -e 'print "Manifying $$m{$$_}\n"; $$m{$$_} =~ s/::/./g;' \\
--e 'system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2MAN_EXE) ].qq[$$_>$$m{$$_}])==0 or warn "Couldn\\047t install $$m{$$_}\n";' \\
+-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, 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);
 }
 
-sub perl_archive
-{
- return '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a");
+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;
@@ -97,7 +102,7 @@ ExtUtils::MM_Cygwin - methods to override UN*X behaviour in ExtUtils::MakeMaker
 
 See ExtUtils::MM_Unix for a documentation of the methods provided there.
 
-=over
+=over 4
 
 =item canonpath