[perl #24940] "sub foo :unique" segfaults
[p5sagit/p5-mst-13.2.git] / ext / Digest / MD5 / Makefile.PL
index e0db567..3448572 100644 (file)
@@ -5,6 +5,8 @@ use strict;
 use Config qw(%Config);
 use ExtUtils::MakeMaker;
 
+my $PERL_CORE = grep $_ eq "PERL_CORE=1", @ARGV;
+
 my @extra;
 @extra = (DEFINE => "-DU32_ALIGNMENT_REQUIRED") unless free_u32_alignment();
 
@@ -18,6 +20,7 @@ if ($^O eq 'VMS') {
 }
 
 push(@extra, 'INSTALLDIRS'  => 'perl') if $] >= 5.008;
+push(@extra, 'MAN3PODS' => {}) if $PERL_CORE; # Pods built by installman.
 
 WriteMakefile(
     'NAME'        => 'Digest::MD5',
@@ -34,10 +37,24 @@ WriteMakefile(
 sub free_u32_alignment
 {
     $|=1;
+    if (exists $Config{d_u32align}) {
+       print "Perl's config says that U32 access must ";
+       print "not " unless $Config{d_u32align};
+       print "be aligned.\n";
+       return !$Config{d_u32align};
+    }
+    
+    if ($^O eq 'VMS' || $^O eq 'MSWin32') {
+       print "Assumes that $^O implies free alignment for U32 access.\n";
+       return 1;
+    }
+    
+    if ($^O eq 'hpux' && $Config{osvers} < 11.0) {
+       print "Will not test for free alignment on older HP-UX.\n";
+       return 0;
+    }
+    
     print "Testing alignment requirements for U32... ";
-    return 1 if $^O eq 'VMS';
-    return 1 if $^O eq 'MSWin32';
-
     open(ALIGN_TEST, ">u32align.c") or die "$!";
     print ALIGN_TEST <<'EOT'; close(ALIGN_TEST);
 /*--------------------------------------------------------------*/