diff options
author | H.Merijn Brand <h.m.brand@xs4all.nl> | 2013-09-02 11:40:41 +0200 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2013-11-08 14:46:06 +0100 |
commit | d7ce6d3bed362a1dd2cc232485f89bba47361cbb (patch) | |
tree | df462f519ffc386242efb96100c2b134e23dc035 /ext/Errno | |
parent | de75a672071f8e281efb6985c21bb2d83e0095a9 (diff) | |
download | perl-d7ce6d3bed362a1dd2cc232485f89bba47361cbb.tar.gz |
Search for errno.h in more (semi)default locations
Diffstat (limited to 'ext/Errno')
-rw-r--r-- | ext/Errno/Errno_pm.PL | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL index bb41e031fe..c2c84b6788 100644 --- a/ext/Errno/Errno_pm.PL +++ b/ext/Errno/Errno_pm.PL @@ -133,8 +133,10 @@ sub get_files { ) { # Some Linuxes have weird errno.hs which generate # no #file or #line directives - my $linux_errno_h = -e '/usr/include/errno.h' ? - '/usr/include/errno.h' : '/usr/local/include/errno.h'; + my ($linux_errno_h) = grep { -e $_ } map { "$_/errno.h" } + "/usr/include", "/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 @@ -252,8 +254,8 @@ sub write_errno_pm { $err{$name} = hex $expr; } else { - $err{$name} = eval $expr; - } + $err{$name} = eval $expr; + } delete $err{$name} unless defined $err{$name}; } close(CPPO); @@ -261,7 +263,7 @@ sub write_errno_pm { # escape $Config{'archname'} my $archname = $Config{'archname'}; - $archname =~ s/([@%\$])/\\\1/g; + $archname =~ s/([@%\$])/\\$1/g; # Write Errno.pm |