Re: RFC: mingw/runtime/mingwex/complex/carg.c (and Makefile problem)

Christopher Faylor <[email protected]> Thu, 15 Jul 2004 00:17:55 -0400
Newsgroups gmane.comp.gnu.mingw.patches
Message-ID <[email protected]>
On Wed, Jul 14, 2004 at 16:47, Danny Smith wrote:
>Thanks for the patch.
>There was already  a carg.c in the sources. It just wasn"t in the
>Makefile.  Fixed now.

Danny,
I don't see a carg.c in CVS, just in the Makefile.

This is causing builds to fail.

Your recent change to use -isystem instead of -I for mingw's include has
also 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 insures that and caused fwide.o not to build when
building from the top-level.  I made an obvioius 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 my problem.  I couldn't find another way to
do this with gnu make or gcc options.

I also made another minor change to mingwex/Makefile.in which I think
makes sense.

Ok to checkin?

cgf

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

        * Makefile.in (CC): Strip inappropriate include file settings from any
        passed-in CC.
	* mingwex/Makefile.in: Separate -isystem from it's argument with a space
	just in case srcdir does not begin with a '/'.


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)
@@ -99,7 +100,7 @@ LIBM_A=@LIBM_A@
 
 W32API_INCLUDE = @W32API_INCLUDE@
 INCLUDES+= -I$(srcdir)/include \
-  -isystem$(srcdir)/../include \
+  -isystem $(srcdir)/../include \
   -nostdinc \
   -iwithprefixbefore include
 ALL_CFLAGS = $(CFLAGS) $(W32API_INCLUDE) $(INCLUDES) $(MNO_CYGWIN)
@@ -472,5 +473,5 @@ lib%.a:%.def
 	$(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib lib$*.a --def $<
 
 .c.o:
+	echo "CC $(CC)"
 	$(CC) -c $(ALL_CFLAGS) $< -o $@
-
Index: mingwex/Makefile.in
===================================================================
RCS file: /cvs/uberbaum/./winsup/mingw/mingwex/Makefile.in,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile.in
--- mingwex/Makefile.in	14 Jul 2004 23:44:49 -0000	1.16
+++ mingwex/Makefile.in	15 Jul 2004 04:05:32 -0000
@@ -83,7 +83,7 @@ OPTFLAGS= -fomit-frame-pointer
 MNO_CYGWIN = @MNO_CYGWIN@
 
 W32API_INCLUDE = @W32API_INCLUDE@
-INCLUDES = -I$(srcdir) -isystem$(srcdir)/../include \
+INCLUDES = -I$(srcdir) -isystem $(srcdir)/../include \
   -nostdinc \
   -iwithprefixbefore include
 ALL_CFLAGS = $(CFLAGS) $(OPTFLAGS) $(W32API_INCLUDE) $(INCLUDES) $(MNO_CYGWIN)


-------------------------------------------------------
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