summaryrefslogtreecommitdiff
path: root/ext/Time/HiRes/Makefile.PL
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2005-10-25 11:56:53 +0000
committerSteve Peters <steve@fisharerojo.org>2005-10-25 11:56:53 +0000
commit3d0346a5d1004526830c70905c56755aecc6a442 (patch)
treeedb74549bd77b90aea2fb83224ee85f809a55559 /ext/Time/HiRes/Makefile.PL
parentb7da254d91daf34c2ec1b1f8cdcea45c11594cef (diff)
downloadperl-3d0346a5d1004526830c70905c56755aecc6a442.tar.gz
Upgrade to Time-HiRes-1.76
p4raw-id: //depot/perl@25845
Diffstat (limited to 'ext/Time/HiRes/Makefile.PL')
-rw-r--r--ext/Time/HiRes/Makefile.PL27
1 files changed, 19 insertions, 8 deletions
diff --git a/ext/Time/HiRes/Makefile.PL b/ext/Time/HiRes/Makefile.PL
index 386958feb5..edc42de67b 100644
--- a/ext/Time/HiRes/Makefile.PL
+++ b/ext/Time/HiRes/Makefile.PL
@@ -1,7 +1,7 @@
#!/usr/bin/perl
#
# In general we trust %Config, but for nanosleep() this trust
-# may be misplaces (it may be linkable but not really functional).
+# may be misplaced (it may be linkable but not really functional).
# Use $ENV{FORCE_NANOSLEEP_SCAN} to force rescanning whether there
# really is hope.
@@ -222,7 +222,7 @@ EOM
}
sub has_nanosleep {
- print "Trying out nanosleep... ";
+ print "testing... ";
return 1 if
try_compile_and_link(<<EOM, run => 1);
#include <time.h>
@@ -383,16 +383,27 @@ EOD
print "Looking for nanosleep()... ";
my $has_nanosleep;
- if (exists $Config{d_nanosleep} && !$ENV{FORCE_NANOSLEEP_SCAN}) {
- # Believe $Config{d_nanosleep}.
+ if ($ENV{FORCE_NANOSLEEP_SCAN}) {
+ print "forced scan... ";
+ if (has_nanosleep()) {
+ $has_nanosleep++;
+ $DEFINE .= ' -DTIME_HIRES_NANOSLEEP';
+ }
+ }
+ elsif (exists $Config{d_nanosleep}) {
+ print "believing \$Config{d_nanosleep}... ";
if ($Config{d_nanosleep}) {
$has_nanosleep++;
$DEFINE .= ' -DTIME_HIRES_NANOSLEEP';
}
- } elsif ($^O ne 'mpeix' && # MPE/iX falsely finds nanosleep.
- has_nanosleep()) {
- $has_nanosleep++;
- $DEFINE .= ' -DTIME_HIRES_NANOSLEEP';
+ } elsif ($^O =~ /^(mpeix)$/) {
+ # MPE/iX falsely finds nanosleep from its libc equivalent.
+ print "skipping because in $^O... ";
+ } else {
+ if (has_nanosleep()) {
+ $has_nanosleep++;
+ $DEFINE .= ' -DTIME_HIRES_NANOSLEEP';
+ }
}
if ($has_nanosleep) {