diff options
author | Jess Robinson <castaway@desert-island.me.uk> | 2012-10-19 19:05:25 +0100 |
---|---|---|
committer | Brian Fraser <fraserbn@gmail.com> | 2014-01-13 23:52:00 -0300 |
commit | 98b12e44bdf730698c03a5a4d8fc93c41d931637 (patch) | |
tree | 7e5e2a069858b7c47d8dbda449ab9affa999353d /ext/Errno | |
parent | c6fe3211fa33aa68aae52c93ae02166eb9df3057 (diff) | |
download | perl-98b12e44bdf730698c03a5a4d8fc93c41d931637.tar.gz |
Introduce sysroot variable to Configure
This is borrowed from gcc and allows us to indicate the logical root
directory for headers and libraries, under which all -I and -L are
searched for. This patch adjusts Configure to search under $sysroot
(if supplied) for headers and libraries, instead of /.
--sysroot is added to ccflags and friends so that make in
ExtUtils::MakeMaker, and other extensions, will use it.
Currently this is only done if compiling with some variant of gcc
or g++.
Diffstat (limited to 'ext/Errno')
-rw-r--r-- | ext/Errno/Errno_pm.PL | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL index 5d6bee58c6..db8ada73f4 100644 --- a/ext/Errno/Errno_pm.PL +++ b/ext/Errno/Errno_pm.PL @@ -2,7 +2,7 @@ use ExtUtils::MakeMaker; use Config; use strict; -our $VERSION = "1.20_01"; +our $VERSION = "1.20_02"; my %err = (); @@ -131,10 +131,12 @@ sub get_files { $Config{gccversion} !~ /intel/i # might be using, say, Intel's icc ) { + # When cross-compiling we may store a path for gcc's "sysroot" option: + my $sysroot = $Config{sysroot} || ''; # Some Linuxes have weird errno.hs which generate # no #file or #line directives my ($linux_errno_h) = grep { -e $_ } map { "$_/errno.h" } - "/usr/include", "/usr/local/include", + "$sysroot/usr/include", "$sysroot/usr/local/include", split / / => $Config{locincpth} or die "Cannot find errno.h"; $file{$linux_errno_h} = 1; |