New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] Make h2ph correctly search gcc include directories #11319
Comments
From @ntyniSystem header conversion with "h2ph -a" is currently broken on Ubuntu # perl -e 'require "syscall.ph"' This happens because Ubuntu has switched to a 'multiarch' setup, see The asm subdirectory isn't in $Config{usrinc} anymore: /usr/include/asm gcc --print-search-dirs doesn't really tell anything about where gcc Parse the output of "gcc -v -E" instead, and append $Config{usrinc} The h2ph "-a" switch isn't currently tested automatically, and that # mkdir ttt The gcc invocation has been tested to work with gcc 4.6, 4.1, and 3.3. http://bugs.debian.org/625808 utils/h2ph.PL | 12 ++---------- Inline Patchdiff --git a/utils/h2ph.PL b/utils/h2ph.PL
index 87f3c7d..4545d6d 100644
--- a/utils/h2ph.PL
+++ b/utils/h2ph.PL
@@ -761,16 +761,8 @@ sub queue_includes_from
# non-GCC?) C compilers, but gcc uses additional include directories.
sub inc_dirs
{
- 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, $from_gcc . "-fixed", $Config{usrinc}) : ($Config{usrinc});
+ my $from_gcc = `LC_ALL=C $Config{cc} -v -E - < /dev/null 2>&1 | awk '/^#include/, /^End of search list/' | grep '^ '`;
+ length($from_gcc) ? (split(' ', $from_gcc), $Config{usrinc}) : ($Config{usrinc});
}
--
1.7.5.1 |
From @cpansproutOn Sun May 08 07:30:54 2011, ntyni@debian.org wrote:
Thank you. Applied as e7ec705. |
The RT System itself - Status changed from 'new' to 'open' |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#90122 (status was 'resolved')
Searchable as RT90122$
The text was updated successfully, but these errors were encountered: