Subject: | Handle cross-compile builds |
From e29fa6d223f059a660413955605d28102825094f Mon Sep 17 00:00:00 2001
From: Brian Fraser <fraserbn@gmail.com>
Date: Fri, 31 Jan 2014 04:10:27 -0300
Subject: [PATCH] Makefile.PL: Handle cross-compile builds
If we're cross-compiling, we may not be able to simply run executables;
it's possible that we're running on the host, so check if $Config{run}
exists and we can use it to run things through.
---
cpan/Time-HiRes/Makefile.PL | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/cpan/Time-HiRes/Makefile.PL b/cpan/Time-HiRes/Makefile.PL
index 394cb91..6904b12 100644
--- a/cpan/Time-HiRes/Makefile.PL
+++ b/cpan/Time-HiRes/Makefile.PL
@@ -153,8 +153,10 @@ __EOD__
if ( $ok && exists $args{run} && $args{run}) {
my $tmp_exe =
File::Spec->catfile(File::Spec->curdir, $tmp_exe);
+ my @run = $tmp_exe;
+ unshift @run, $Config{run} if $Config{run} && -e $Config{run};
printf "Running $tmp_exe..." if $VERBOSE;
- if (system($tmp_exe) == 0) {
+ if (system(@run) == 0) {
$ok = 1;
} else {
$ok = 0;
--
1.8.3.2