Integrate mainline 5.05_61
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / MM_Unix.pm
index 282d471..7c9657a 100644 (file)
@@ -388,12 +388,20 @@ sub cflags {
        $self->{CCFLAGS} .= ' -DPERL_POLLUTE ';
     }
 
+    my $pollute = '';
+    if ($Config{usemymalloc} and not $Config{bincompat5005}
+       and not $Config{ccflags} =~ /-DPERL_POLLUTE_MALLOC\b/
+       and $self->{PERL_MALLOC_OK}) {
+       $pollute = '$(PERL_MALLOC_DEF)';
+    }
+
     return $self->{CFLAGS} = qq{
 CCFLAGS = $self->{CCFLAGS}
 OPTIMIZE = $self->{OPTIMIZE}
 PERLTYPE = $self->{PERLTYPE}
 LARGE = $self->{LARGE}
 SPLIT = $self->{SPLIT}
+MPOLLUTE = $pollute
 };
 
 }
@@ -450,7 +458,7 @@ sub const_cccmd {
     return '' unless $self->needs_linking();
     return $self->{CONST_CCCMD} =
        q{CCCMD = $(CC) -c $(INC) $(CCFLAGS) $(OPTIMIZE) \\
-       $(PERLTYPE) $(LARGE) $(SPLIT) $(DEFINE_VERSION) \\
+       $(PERLTYPE) $(LARGE) $(SPLIT) $(MPOLLUTE) $(DEFINE_VERSION) \\
        $(XS_DEFINE_VERSION)};
 }
 
@@ -535,6 +543,7 @@ VERSION_MACRO = VERSION
 DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\"
 XS_VERSION_MACRO = XS_VERSION
 XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"
+PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc
 };
 
     push @m, qq{
@@ -1785,7 +1794,7 @@ usually solves this kind of problem.
        $self->prefixify($install_variable,$configure_prefix,$replace_prefix);
     }
     my $funkylibdir = $self->catdir($configure_prefix,"lib","perl5");
-    $funkylibdir = '' unless -d $funklibdir;
+    $funkylibdir = '' unless -d $funkylibdir;
     $search_prefix = $funkylibdir || $self->catdir($configure_prefix,"lib");
     if ($self->{LIB}) {
        $self->{INSTALLPRIVLIB} = $self->{INSTALLSITELIB} = $self->{LIB};
@@ -1810,7 +1819,7 @@ usually solves this kind of problem.
        }
     }
     my $funkymandir = $self->catdir($configure_prefix,"lib","perl5","man");
-    $funkymandir = '' unless -d $funkmandir;
+    $funkymandir = '' unless -d $funkymandir;
     $search_prefix = $funkymandir || $self->catdir($configure_prefix,"man");
     if (-d $self->catdir($self->{PREFIX},"lib","perl5", "man")) {
        $replace_prefix = $self->catdir(qq[\$\(PREFIX\)],"lib", "perl5", "man");
@@ -2673,7 +2682,9 @@ sub nicetext {
 
 =item parse_version
 
-parse a file and return what you think is $VERSION in this file set to
+parse a file and return what you think is $VERSION in this file set to.
+It will return the string "undef" if it can't figure out what $VERSION
+is.
 
 =cut
 
@@ -2701,7 +2712,7 @@ sub parse_version {
        };
        local($^W) = 0;
        $result = eval($eval);
-       die "Could not eval '$eval' in $parsefile: $@" if $@;
+       warn "Could not eval '$eval' in $parsefile: $@" if $@;
        $result = "undef" unless defined $result;
        last;
     }