#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#!perl -w
BEGIN { require 5.004 }
use strict;
my @extra;
if ($^O eq 'VMS') {
# VAX compiler optimizer even as late as v6.4 gets stuck
}
}
}
'NAME' => 'Digest::MD5',
'VERSION_FROM' => 'MD5.pm',
'PREREQ_PM' => { 'File::Spec' => 0,
'Digest::base' => '1.00',
},
@extra,
);
{
$|=1;
if (exists $Config{d_u32align}) {
print "Perl's config says that U32 access must ";
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;
}
print "Will not test for free alignment on older HP-UX.\n";
return 0;
}
print "Testing alignment requirements for U32... ";
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
#include <stdio.h>
#include "EXTERN.h"
#include "perl.h"
#ifdef printf
#undef printf
#endif
{
#if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
int i;
exit(1);
}
for (i = 0; i < 4; i++) {
)
)
{
printf("read failed (%x)\n", *up);
exit(2);
}
}
/* write test */
for (i = 0; i < 4; 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;
}
/*--------------------------------------------------------------*/
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";
return 0;
}
$rc = system("./$exe");
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;
}