From: Nicholas Clark Date: Fri, 5 Dec 2003 20:49:10 +0000 (+0000) Subject: Back out the Makefile.PL part of 21808 as requested by Gisle Aas X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a50f9722cb036c30107aa1792c3d52462a4218f5;p=p5sagit%2Fp5-mst-13.2.git Back out the Makefile.PL part of 21808 as requested by Gisle Aas p4raw-id: //depot/perl@21851 --- diff --git a/ext/Digest/MD5/Makefile.PL b/ext/Digest/MD5/Makefile.PL index e0db567..b2c974e 100644 --- a/ext/Digest/MD5/Makefile.PL +++ b/ext/Digest/MD5/Makefile.PL @@ -1,6 +1,4 @@ -#!perl -w - -BEGIN { require 5.004 } +require 5.004; use strict; use Config qw(%Config); use ExtUtils::MakeMaker; @@ -22,9 +20,7 @@ push(@extra, 'INSTALLDIRS' => 'perl') if $] >= 5.008; WriteMakefile( 'NAME' => 'Digest::MD5', 'VERSION_FROM' => 'MD5.pm', - 'PREREQ_PM' => { 'File::Spec' => 0, - 'Digest::base' => '1.00', - }, + MAN3PODS => {}, # Pods will be built by installman. @extra, 'dist' => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, ); @@ -33,101 +29,7 @@ WriteMakefile( sub free_u32_alignment { - $|=1; - 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); -/*--------------------------------------------------------------*/ -/* This program allocates a buffer of U8 (char) and then tries */ -/* to access it through a U32 pointer at every offset. The */ -/* program is expected to die with a bus error/seg fault for */ -/* machines that do not support unaligned integer read/write */ -/*--------------------------------------------------------------*/ - -#include -#include "EXTERN.h" -#include "perl.h" - -#ifdef printf - #undef printf -#endif - -int main(int argc, char** argv, char** env) -{ -#if BYTEORDER == 0x1234 || BYTEORDER == 0x4321 - U8 buf[] = "\0\0\0\1\0\0\0\0"; - U32 *up; - int i; - - if (sizeof(U32) != 4) { - printf("sizeof(U32) is not 4, but %d\n", sizeof(U32)); - exit(1); - } - - fflush(stdout); - - for (i = 0; i < 4; i++) { - up = (U32*)(buf + i); - if (! ((*up == 1 << (8*i)) || /* big-endian */ - (*up == 1 << (8*(3-i))) /* little-endian */ - ) - ) - { - printf("read failed (%x)\n", *up); - exit(2); - } - } - - /* write test */ - for (i = 0; i < 4; i++) { - up = (U32*)(buf + i); - *up = 0xBeef; - if (*up != 0xBeef) { - printf("write failed (%x)\n", *up); - exit(3); - } - } - - printf("no restrictions\n"); - exit(0); -#else - printf("unusual byteorder, playing safe\n"); - exit(1); -#endif - return 0; -} -/*--------------------------------------------------------------*/ -EOT - - my $cc_cmd = "$Config{cc} $Config{ccflags} -I$Config{archlibexp}/CORE"; - my $exe = "u32align$Config{exe_ext}"; - $cc_cmd .= " -o $exe"; - my $rc; - $rc = system("$cc_cmd $Config{ldflags} u32align.c $Config{libs}"); - if ($rc) { - print "Can't compile test program. Will ensure alignment to play safe.\n\n"; - unlink("u32align.c", $exe, "u32align$Config{obj_ext}"); - return 0; - } - - $rc = system("./$exe"); - unlink("u32align.c", $exe, "u32align$Config{obj_ext}"); - - return 1 unless $rc; - - if ($rc > 0x80) { - $rc >>= 8; - print "Test program exit status was $rc\n"; - } else { - if ($rc & 0x80) { - $rc &= ~0x80; - print "Core dump deleted\n"; - unlink("core"); - } - print "signal $rc\n"; - } + return 0 if $Config{d_u32align}; + return 1 if $Config{'byteorder'} eq '1234' || $Config{'byteorder'} eq '4321'; return 0; }