[RFA] Remove incorrect CC options from mingw Makefile

Christopher Faylor <[email protected]> Fri, 16 Jul 2004 10:48:53 -0400
Newsgroups gmane.comp.gnu.mingw.patches
Message-ID <[email protected]>
[This is a resend of a patch that was sent a couple of days ago but is
awaiting moderator approval.  That previous email should probably be nuked.]

Danny,
Your recent (reverted) change to use -isystem instead of -I for mingw's
include exposed another lurking bug in that when building from the top
level of the "GNU tree", mingw could conceivably get some of cygwin's
includes.  Your change insured that and caused fwide.o not to compile
when building from the top-level.  I made an obvious change to fwide.c
but then fseeko64.c didn't build.  At that point, I realized that I
shouldn't be needing to make these changes since this code hadn't
changed.

Anyway, the patch below crudely removes all of the -isystem's from a
passed-in gcc.  This fixes the compile problem.  I'm not entirely happy
that I had to use sed for this but I couldn't find another way to do
this with gnu make or gcc options.

cgf

2004-07-15  Christopher Faylor  <[email protected]>

        * Makefile.in (CC): Strip inappropriate include file settings from any
        passed-in CC.

Index: Makefile.in
===================================================================
RCS file: /cvs/uberbaum/./winsup/mingw/Makefile.in,v
retrieving revision 1.50
diff -u -p -r1.50 Makefile.in
--- Makefile.in	14 Jul 2004 23:44:49 -0000	1.50
+++ Makefile.in	15 Jul 2004 04:05:32 -0000
@@ -70,7 +70,8 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 mkinstalldirs = $(SHELL) @MKINSTALLDIRS@
 
-CC = @CC@
+CC := @CC@
+override CC := ${filter-out -L% -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\)  *[^ ]*\( \|$$\)% %g'}}
 # FIXME: Which is it, CC or CC_FOR_TARGET?
 CC_FOR_TARGET = $(CC)
 AS_FOR_TARGET = $(AS)


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click