diff options
author | Christopher Faylor <me@cgf.cx> | 2012-11-23 17:22:47 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-11-23 17:22:47 +0400 |
commit | 4c36016b570670b75fa2f9f396fb297a04fd09bd (patch) | |
tree | 1708c166aba9c96b9e57be0d894a7bd46268e54d /winsup/ccwrap | |
parent | 1cfd36169ccdb79e115c3a9fa4c5fa2e1372ba27 (diff) |
ChangeLog:
2012-11-12 Christopher Faylor <me.cygwin2012@cgf.cx>
* Makefile.common: Revamp for new configury. Add default compilation
targets, include .E processing. Add magic for allowing "CFLAGS" to
control optimization options in "CXXFLAGS".
* configure.cygwin: New include for Cygwin configure.in's.
* acinclude.m4: Delete old definitions. Implement AC_WINDOWS_HEADERS,
AC_WINDOWS_LIBS, AC_CYGWIN_INCLUDES, target_builddir, winsup_srcdir.
* aclocal.m4: Regenerate.
* autogen.sh: New file.
* ccwrap: New script.
* c++wrap: New script.
* config.guess: New script.
* config.sub: New script.
* configure: Regenerate.
* configure.in: Eliminate LIB_AC_PROG_* calls in favor of standard.
Delete ancient target test.
* install-sh: New script.
cygserver/ChangeLog:
2012-11-12 Christopher Faylor <me.cygwin2012@cgf.cx>
* Makefile.in: Revamp for new configury.
* configure.in: Revamp for new configury.
* aclocal.m4: Regenerate.
* configure: Ditto.
* autogen.sh: New script.
cygwin/ChangeLog:
2012-11-22 Christopher Faylor <me.cygwin2012@cgf.cx>
* select.cc (select): Don't return -1 when we've timed out after
looping.
2012-11-22 Christopher Faylor <me.cygwin2012@cgf.cx>
* Makefile.in: Revamp for new configury.
(datarootdir): Add variable setting.
(winver_stamp): Accommodate changes to mkvers.sh setting.
(libc.a): Fix race when libm.a might not have been built yet.
* configure.in: Revamp for new configury.
* aclocal.m4: Regenerate.
* configure: Ditto.
* autogen.sh: New script.
* mkvers.sh: Find include directives via CFLAGS and friends rather than
assuming that w32api lives nearby.
utils/ChangeLog:
2012-11-12 Christopher Faylor <me.cygwin2012@cgf.cx>
* aclocal.m4: Regenerate.
* configure: Ditto.
* autogen.sh: New script.
* configure.in: Revamp for new configury.
* Makefile.in: Revamp for new configury. Rename ALL_* to just *.
Always use "VERBOSE" setting.
(MINGW_CXX): Don't include CFLAGS in definition.
(all): Define target first, before everything else so that it is the
default.
(ps.exe): Don't add useless -lcygwin.
(ldh.exe): For consistency, add to existing MINGW_LDFLAGS rather than
redefining them.
(cygcheck.exe): Always include -lz for MINGW_LDFLAGS. Don't try to
figure out where to find it.
(dumper.exe): Simplify check. Assume libraries are installed rather
than trying to retrieve from source tree.
(install): Just use /bin/mkdir to create directories.
(Makefile): Regenerate when standard dependencies change.
* dump_setup.cc: Always include zlib.h. Remove accommodations for it
possibly not existing.
* parse_pe.cc: Add define which allows building with installed
binutils package.
* dumper.cc: Ditto.
Diffstat (limited to 'winsup/ccwrap')
-rwxr-xr-x | winsup/ccwrap | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/winsup/ccwrap b/winsup/ccwrap new file mode 100755 index 000000000..f442942ff --- /dev/null +++ b/winsup/ccwrap @@ -0,0 +1,50 @@ +#!/usr/bin/perl +use Cwd; +use strict; +my $cxx; +my $ccorcxx; +if ($ARGV[0] ne '++') { + $ccorcxx = 'CC'; + $cxx = 0; +} else { + shift @ARGV; + $ccorcxx = 'CXX'; + $cxx = 1; +} +die "$0: $ccorcxx environment variable does not exist\n" unless exists $ENV{$ccorcxx}; +my @compiler = split ' ', $ENV{$ccorcxx}; +if ("@ARGV" !~ / -nostdinc/o) { + my $fd; + push @compiler, ($cxx ? '-xc++' : '-xc'); + if (!open $fd, '-|') { + open STDERR, '>&', \*STDOUT; + exec @compiler, '/dev/null', '-v', '-E', '-o', '/dev/null' or die "*** error execing $compiler[0] - $!\n"; + } + $compiler[1] =~ s/xc/nostdinc/o; + push @compiler, '-nostdinc' if $cxx; + push @compiler, '-I' . $_ for split ' ', $ENV{CCWRAP_HEADERS}; + push @compiler, '-isystem', $_ for split ' ', $ENV{CCWRAP_SYSTEM_HEADERS}; + my $finding_paths = 0; + while (<$fd>) { + if (/^\*\*\*/o) { + print; + } elsif ($_ eq "#include <...> search starts here:\n") { + $finding_paths = 1; + } elsif (!$finding_paths) { + next; + } elsif ($_ eq "End of search list.\n") { + last; + } elsif (!m%w32api|mingw.*/include%o) { + chomp; + s/^\s+//; + push @compiler, '-isystem', Cwd::abs_path($_); + } + } + push @compiler, '-isystem', $_ for split ' ', $ENV{CCWRAP_DIRAFTER_HEADERS}; + close $fd; +} + +push @compiler, @ARGV; + +print join(' ', '+', @compiler), "\n" if $ENV{CCWRAP_VERBOSE}; +exec @compiler or die "$0: $compiler[0] failed to execute\n"; |