summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2022-10-11 16:34:05 +1100
committerTony Cook <tony@develop-help.com>2022-10-24 15:24:57 +1100
commit7b458feb0879135159f3c88ea8f0bf3f81074a7a (patch)
treed1104434996054bf7240af17eabbb40ba3dc8f1f
parent12d946775ed4f6329a449c54f0de9a6fbbf6ebb8 (diff)
downloadperl-7b458feb0879135159f3c88ea8f0bf3f81074a7a.tar.gz
Time::Hires: fix probing on the darwin system perl
The system compiler on recent-ish darwin doesn't appear to find the system perl headers when the CORE directory is supplied with -I, they need the directory to be specified by -iwithsysroot. Logic adapted from ExtUtils::MakeMaker.
-rw-r--r--dist/Time-HiRes/HiRes.pm2
-rw-r--r--dist/Time-HiRes/Makefile.PL13
2 files changed, 12 insertions, 3 deletions
diff --git a/dist/Time-HiRes/HiRes.pm b/dist/Time-HiRes/HiRes.pm
index 9b58ae1e90..bfd1cec4da 100644
--- a/dist/Time-HiRes/HiRes.pm
+++ b/dist/Time-HiRes/HiRes.pm
@@ -50,7 +50,7 @@ our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval
stat lstat utime
);
-our $VERSION = '1.9771';
+our $VERSION = '1.9772';
our $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
diff --git a/dist/Time-HiRes/Makefile.PL b/dist/Time-HiRes/Makefile.PL
index e5ba503707..a2650c2950 100644
--- a/dist/Time-HiRes/Makefile.PL
+++ b/dist/Time-HiRes/Makefile.PL
@@ -68,8 +68,17 @@ __EOD__
}
}
- my $ccflags = $Config{'ccflags'} . ' ' . "-I$COREincdir"
- . ' -DPERL_NO_INLINE_FUNCTIONS';
+ my $ccflags = $Config{'ccflags'} . ' ';
+ my @osvers = split /\./, $Config{osvers};
+ if ($^O eq "darwin"
+ && $^X eq "/usr/bin/perl"
+ && $osvers[0] >= 18) {
+ $ccflags .= qq(-iwithsysroot "$COREincdir");
+ }
+ else {
+ $ccflags .= "-I$COREincdir"
+ }
+ $ccflags .= ' -DPERL_NO_INLINE_FUNCTIONS';
if ($^O eq 'VMS') {
$cccmd = "$Config{'cc'} /include=($COREincdir) $tmp.c";