summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-06-26 15:41:48 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-26 15:41:48 +0000
commit943b127a89808d65bbe1eec642a5fa38039659ae (patch)
treeba8b7a93d4cc130c0ebb655dd958df3b030f51b2 /lib
parent3f83dd72f21792ca0fcbec90728c3cad57c66994 (diff)
downloadperl-943b127a89808d65bbe1eec642a5fa38039659ae.tar.gz
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 p4raw-link: @17348 on //depot/macperl: 5e6109b944d42c12b5bf2560bc7d5e1e26b50cb5 p4raw-link: @17347 on //depot/macperl: 4fa8a8856377f81f41ceaba369f758c11cc6b898 p4raw-link: @17345 on //depot/macperl: ef506d9df705afe007449cf4101370864d7e1d79 p4raw-id: //depot/perl@17363 p4raw-branched: from //depot/macperl@17362 'branch in' ext/Digest/MD5/hints/MacOS.pl p4raw-integrated: from //depot/macperl@17362 'copy in' ext/POSIX/t/taint.t lib/ExtUtils/MM_MacOS.pm lib/Test/Harness/t/strap-analyze.t lib/Test/Harness/t/test-harness.t (@17344..)
Diffstat (limited to 'lib')
-rw-r--r--lib/ExtUtils/MM_MacOS.pm59
-rw-r--r--lib/Test/Harness/t/strap-analyze.t6
-rw-r--r--lib/Test/Harness/t/test-harness.t6
3 files changed, 63 insertions, 8 deletions
diff --git a/lib/ExtUtils/MM_MacOS.pm b/lib/ExtUtils/MM_MacOS.pm
index cbef99ba75..576d744730 100644
--- a/lib/ExtUtils/MM_MacOS.pm
+++ b/lib/ExtUtils/MM_MacOS.pm
@@ -53,6 +53,8 @@ sub new {
$self = {} unless (defined $self);
+ check_hints($self);
+
my(%initial_att) = %$self; # record initial attributes
if (defined $self->{CONFIGURE}) {
@@ -75,6 +77,9 @@ sub new {
@{"$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 @@ END
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 @@ END
}
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 @@ $target :: $plfile
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 @@ sub _include { # for Unix-style includes, with -I instead of -i
}
}
+# 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__
diff --git a/lib/Test/Harness/t/strap-analyze.t b/lib/Test/Harness/t/strap-analyze.t
index 06c0966e6e..02fa1d6390 100644
--- a/lib/Test/Harness/t/strap-analyze.t
+++ b/lib/Test/Harness/t/strap-analyze.t
@@ -20,11 +20,11 @@ my $SAMPLE_TESTS = $ENV{PERL_CORE}
: 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 @@ while( my($test, $expect) = each %samples ) {
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' );
diff --git a/lib/Test/Harness/t/test-harness.t b/lib/Test/Harness/t/test-harness.t
index c04e2e2cfa..e9f99c8a96 100644
--- a/lib/Test/Harness/t/test-harness.t
+++ b/lib/Test/Harness/t/test-harness.t
@@ -40,11 +40,11 @@ package main;
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 @@ while (my($test, $expect) = each %samples) {
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';