diff options
author | Christopher Faylor <me@cgf.cx> | 2012-11-26 19:00:35 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-11-26 19:00:35 +0000 |
commit | 96079146c4b6487b335ba19dca5685eaedb7a1e3 (patch) | |
tree | 9dd1ff2d196ad30a7b3f597fa298c3d3cd1fcfc0 /winsup/ccwrap | |
parent | 7b2d80eb87819b8f5183016059c8034b63a94295 (diff) | |
download | newlib-96079146c4b6487b335ba19dca5685eaedb7a1e3.zip newlib-96079146c4b6487b335ba19dca5685eaedb7a1e3.tar.gz newlib-96079146c4b6487b335ba19dca5685eaedb7a1e3.tar.bz2 |
* ccwrap: Don't drop mingw header file paths unless we've specified them with
--with-windows-headers.
Diffstat (limited to 'winsup/ccwrap')
-rwxr-xr-x | winsup/ccwrap | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/ccwrap b/winsup/ccwrap index f442942..7580e7a 100755 --- a/winsup/ccwrap +++ b/winsup/ccwrap @@ -25,6 +25,11 @@ if ("@ARGV" !~ / -nostdinc/o) { push @compiler, '-I' . $_ for split ' ', $ENV{CCWRAP_HEADERS}; push @compiler, '-isystem', $_ for split ' ', $ENV{CCWRAP_SYSTEM_HEADERS}; my $finding_paths = 0; + my $mingw_compiler = $compiler[0] =~ /mingw/o; + my @dirafters; + for my $d (split ' ', $ENV{CCWRAP_DIRAFTER_HEADERS}) { + push @dirafters, '-isystem', $d if !$mingw_compiler || $d !~ /w32api/o; + } while (<$fd>) { if (/^\*\*\*/o) { print; @@ -34,13 +39,13 @@ if ("@ARGV" !~ / -nostdinc/o) { next; } elsif ($_ eq "End of search list.\n") { last; - } elsif (!m%w32api|mingw.*/include%o) { + } elsif (!@dirafters || !m%w32api|mingw.*/include%o) { chomp; s/^\s+//; push @compiler, '-isystem', Cwd::abs_path($_); } } - push @compiler, '-isystem', $_ for split ' ', $ENV{CCWRAP_DIRAFTER_HEADERS}; + push @compiler, @dirafters; close $fd; } |