In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/6c5080f25fa3dcede391007ffe328ea53779c52f?hp=72f80477dde6b7a55e4f16b0ed65951a10ef5fcc>

- Log -----------------------------------------------------------------
commit 6c5080f25fa3dcede391007ffe328ea53779c52f
Author: Niko Tyni <nt...@debian.org>
Date:   Sat Nov 17 19:27:42 2018 +0200

    Make Errno_pm.PL compatible with /usr/include/<ARCH>/errno.h
    
    As seen in <https://bugs.debian.org/798955>, Debian glibc
    maintainers intend to move system header files from /usr/include to
    /usr/include/<arch> at some point. This would break Errno_pm.PL, which
    has logic for asking cpp for the location of errno.h but fails earlier
    if errno.h is not on a list of known paths.
    
    Take the cpp fallback instead of dying. The behaviour should stay
    identical as long as errno.h is not moved.
    
    This will also enable multiarch (non-sysroot) cross builds.
    
    Original patch by Helmut Grohne.
    
    Bug-Debian: https://bugs.debian.org/875921

-----------------------------------------------------------------------

Summary of changes:
 ext/Errno/Errno_pm.PL | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index d565f31b2f..84fd151d27 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.29";
+our $VERSION = "1.30";
 
 my %err = ();
 
@@ -111,6 +111,17 @@ sub default_cpp {
 
 sub get_files {
     my %file = ();
+    # When cross-compiling we may store a path for gcc's "sysroot" option:
+    my $sysroot = $Config{sysroot} || '';
+    my $linux_errno_h;
+    if ($^O eq 'linux') {
+       # Some Linuxes have weird errno.hs which generate
+       # no #file or #line directives
+       ($linux_errno_h) = grep { -e $_ } map { "$_/errno.h" }
+           "$sysroot/usr/include", "$sysroot/usr/local/include",
+           split / / => $Config{locincpth};
+    }
+
     # VMS keeps its include files in system libraries
     if ($^O eq 'VMS') {
        $file{'Sys$Library:DECC$RTLDEF.TLB'} = 1;
@@ -125,17 +136,10 @@ sub get_files {
        }
     } elsif ($^O eq 'linux' &&
              $Config{gccversion} ne '' && 
-             $Config{gccversion} !~ /intel/i
+             $Config{gccversion} !~ /intel/i &&
              # might be using, say, Intel's icc
+             $linux_errno_h
             ) {
-    # 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" }
-           "$sysroot/usr/include", "$sysroot/usr/local/include",
-           split / / => $Config{locincpth} or
-               die "Cannot find errno.h";
        $file{$linux_errno_h} = 1;
     } elsif ($^O eq 'haiku') {
        # hidden in a special place

-- 
Perl5 Master Repository

Reply via email to