diff options
author | Jason Vas Dias <unknown> | 2005-11-01 07:22:45 -0800 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2005-11-10 12:22:43 +0000 |
commit | 11d31e4099a1aea2e58ca555440d3f7cb803eef3 (patch) | |
tree | 31911d3036d96967cd2f5dc64b52fab610aeb248 /utils | |
parent | 4358a253560c226dd674c77f83b913c071c4fa25 (diff) | |
download | perl-11d31e4099a1aea2e58ca555440d3f7cb803eef3.tar.gz |
[perl #37582] [PATCH] h2ph inc_dirs() fails to prepend gcc include search path, resulting in missing C standard headers on Linux
From: Jason Vas Dias (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.0.11-37582-123738.12.3509768746337@perl.org>
p4raw-id: //depot/perl@26074
Diffstat (limited to 'utils')
-rw-r--r-- | utils/h2ph.PL | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/utils/h2ph.PL b/utils/h2ph.PL index 6a5710b80a..e46ac208fc 100644 --- a/utils/h2ph.PL +++ b/utils/h2ph.PL @@ -734,9 +734,15 @@ sub queue_includes_from # non-GCC?) C compilers, but gcc uses an additional include directory. sub inc_dirs { - my $from_gcc = `$Config{cc} -v 2>&1`; - $from_gcc =~ s:^Reading specs from (.*?)/specs\b.*:$1/include:s; - + my $from_gcc = `LC_ALL=C $Config{cc} -v 2>&1`; + if( !( $from_gcc =~ s:^Reading specs from (.*?)/specs\b.*:$1/include:s ) ) + { # gcc-4+ : + $from_gcc = `LC_ALL=C $Config{cc} -print-search-dirs 2>&1`; + if ( !($from_gcc =~ s/^install:\s*([^\s]+[^\s\/])([\s\/]*).*$/$1\/include/s) ) + { + $from_gcc = ''; + }; + }; length($from_gcc) ? ($from_gcc, $Config{usrinc}) : ($Config{usrinc}); } |