diff -u -r ExtUtils-MakeMaker-6.05.orig/lib/ExtUtils/Command/MM.pm ExtUtils-MakeMaker-6.05/lib/ExtUtils/Command/MM.pm
--- ExtUtils-MakeMaker-6.05.orig/lib/ExtUtils/Command/MM.pm	Tue Nov 12 13:26:35 2002
+++ ExtUtils-MakeMaker-6.05/lib/ExtUtils/Command/MM.pm	Tue Nov 12 13:33:17 2002
@@ -7,7 +7,7 @@
 use vars qw($VERSION @ISA @EXPORT);
 @ISA = qw(Exporter);
 
-@EXPORT = qw(test_harness);
+@EXPORT  = qw(test_harness pod2man);
 $VERSION = '0.01';
 
 =head1 NAME
@@ -16,7 +16,7 @@
 
 =head1 SYNOPSIS
 
-  perl -MExtUtils::Command::MM -e "function" files...
+  perl -MExtUtils::Command::MM -e "function" -- arguments...
 
 
 =head1 DESCRIPTION
@@ -53,6 +53,68 @@
     unshift @INC, map { File::Spec->rel2abs($_) } @_;
     Test::Harness::runtests(sort { lc $a cmp lc $b } @ARGV);
 }
+
+
+
+=item B<pod2man>
+
+  pod2man( '--option'   => 'value', ...
+           'pod_infile' => 'man_outfile', ... )
+
+Creates a new Pod::Man object and parses all <pod_infiles>, converting
+pod pages to man pages.  All B<options> are stripped of their '--', and
+passed to Pod::Man->new().  Consider passing at least '--section'.
+
+If '--perm_rw' option is set, does a chmod for each man page generated.
+
+=cut
+
+#Adapted from ExtUtils::MM_Unix::manifypods() by spurkis.
+#Idea to use Pod::Man & bung it in Command::MM by M. Schwern
+
+sub pod2man {
+    require Pod::Man;
+
+    my %files   = @_;
+    my %options = ();
+
+    # move '--option' and '-option' entries from files to options:
+    for my $opt (grep /^--\w+$/, keys(%files)) {
+	my $clean_opt        = $opt;
+	$clean_opt           =~ s/^-+//;
+	$options{$clean_opt} = delete $files{$opt};
+    }
+
+    # do nothing if no files to process
+    return unless(keys %files);
+
+    print "Manifying section ", $options{section} || "[unknown]", " pods:\n";
+
+    my $parser = new Pod::Man(%options);
+
+    foreach my $infile (keys %files) {
+	my $outfile = $files{$infile};
+
+	next if ((-e $outfile) &&
+		 (-M $outfile < -M $infile) &&
+		 (-M $outfile < -M "Makefile"));
+
+	print "  +  $outfile";
+
+	$parser->parse_from_file($infile, $outfile)
+	  or (warn("Could not install $outfile\n") and next);
+
+	if ($options{perm_rw}) {
+	    chmod(oct($options{perm_rw}), $outfile)
+	      or (warn("chmod $options{perm_rw} $outfile: $!\n") and next);
+	}
+
+	print "\n";
+    }
+
+    return 1;
+}
+
 
 =back
 
diff -u -r ExtUtils-MakeMaker-6.05.orig/lib/ExtUtils/MM_Unix.pm ExtUtils-MakeMaker-6.05/lib/ExtUtils/MM_Unix.pm
--- ExtUtils-MakeMaker-6.05.orig/lib/ExtUtils/MM_Unix.pm	Tue Nov 12 13:26:35 2002
+++ ExtUtils-MakeMaker-6.05/lib/ExtUtils/MM_Unix.pm	Tue Nov 12 13:45:13 2002
@@ -6,11 +6,11 @@
 
 use Exporter ();
 use Carp;
-use Config;
+use Config         qw(%Config);
 use File::Basename qw(basename dirname fileparse);
 use File::Spec;
 use DirHandle;
-use strict;
+
 use vars qw($VERSION @ISA
             $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Dos $Is_VOS
             $Verbose %pm %static $Xsubpp_Version
@@ -2739,50 +2739,75 @@
 =cut
 
 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 ($pod2man_exe = $self->perl_script($pod2man_exe)) {
-      # Maybe a build by uninstalled Perl?
-      $pod2man_exe = File::Spec->catfile($self->{PERL_INC}, "pod", "pod2man");
-    }
-    unless ($pod2man_exe = $self->perl_script($pod2man_exe)) {
-	# No pod2man but some MAN3PODS to be installed
-	print <<END;
+    my $self    = shift;
+    my $targets = '';
+
+    return "\nmanifypods : pure_all\n\t$self->{NOECHO}\$(NOOP)\n"
+      unless ( %{$self->{MAN3PODS}} or %{$self->{MAN1PODS}} );
 
-Warning: I could not locate your pod2man program. Please make sure,
-         your pod2man program is in your PATH before you execute 'make'
+    $targets .= $self->manifypods_target;
+
+    return $targets;
+}
 
-END
-        $pod2man_exe = "-S pod2man";
+
+#
+# Returns a 'manifypods' make target to convert documents
+# containing POD into man pages.
+#
+sub manifypods_target {
+    my $self          = shift;
+    my $man1pods      = '';
+    my $man3pods      = '';
+    my $dependencies  = '';
+
+    # populate manXpods & dependencies:
+    foreach my $name (keys %{$self->{MAN1PODS}}) {
+	$man1pods     .= " \\\n\t  $name \\\n\t    $self->{MAN1PODS}->{$name}";
+	$dependencies .= " \\\n\t$name";
     }
-    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";' \\
--e 'system(q[$(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}}) {
-	push @m, "\t$self->{NOECHO}\$(POD2MAN) \\\n\t";
-	push @m, join " \\\n\t", %{$self->{MAN1PODS}}, %{$self->{MAN3PODS}};
+
+    foreach my $name (keys %{$self->{MAN3PODS}}) {
+	$man3pods     .= " \\\n\t  $name \\\n\t    $self->{MAN3PODS}->{$name}";
+	$dependencies .= " \\\n\t$name"
     }
-    join('', @m);
+
+    # generate target:
+    my $POD2MAN_def = $self->pod2man_def();
+    my $NOECHO      = $self->{NOECHO};
+    my $target      = <<END_OF_TARGET;
+
+# --- Begin manifypods section:
+$POD2MAN_def
+
+manifypods : pure_all $dependencies
+	$NOECHO\$(POD2MAN) --section 1 --perm_rw "\$(PERM_RW)" $man1pods
+	$NOECHO\$(POD2MAN) --section 3 --perm_rw "\$(PERM_RW)" $man3pods
+
+# --- End manifypods section --- #
+
+END_OF_TARGET
+
+    return $target;
+}
+
+
+#
+# Returns a definition of the POD2MAN make variable that is used like this:
+#
+#    $(POD2MAN) [--section <man_section> --perm_rw $(PERM_RW)]
+#               <infile> <outfile> [ <infile> <outfile> ... ]
+#
+# See ExtUtils::Command::MM for more details on available options.
+#
+sub pod2man_def {
+    my $self = shift;
+    return <<'END_OF_DEF';
+# need the trailing '--' so perl stops gobbling arguments
+POD2MAN = $(PERL) "-MExtUtils::Command::MM" -e "pod2man @ARGV" --
+END_OF_DEF
 }
+
 
 =item maybe_command
 
