Cross Reference: Makefile.PL
xref
: /
osnet-11
/
usr
/
src
/
cmd
/
perl
/
5.8.4
/
distrib
/
ext
/
Digest
/
MD5
/
Makefile.PL
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
Makefile.PL revision 1
1
N/A
#
1
N/A
# CDDL HEADER START
1
N/A
#
1
N/A
# The contents of this file are subject to the terms of the
1
N/A
# Common Development and Distribution License, Version 1.0 only
1
N/A
# (the "License"). You may not use this file except in compliance
1
N/A
# with the License.
1
N/A
#
1
N/A
# You can obtain a copy of the license at
usr
/
src
/
OPENSOLARIS.LICENSE
1
N/A
# or
http://www.opensolaris.org/os/licensing
.
1
N/A
# See the License for the specific language governing permissions
1
N/A
# and limitations under the License.
1
N/A
#
1
N/A
# When distributing Covered Code, include this CDDL HEADER in each
1
N/A
# file and include the License file at
usr
/
src
/
OPENSOLARIS.LICENSE
.
1
N/A
# If applicable, add the following below this CDDL HEADER, with the
1
N/A
# fields enclosed by brackets "[]" replaced with your own identifying
1
N/A
# information: Portions Copyright [yyyy] [name of copyright owner]
1
N/A
#
1
N/A
# CDDL HEADER END
1
N/A
#
1
N/A
#!perl -w
1
N/A
1
N/A
BEGIN
{
require
5.004
}
1
N/A
use
strict
;
1
N/A
use
Config
qw
(%
Config
);
1
N/A
use
ExtUtils
::
MakeMaker
;
1
N/A
1
N/A
my
$
PERL_CORE
=
grep
$_
eq
"PERL_CORE=1"
, @
ARGV
;
1
N/A
1
N/A
my
@
extra
;
1
N/A
@
extra
= (
DEFINE
=>
"-DU32_ALIGNMENT_REQUIRED"
)
unless
free_u32_alignment
();
1
N/A
1
N/A
if
($^O
eq
'VMS'
) {
1
N/A
if
(
defined
($
Config
{
ccname
})) {
1
N/A
if
(
grep
(/
VMS_VAX
/, @
INC
) && ($
Config
{
ccname
}
eq
'DEC'
)) {
1
N/A
# VAX compiler optimizer even as late as v6.4 gets stuck
1
N/A
push
(@
extra
,
OPTIMIZE
=>
"/Optimize=(NODISJOINT)"
);
1
N/A
}
1
N/A
}
1
N/A
}
1
N/A
1
N/A
push
(@
extra
,
'INSTALLDIRS'
=>
'perl'
)
if
$] >=
5.008
;
1
N/A
push
(@
extra
,
'MAN3PODS'
=> {})
if
$
PERL_CORE
;
# Pods built by installman.
1
N/A
1
N/A
WriteMakefile
(
1
N/A
'NAME'
=>
'Digest::MD5'
,
1
N/A
'VERSION_FROM'
=>
'
MD5.pm
'
,
1
N/A
'PREREQ_PM'
=> {
'File::Spec'
=>
0
,
1
N/A
'Digest::base'
=>
'1.00'
,
1
N/A
},
1
N/A
@
extra
,
1
N/A
'dist'
=> {
COMPRESS
=>
'gzip -9f'
,
SUFFIX
=>
'gz'
, },
1
N/A
);
1
N/A
1
N/A
1
N/A
1
N/A
sub
free_u32_alignment
1
N/A
{
1
N/A
$|=
1
;
1
N/A
if
(
exists
$
Config
{
d_u32align
}) {
1
N/A
print
"Perl's config says that U32 access must "
;
1
N/A
print
"not "
unless
$
Config
{
d_u32align
};
1
N/A
print
"be aligned.\n"
;
1
N/A
return
!$
Config
{
d_u32align
};
1
N/A
}
1
N/A
1
N/A
if
($^O
eq
'VMS'
|| $^O
eq
'MSWin32'
) {
1
N/A
print
"Assumes that $^O implies free alignment for U32 access.\n"
;
1
N/A
return
1
;
1
N/A
}
1
N/A
1
N/A
if
($^O
eq
'hpux'
&& $
Config
{
osvers
} <
11.0
) {
1
N/A
print
"Will not test for free alignment on older HP-UX.\n"
;
1
N/A
return
0
;
1
N/A
}
1
N/A
1
N/A
print
"Testing alignment requirements for U32... "
;
1
N/A
open
(
ALIGN_TEST
,
">u32align.c"
)
or
die
"$!"
;
1
N/A
print
ALIGN_TEST
<<
'EOT'
;
close
(
ALIGN_TEST
);
1
N/A
/*--------------------------------------------------------------*/
1
N/A
/*
This
program
allocates
a
buffer
of
U8
(
char
)
and
then
tries
*/
1
N/A
/*
to
access
it
through
a
U32
pointer
at
every
offset
.
The
*/
1
N/A
/*
program
is
expected
to
die
with
a
bus
error
/
seg
fault
for
*/
1
N/A
/*
machines
that
do
not
support
unaligned
integer
read
/
write
*/
1
N/A
/*--------------------------------------------------------------*/
1
N/A
1
N/A
#include <stdio.h>
1
N/A
#include "EXTERN.h"
1
N/A
#include "perl.h"
1
N/A
1
N/A
#ifdef printf
1
N/A
#undef printf
1
N/A
#endif
1
N/A
1
N/A
int
main
(
int
argc
,
char
**
argv
,
char
**
env
)
1
N/A
{
1
N/A
#if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
1
N/A
U8
buf
[] =
"\0\0\0\1\0\0\0\0"
;
1
N/A
U32
*
up
;
1
N/A
int
i;
1
N/A
1
N/A
if
(
sizeof
(
U32
) !=
4
) {
1
N/A
printf
(
"sizeof(U32) is not 4, but %d\n"
,
sizeof
(
U32
));
1
N/A
exit
(
1
);
1
N/A
}
1
N/A
1
N/A
fflush
(
stdout
);
1
N/A
1
N/A
for
(i =
0
; i <
4
; i++) {
1
N/A
up
= (
U32
*)(
buf
+ i);
1
N/A
if
(! ((*
up
==
1
<< (
8
*i)) || /*
big
-
endian
*/
1
N/A
(*
up
==
1
<< (
8
*(
3
-i))) /*
little
-
endian
*/
1
N/A
)
1
N/A
)
1
N/A
{
1
N/A
printf
(
"read failed (%x)\n"
, *
up
);
1
N/A
exit
(
2
);
1
N/A
}
1
N/A
}
1
N/A
1
N/A
/*
write
test
*/
1
N/A
for
(i =
0
; i <
4
; i++) {
1
N/A
up
= (
U32
*)(
buf
+ i);
1
N/A
*
up
=
0xBeef
;
1
N/A
if
(*
up
!=
0xBeef
) {
1
N/A
printf
(
"write failed (%x)\n"
, *
up
);
1
N/A
exit
(
3
);
1
N/A
}
1
N/A
}
1
N/A
1
N/A
printf
(
"no restrictions\n"
);
1
N/A
exit
(
0
);
1
N/A
#else
1
N/A
printf
(
"unusual byteorder, playing safe\n"
);
1
N/A
exit
(
1
);
1
N/A
#endif
1
N/A
return
0
;
1
N/A
}
1
N/A
/*--------------------------------------------------------------*/
1
N/A
EOT
1
N/A
1
N/A
my
$
cc_cmd
=
"$Config{cc} $Config{ccflags} -I$Config{archlibexp}/CORE"
;
1
N/A
my
$
exe
=
"u32align$Config{exe_ext}"
;
1
N/A
$
cc_cmd
.=
" -o $exe"
;
1
N/A
my
$
rc
;
1
N/A
$
rc
=
system
(
"$cc_cmd $Config{ldflags} u32align.c $Config{libs}"
);
1
N/A
if
($
rc
) {
1
N/A
print
"Can't compile test program. Will ensure alignment to play safe.\n\n"
;
1
N/A
unlink
(
"u32align.c"
, $
exe
,
"u32align$Config{obj_ext}"
);
1
N/A
return
0
;
1
N/A
}
1
N/A
1
N/A
$
rc
=
system
(
"./$exe"
);
1
N/A
unlink
(
"u32align.c"
, $
exe
,
"u32align$Config{obj_ext}"
);
1
N/A
1
N/A
return
1
unless
$
rc
;
1
N/A
1
N/A
if
($
rc
>
0x80
) {
1
N/A
$
rc
>>=
8
;
1
N/A
print
"Test program exit status was $rc\n"
;
1
N/A
}
else
{
1
N/A
if
($
rc
&
0x80
) {
1
N/A
$
rc
&= ~
0x80
;
1
N/A
print
"Core dump deleted\n"
;
1
N/A
unlink
(
"core"
);
1
N/A
}
1
N/A
print
"signal $rc\n"
;
1
N/A
}
1
N/A
return
0
;
1
N/A
}