diff options
author | Steve Hay <SteveHay@planit.com> | 2009-09-29 17:28:04 +0100 |
---|---|---|
committer | Steve Hay <SteveHay@planit.com> | 2009-09-29 17:29:02 +0100 |
commit | 2d53619e84b23c168ecb5cfd35e6cfb10dd066d0 (patch) | |
tree | bcf827d250a3b96d77b30344351549ea0a8dfae8 /make_ext.pl | |
parent | 4a5df3864868b2e99a39b861035a682e1ea6cb93 (diff) | |
download | perl-2d53619e84b23c168ecb5cfd35e6cfb10dd066d0.tar.gz |
On Win32, load File::Spec::Functions before chdir()ing somewhere where the
relative paths in @INC don't work.
Diffstat (limited to 'make_ext.pl')
-rw-r--r-- | make_ext.pl | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/make_ext.pl b/make_ext.pl index 81369b0510..7734bf585a 100644 --- a/make_ext.pl +++ b/make_ext.pl @@ -3,7 +3,13 @@ use strict; use warnings; use Config; BEGIN { - unshift @INC, $^O eq 'MSWin32' ? ('../cpan/Cwd', '../cpan/Cwd/lib') : 'cpan/Cwd'; + if ($^O eq 'MSWin32') { + unshift @INC, ('../cpan/Cwd', '../cpan/Cwd/lib'); + require File::Spec::Functions; + } + else { + unshift @INC, 'cpan/Cwd'; + } } use Cwd; @@ -288,11 +294,6 @@ sub build_extension { # another process has half-written. my @new_inc = ((map {"$up/$_"} @toolchain), $lib_dir); if ($is_Win32) { - # 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; |