document 'test' attribute (from Andreas Koenig)
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / MM_Unix.pm
index 941a792..8d09668 100644 (file)
@@ -8,7 +8,7 @@ use strict;
 use vars qw($VERSION $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Dos $Is_PERL_OBJECT
            $Verbose %pm %static $Xsubpp_Version);
 
-$VERSION = substr q$Revision: 1.12601 $, 10;
+$VERSION = substr q$Revision: 1.12602 $, 10;
 # $Id: MM_Unix.pm,v 1.126 1998/06/28 21:32:49 k Exp k $
 
 Exporter::import('ExtUtils::MakeMaker',
@@ -377,7 +377,7 @@ sub cflags {
 
     if ($self->{CAPI} && $Is_PERL_OBJECT) {
         $self->{CCFLAGS} =~ s/-DPERL_OBJECT(\s|$)//;
-        $self->{CCFLAGS} .= '-DPERL_CAPI';
+        $self->{CCFLAGS} .= ' -DPERL_CAPI ';
         if ($Is_Win32 && $Config{'cc'} =~ /^cl.exe/i) {
             # Turn off C++ mode of the MSC compiler
             $self->{CCFLAGS} =~ s/-TP(\s|$)//;
@@ -819,7 +819,7 @@ ci :
 
 =item dist_core (o)
 
-Defeines the targets dist, tardist, zipdist, uutardist, shdist
+Defines the targets dist, tardist, zipdist, uutardist, shdist
 
 =cut
 
@@ -1320,10 +1320,12 @@ sub init_dirscan {      # --- File and Directory Lists (.xs .pm .pod etc)
            $h{$name} = 1;
        } elsif ($name =~ /\.PL$/) {
            ($pl_files{$name} = $name) =~ s/\.PL$// ;
-       } elsif ($Is_VMS && $name =~ /\.pl$/) {  # case-insensitive filesystem
+       } elsif ($Is_VMS && $name =~ /[._]pl$/i) {
+           # case-insensitive filesystem, one dot per name, so foo.h.PL
+           # under Unix appears as foo.h_pl under VMS
            local($/); open(PL,$name); my $txt = <PL>; close PL;
            if ($txt =~ /Extracting \S+ \(with variable substitutions/) {
-               ($pl_files{$name} = $name) =~ s/\.pl$// ;
+               ($pl_files{$name} = $name) =~ s/[._]pl$//i ;
            }
            else { $pm{$name} = $self->catfile('$(INST_LIBDIR)',$name); }
        } elsif ($name =~ /\.(p[ml]|pod)$/){
@@ -2350,7 +2352,7 @@ $tmp/perlmain\$(OBJ_EXT): $tmp/perlmain.c
 $tmp/perlmain.c: $makefilename}, q{
        }.$self->{NOECHO}.q{echo Writing $@
        }.$self->{NOECHO}.q{$(PERL) $(MAP_PERLINC) -MExtUtils::Miniperl \\
-               -e "writemain(grep s#.*/auto/##, qw|$(MAP_STATIC)|)" > $@t && $(MV) $@t $@
+               -e "writemain(grep s#.*/auto/##, split(q| |, q|$(MAP_STATIC)|))" > $@t && $(MV) $@t $@
 
 };
     push @m, "\t",$self->{NOECHO}.q{$(PERL) $(INSTALLSCRIPT)/fixpmain
@@ -2749,10 +2751,13 @@ sub ppd {
     push(@m, "\t\@\$(PERL) -e \"print qq{<SOFTPKG NAME=\\\"$self->{DISTNAME}\\\" VERSION=\\\"$pack_ver\\\">\\n}");
     push(@m, ". qq{\\t<TITLE>$self->{DISTNAME}</TITLE>\\n}");
     my $abstract = $self->{ABSTRACT};
+    $abstract =~ s/\n/\\n/sg;
     $abstract =~ s/</&lt;/g;
     $abstract =~ s/>/&gt;/g;
     push(@m, ". qq{\\t<ABSTRACT>$abstract</ABSTRACT>\\n}");
     my ($author) = $self->{AUTHOR};
+    $author =~ s/</&lt;/g;
+    $author =~ s/>/&gt;/g;
     $author =~ s/@/\\@/g;
     push(@m, ". qq{\\t<AUTHOR>$author</AUTHOR>\\n}");
     push(@m, ". qq{\\t<IMPLEMENTATION>\\n}");
@@ -2760,9 +2765,11 @@ sub ppd {
     foreach $prereq (sort keys %{$self->{PREREQ_PM}}) {
         my $pre_req = $prereq;
         $pre_req =~ s/::/-/g;
-        push(@m, ". qq{\\t\\t<DEPENDENCY NAME=\\\"$pre_req\\\" />\\n}");
+        my ($dep_ver) = join ",", (split (/\./, $self->{PREREQ_PM}{$prereq}), (0) x 4) [0 .. 3];
+        push(@m, ". qq{\\t\\t<DEPENDENCY NAME=\\\"$pre_req\\\" VERSION=\\\"$dep_ver\\\" />\\n}");
     }
     push(@m, ". qq{\\t\\t<OS NAME=\\\"\$(OSNAME)\\\" />\\n}");
+    push(@m, ". qq{\\t\\t<ARCHITECTURE NAME=\\\"$Config{'archname'}\\\" />\\n}");
     my ($bin_location) = $self->{BINARY_LOCATION};
     $bin_location =~ s/\\/\\\\/g;
     if ($self->{PPM_INSTALL_SCRIPT}) {
@@ -2786,7 +2793,7 @@ Returns the attribute C<PERM_RW> or the string C<644>.
 Used as the string that is passed
 to the C<chmod> command to set the permissions for read/writeable files.
 MakeMaker chooses C<644> because it has turned out in the past that
-relying on the umask provokes hard-to-track bugreports.
+relying on the umask provokes hard-to-track bug reports.
 When the return value is used by the perl function C<chmod>, it is
 interpreted as an octal value.
 
@@ -2892,13 +2899,18 @@ sub processPL {
     return "" unless $self->{PL_FILES};
     my(@m, $plfile);
     foreach $plfile (sort keys %{$self->{PL_FILES}}) {
+        my $list = ref($self->{PL_FILES}->{$plfile})
+               ? $self->{PL_FILES}->{$plfile}
+               : [$self->{PL_FILES}->{$plfile}];
+       foreach $target (@$list) {
        push @m, "
-all :: $self->{PL_FILES}->{$plfile}
+all :: $target
        $self->{NOECHO}\$(NOOP)
 
-$self->{PL_FILES}->{$plfile} :: $plfile
-       \$(PERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) $plfile
+$target :: $plfile
+       \$(PERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) $plfile $target
 ";
+       }
     }
     join "", @m;
 }
@@ -3311,7 +3323,7 @@ sub tool_xsubpp {
        }
     }
 
-    $xsubpp = $self->{CAPI} ? "xsubpp -object_capi" : "xsubpp";
+    my $xsubpp = $self->{CAPI} ? "xsubpp -object_capi" : "xsubpp";
 
     return qq{
 XSUBPPDIR = $xsdir
@@ -3461,7 +3473,7 @@ Version_check:
 
 =item writedoc
 
-Obsolete, depecated method. Not used since Version 5.21.
+Obsolete, deprecated method. Not used since Version 5.21.
 
 =cut
 
@@ -3531,6 +3543,7 @@ and Win32 do.
 
 sub perl_archive
 {
+ return '$(PERL_INC)' . "/$Config{libperl}" if $^O eq "beos";
  return "";
 }