From: Jason Vas Dias Date: Tue, 1 Nov 2005 15:22:45 +0000 (-0800) Subject: [perl #37582] [PATCH] h2ph inc_dirs() fails to prepend gcc include search path, resul... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=11d31e4099a1aea2e58ca555440d3f7cb803eef3;p=p5sagit%2Fp5-mst-13.2.git [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) Message-ID: p4raw-id: //depot/perl@26074 --- diff --git a/utils/h2ph.PL b/utils/h2ph.PL index 6a5710b..e46ac20 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}); }