Change 17363 by jhi@alpha on 2002/06/26 15:41:48
Integrate from macperl:
[ 17345]
Mac OS Test updates
[ 17347]
Support hints and OPTIMIZE in MM_MacOS
[ 17348]
Crank down optimization for Mac OS in Digest::MD5
Affected files ...
.... //depot/perl/ext/Digest/MD5/hints/MacOS.pl#1 branch
.... //depot/perl/ext/POSIX/t/taint.t#3 integrate
.... //depot/perl/lib/ExtUtils/MM_MacOS.pm#8 integrate
.... //depot/perl/lib/Test/Harness/t/strap-analyze.t#14 integrate
.... //depot/perl/lib/Test/Harness/t/test-harness.t#18 integrate
Differences ...
==== //depot/perl/ext/Digest/MD5/hints/MacOS.pl#1 (text) ====
Index: perl/ext/Digest/MD5/hints/MacOS.pl
--- /dev/null Tue May 5 13:32:27 1998
+++ perl/ext/Digest/MD5/hints/MacOS.pl Wed Jun 26 08:41:48 2002
@@ -0,0 +1,3 @@
+# MWCPPC compiler needs to crank down the optimizations
+
+$self->{MWCPPCOptimize} = "-O1";
==== //depot/perl/ext/POSIX/t/taint.t#3 (text) ====
Index: perl/ext/POSIX/t/taint.t
--- perl/ext/POSIX/t/taint.t#2~17308~ Wed Jun 19 13:33:16 2002
+++ perl/ext/POSIX/t/taint.t Wed Jun 26 08:41:48 2002
@@ -28,13 +28,18 @@
my $TAINT = substr($^X, 0, 0);
-eval { mkfifo($TAINT. "TEST", 0) };
+# there is a bug in GUSI that causes problems trying to open
+# files and directories ... it is being fixed, this is just
+# a stopgap -- pudge
+my $file = $^O eq 'MacOS' ? 'TEST-OLD' : 'TEST';
+
+eval { mkfifo($TAINT. $file, 0) };
like($@, qr/^Insecure dependency/, 'mkfifo with tainted data');
-eval { $testfd = open($TAINT. "TEST", O_WRONLY, 0) };
+eval { $testfd = open($TAINT. $file, O_WRONLY, 0) };
like($@, qr/^Insecure dependency/, 'open with tainted data');
-eval { $testfd = open("TEST", O_RDONLY, 0) };
+eval { $testfd = open($file, O_RDONLY, 0) };
is($@, "", 'open with untainted data');
read($testfd, $buffer, 2) if $testfd > 2;
==== //depot/perl/lib/ExtUtils/MM_MacOS.pm#8 (text) ====
Index: perl/lib/ExtUtils/MM_MacOS.pm
--- perl/lib/ExtUtils/MM_MacOS.pm#7~17256~ Sun Jun 16 02:00:51 2002
+++ perl/lib/ExtUtils/MM_MacOS.pm Wed Jun 26 08:41:48 2002
@@ -53,6 +53,8 @@
$self = {} unless (defined $self);
+ check_hints($self);
+
my(%initial_att) = %$self; # record initial attributes
if (defined $self->{CONFIGURE}) {
@@ -75,6 +77,9 @@
@{"$newclass\:\:ISA"} = 'MM';
}
+ $ExtUtils::MakeMaker::Recognized_Att_Keys{$_} = 1
+ for map { $_ . 'Optimize' } qw(MWC MWCPPC MWC68K MPW MRC MRC SC);
+
if (defined $ExtUtils::MakeMaker::Parent[-2]){
$self->{PARENT} = $ExtUtils::MakeMaker::Parent[-2];
my $key;
@@ -154,7 +159,7 @@
dynamic_bs dynamic_lib static_lib manifypods
installbin subdirs dist_basics dist_core
dist_dir dist_test dist_ci install force perldepend makefile
- staticmake test pm_to_blib selfdocument cflags
+ staticmake test pm_to_blib selfdocument
const_loadlibs const_cccmd
/)
{
@@ -162,7 +167,7 @@
}
push @ExtUtils::MakeMaker::MM_Sections, "rulez"
unless grep /rulez/, @ExtUtils::MakeMaker::MM_Sections;
-
+
if ($self->{PARENT}) {
for (qw/install dist dist_basics dist_core dist_dir dist_test dist_ci/) {
$self->{SKIPHASH}{$_} = 1;
@@ -868,6 +873,17 @@
join "", @m;
}
+sub cflags {
+ my($self,$libperl) = @_;
+ my $optimize;
+
+ for (map { $_ . "Optimize" } qw(MWC MWCPPC MWC68K MPW MRC MRC SC)) {
+ $optimize .= "$_ = $self->{$_}" if exists $self->{$_};
+ }
+
+ return $self->{CFLAGS} = $optimize;
+}
+
sub _include { # for Unix-style includes, with -I instead of -i
my($inc) = @_;
require File::Spec::Unix;
@@ -880,6 +896,45 @@
}
}
+# yes, these are just copies of the same routines in
+# MakeMaker.pm, but with paths changed.
+sub check_hints {
+ my($self) = @_;
+ # We allow extension-specific hints files.
+
+ return unless -d ":hints";
+
+ # First we look for the best hintsfile we have
+ my($hint)="${^O}_$Config{osvers}";
+ $hint =~ s/\./_/g;
+ $hint =~ s/_$//;
+ return unless $hint;
+
+ # Also try without trailing minor version numbers.
+ while (1) {
+ last if -f ":hints:$hint.pl"; # found
+ } continue {
+ last unless $hint =~ s/_[^_]*$//; # nothing to cut off
+ }
+ my $hint_file = ":hints:$hint.pl";
+
+ return unless -f $hint_file; # really there
+
+ _run_hintfile($self, $hint_file);
+}
+
+sub _run_hintfile {
+ no strict 'vars';
+ local($self) = shift; # make $self available to the hint file.
+ my($hint_file) = shift;
+
+ local $@;
+ print STDERR "Processing hints file $hint_file\n";
+ my $ret = do $hint_file;
+ unless( defined $ret ) {
+ print STDERR $@ if $@;
+ }
+}
1;
__END__
==== //depot/perl/lib/Test/Harness/t/strap-analyze.t#14 (text) ====
Index: perl/lib/Test/Harness/t/strap-analyze.t
--- perl/lib/Test/Harness/t/strap-analyze.t#13~17256~ Sun Jun 16 02:00:51 2002
+++ perl/lib/Test/Harness/t/strap-analyze.t Wed Jun 26 08:41:48 2002
@@ -20,11 +20,11 @@
: File::Spec->catdir($Curdir, 't', 'sample-tests');
-my $IsMacPerl = $^O eq 'MacOS';
+my $IsMacOS = $^O eq 'MacOS';
my $IsVMS = $^O eq 'VMS';
# VMS uses native, not POSIX, exit codes.
-my $die_exit = $IsVMS ? 44 : 1;
+my $die_exit = $IsVMS ? 44 : $IsMacOS ? 0 : 1;
# We can only predict that the wait status should be zero or not.
my $wait_non_zero = 1;
@@ -470,7 +470,7 @@
delete $results{details};
SKIP: {
- skip '$? unreliable in MacPerl', 2 if $IsMacPerl;
+ skip '$? unreliable in MacPerl', 2 if $IsMacOS;
# We can only check if it's zero or non-zero.
is( !!$results{'wait'}, !!$expect->{'wait'}, 'wait status' );
==== //depot/perl/lib/Test/Harness/t/test-harness.t#18 (text) ====
Index: perl/lib/Test/Harness/t/test-harness.t
--- perl/lib/Test/Harness/t/test-harness.t#17~17256~ Sun Jun 16 02:00:51 2002
+++ perl/lib/Test/Harness/t/test-harness.t Wed Jun 26 08:41:48 2002
@@ -40,11 +40,11 @@
use Test::More;
-my $IsMacPerl = $^O eq 'MacOS';
+my $IsMacOS = $^O eq 'MacOS';
my $IsVMS = $^O eq 'VMS';
# VMS uses native, not POSIX, exit codes.
-my $die_estat = $IsVMS ? 44 : 1;
+my $die_estat = $IsVMS ? 44 : $IsMacOS ? 0 : 1;
my %samples = (
simple => {
@@ -439,7 +439,7 @@
select STDOUT;
# $? is unreliable in MacPerl, so we'll simply fudge it.
- $failed->{estat} = $die_estat if $IsMacPerl and $failed;
+ $failed->{estat} = $die_estat if $IsMacOS and $failed;
SKIP: {
skip "special tests for bailout", 1 unless $test eq 'bailout';
End of Patch.