summaryrefslogtreecommitdiff
path: root/make_ext.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-09-29 16:23:37 +0100
committerNicholas Clark <nick@ccl4.org>2009-09-29 16:23:37 +0100
commite60ffd4f1584916e71476ec18523e5a74e213530 (patch)
treeabe739cca96084383e1407ae43b78eb8673d421f /make_ext.pl
parent9b7091183a0e6b41a658e590f90e543efae3b2e4 (diff)
downloadperl-e60ffd4f1584916e71476ec18523e5a74e213530.tar.gz
Only require File::Spec::Functions on Win32, as only it needs rel2abs().
This seems easier than changing @INC so that it loads, but causing all other platforms to have to load a module they don't need.
Diffstat (limited to 'make_ext.pl')
-rw-r--r--make_ext.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/make_ext.pl b/make_ext.pl
index e272d5b111..81369b0510 100644
--- a/make_ext.pl
+++ b/make_ext.pl
@@ -6,7 +6,6 @@ BEGIN {
unshift @INC, $^O eq 'MSWin32' ? ('../cpan/Cwd', '../cpan/Cwd/lib') : 'cpan/Cwd';
}
use Cwd;
-use File::Spec::Functions qw(rel2abs);
# To clarify, this isn't the entire suite of modules considered "toolchain"
# It's not even all modules needed to build ext/
@@ -289,7 +288,12 @@ sub build_extension {
# another process has half-written.
my @new_inc = ((map {"$up/$_"} @toolchain), $lib_dir);
if ($is_Win32) {
- @new_inc = map {rel2abs($_)} @new_inc;
+ # It feels somewhat wrong putting this in a loop, but require caches
+ # results, so is fast for subsequent calls. To my mind it's clearer
+ # here than putting the require somewhere far from the code it relates
+ # to.
+ require File::Spec::Functions;
+ @new_inc = map {File::Spec::Functions::rel2abs($_)} @new_inc;
}
$ENV{PERL5LIB} = join $Config{path_sep}, @new_inc;
$ENV{PERL_CORE} = 1;