diff --git a/winsup/ChangeLog b/winsup/ChangeLog index a8cd810fc..7397af228 100644 --- a/winsup/ChangeLog +++ b/winsup/ChangeLog @@ -1,3 +1,8 @@ +2012-11-26 Christopher Faylor + + * ccwrap: Don't drop mingw header file paths unless we've specified + them with --with-windows-headers. + 2012-11-12 Christopher Faylor * Makefile.common: Revamp for new configury. Add default compilation diff --git a/winsup/ccwrap b/winsup/ccwrap index f442942ff..7580e7a3b 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; }